Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Automatically set Pretix to maintenance mode #487

Open
TobiasDeBruijn opened this issue Dec 29, 2024 · 5 comments · May be fixed by #488
Open

Feature: Automatically set Pretix to maintenance mode #487

TobiasDeBruijn opened this issue Dec 29, 2024 · 5 comments · May be fixed by #488
Assignees
Labels
enhancement Proposes (changes to) a feature

Comments

@TobiasDeBruijn
Copy link
Member

Due to Mollie and Pretix's report cut-off (and Mollie's payment) cutoff being slightly different, this can lead to some headaches for the treasurer when booking in the sales, as the sale can be in week 1 for Mollie, but in week 2 for Pretix, leading to some annoying digging every so often. This only occurs in the night from Sunday to Monday.
Since Pretix now has a new maintenance mode, I'd like Pretix to be in said mode between Sunday 22:00 and Monday 05:00 every week.

@SilasPeters you're much more familiar with Ansible than I am, what would be the best way to perform this? I could imagine a local copy of sadserver on sadserver, and a cronjob which flips the variable on Sunday evening and deploys, and one which does just the opposite on Monday morning. Though I'm sure there is a prettier way to accomplish that.

@SilasPeters
Copy link
Member

I agree with that this feature is required

I studied your current ansible configs for the maintenance things, and I think automating this can be simple.

Setting up pretix involves installing all relevant files - also the maintenance html and nginx config. If I understand correctly, we can then toggle the maintenance mode by simply replacing the nginx file in the sites-available with a new symlink to the current config: live or maintenance.

We can thus create a periodic timer which triggers a systemd service, which simply replaces the symlink and reloads nginx.

@TobiasDeBruijn
Copy link
Member Author

Oh that seems better than the way I do it currently. Then we can remove some when clauses from the playbook as well.

Do you have the time to implement this?

@SilasPeters
Copy link
Member

You do Wilford, I do this 🫡

@SilasPeters SilasPeters self-assigned this Dec 30, 2024
@SilasPeters SilasPeters added the enhancement Proposes (changes to) a feature label Dec 30, 2024
@SilasPeters
Copy link
Member

I assume the given times must be compared to UTC time and not local time? If so, are the given times already UTC offset (aka should they be 2100 and 0400 iirc)?

@TobiasDeBruijn
Copy link
Member Author

The times I specified are UTC. This way, no matter what timezone Pretix and Mollie use (I.e., CET or CEST), it will never mess up.

@SilasPeters SilasPeters linked a pull request Jan 1, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposes (changes to) a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants