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

Add Rex task to show/hide scheduled downtime message #17

Open
preaction opened this issue Oct 17, 2016 · 4 comments
Open

Add Rex task to show/hide scheduled downtime message #17

preaction opened this issue Oct 17, 2016 · 4 comments

Comments

@preaction
Copy link
Member

We should have an easy way to show/hide the scheduled maintenance message. This should be done via a Rex task.

There should be two Rex tasks: One to show the downtime message, one to hide it and return to normal operation. The Rex tasks should work via Debian's default Apache config tools: a2ensite and a2dissite. The downtime message should be its own site config, and the Rex task should enable/disable the appropriate sites as needed.

Everything about the downtime message should be in the cpantesters-deploy project, including the site config file, and the downtime message HTML itself. The user should be prompted to update the downtime message (by opening $EDITOR locally) before uploading it to the server and enabling it.

In order for the message to be displayed, the Fastly cache will need to be cleared. This should be done via an API if possible, otherwise the user should be instructed to clear the Fastly cache manually.

@preaction
Copy link
Member Author

preaction commented Oct 17, 2016

@ranguard mentioned we can use Net::Fastly to try to access the Fastly API automatically to do these things. The Fastly web UI has a way to generate API keys that can be used to limit access to simply the commands we want people to be able to run (since our Rexfile is public, which means the API keys will also be public). Otherwise, we'll have to figure out a way to secure the thing, which may mean forcing operations folks to have their own API keys (since they already need their own accounts on the cpantesters servers anyway).

@ranguard
Copy link

Generating a token https://docs.fastly.com/api/auth#tokens_db4655a45a0107448eb0676577446e40

Make sure to limit to the scope ( https://docs.fastly.com/api/auth#scopes ) to just purging, and probably a specific service.

@preaction
Copy link
Member Author

The CPAN and BackPAN mirrors on cpantesters.org are also down. The maintenance on the CPAN Testers app should not affect them, so the configuration should find a way to keep them up.

@preaction
Copy link
Member Author

The mirrors are back up, and there are now start_maintenance and stop_maintenance tasks in the Rexfile to start and stop the maintenance mode, which disables the app sites, enables the maintenance sites, and keeps the cpan/backpan mirrors up.

It does not yet automatically purge the Fastly cache, that remains to be done.

preaction added a commit to cpan-testers/cpantesters-deploy that referenced this issue Oct 19, 2016
This also adds appropriate tasks to start/stop maintenance mode.

Refs cpan-testers/cpantesters-project#17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants