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

Check if DO_USER_DATA_URL destination exists. #32

Open
slothbear opened this issue Nov 6, 2020 · 1 comment
Open

Check if DO_USER_DATA_URL destination exists. #32

slothbear opened this issue Nov 6, 2020 · 1 comment

Comments

@slothbear
Copy link
Member

(one of?) The downside of automating the heck out of server boot is if anything goes wrong, it can be hard to diagnose.

For instance, if you change the boot YML and don't change the DO_USER_DATA_URL on Heroku, the droplet won't find the file.

user_data: open(ENV['DO_USER_DATA_URL']).read # ROFLMAO

This wasn't a problem in the past because server startup included: change YML, change config var. The goal is not to require changes to the YML every week. But YML will still change from time to time.

Step 1: check if the destination exists and tell Slack if not.
Step 2: check everything else.

Or, a post-commit hook on the YML that auto-updates DO_USER_DATA_URL? Over-engineering at its finest.

@slothbear slothbear changed the title Check if DO_USER_DATA_URL destination exists, emit error if not. Check if DO_USER_DATA_URL destination exists. Nov 6, 2020
@slothbear
Copy link
Member Author

The Raw URL/token will change when the underlying file changes, but it also goes away very quickly. I saw different durations, but never over 1 minute. The current method works because the previous startup instructions changed the URL then immediately booted the server. No way the token will be valid the following week.

A community post suggests using a private gist:
https://github.community/t/how-to-get-a-permanent-token-of-a-single-raw-file-of-a-private-github-repo-that-will-lasts-for-several-days/125205

Most of the file is not sensitive. There is a private key for logging into the server. And some public keys for admin users.

A private gist can be ready by anyone with the URL. Perhaps we can store the sensitive information somewhere else, then use a private gist, or even a public repository (wither?) for the bulk of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant