Improve startup behavior

This commit is contained in:
R. Miles McCain 2020-06-13 23:59:36 +00:00
parent 919ca52ca1
commit 81a836df53
No known key found for this signature in database
GPG Key ID: F1053629E2905557
2 changed files with 20 additions and 35 deletions

View File

@ -25,66 +25,66 @@
}, },
"env": { "env": {
"DB_NAME": { "DB_NAME": {
"description": "Database name (PostgreSQL)", "description": "Postgres database name (not required if using Postgres addon)",
"value": "shynet", "value": "shynet",
"required": false "required": false
}, },
"DB_USER": { "DB_USER": {
"description": "Database username", "description": "Postgres database username (not required if using Postgres addon)",
"value": "", "value": "",
"required": false "required": false
}, },
"DB_PASSWORD": { "DB_PASSWORD": {
"description": "Database password", "description": "Postgres database password (not required if using Postgres addon)",
"value": "", "value": "",
"required": false "required": false
}, },
"DB_HOST": { "DB_HOST": {
"description": "Database hostname", "description": "Postgres database hostname (not required if using Postgres addon)",
"value": "", "value": "",
"required": false "required": false
}, },
"DB_PORT": { "DB_PORT": {
"description": "Database port", "description": "Postgres database port (not required if using Postgres addon)",
"value": "5432", "value": "5432",
"required": false "required": false
}, },
"EMAIL_HOST": { "EMAIL_HOST": {
"description": "SMTP server hostname", "description": "SMTP server hostname (for sending emails)",
"value": "smtp.gmail.com", "value": "smtp.gmail.com",
"required": false "required": false
}, },
"EMAIL_PORT": { "EMAIL_PORT": {
"description": "SMTP server port", "description": "SMTP server port (for sending emails)",
"value": "465", "value": "465",
"required": false "required": false
}, },
"EMAIL_HOST_USER": { "EMAIL_HOST_USER": {
"description": "SMTP server username", "description": "SMTP server username (for sending emails)",
"value": "@gmail.com", "value": "@gmail.com",
"required": false "required": false
}, },
"EMAIL_HOST_PASSWORD": { "EMAIL_HOST_PASSWORD": {
"description": "SMTP server password", "description": "SMTP server password (for sending emails)",
"value": "", "value": "",
"required": false "required": false
}, },
"SERVER_EMAIL": { "SERVER_EMAIL": {
"description": "Sender email address", "description": "Email address (for sending emails)",
"value": "<shynet> noreply@shynet.example.com", "value": "<Shynet> noreply@shynet.example.com",
"required": false "required": false
}, },
"DJANGO_SECRET_KEY": { "DJANGO_SECRET_KEY": {
"description": "General Django settings", "description": "Django secret key",
"generator": "secret" "generator": "secret"
}, },
"ALLOWED_HOSTS": { "ALLOWED_HOSTS": {
"description": "For better security, set this to your deployment's domain. Comma separated.", "description": "For better security, set this to your deployment's domain. (Where you will actually host, not embed, Shynet.) Set to '*' to allow serving all domains.",
"value": "*", "value": "*",
"required": false "required": false
}, },
"SIGNUPS_ENABLED": { "SIGNUPS_ENABLED": {
"description": "Set to True (capitalized) if you want people to be able to sign up for your Shynet instance (not recommended)", "description": "Set to True (capitalized) if you want people to be able to sign up for your Shynet instance (not recommended).",
"value": "False", "value": "False",
"required": false "required": false
}, },
@ -94,7 +94,7 @@
"required": false "required": false
}, },
"SCRIPT_USE_HTTPS": { "SCRIPT_USE_HTTPS": {
"description": "Set to 'False' if you will not be serving content over HTTPS", "description": "Set to 'False' if you will not be serving Shynet over HTTPS.",
"value": "True", "value": "True",
"required": false "required": false
}, },
@ -109,29 +109,14 @@
"required": false "required": false
}, },
"ONLY_SUPERUSERS_CREATE": { "ONLY_SUPERUSERS_CREATE": {
"description": "when you'd like to invite others to your Shynet instance but don't want them to be able to create services of their owShould only superusers (admins) be able to create services? This is helpfuln.", "description": "Should only superusers (admins) be able to create tracked services?",
"value": "True", "value": "True",
"required": false "required": false
}, },
"PERFORM_CHECKS_AND_SETUP": { "PERFORM_CHECKS_AND_SETUP": {
"description": "Whether to perform checks and setup at startup, including applying unapplied migrations. For most setups, the recommended value is True. Defaults to True. Will skip only if value is False.", "description": "Whether to perform checks and setup at startup. Recommended value is 'True' for Heroku users.",
"value": "True", "value": "True",
"required": false "required": false
},
"SHYNET_ADMIN_EMAIL": {
"description": "Your admin user email. A temporary password will be printed to the console on first run.",
"value": "admin@example.com",
"required": false
},
"SHYNET_HOST": {
"description": "The domain on which you'll be hosting Shynet.",
"value": "your-app.herokuapp.com",
"required": false
},
"SHYNET_WHITELABEL": {
"description": "What you'd like to call your Shynet instance.",
"value": "shynet-analytics",
"required": false
} }
} }
} }

View File

@ -12,13 +12,13 @@ if [[ ${sanity_results[0]} == True ]]; then
else else
echo "Database is ready to go." echo "Database is ready to go."
fi fi
if [[ -n $SHYNET_ADMIN_EMAIL && ${sanity_results[1]} == True ]]; then if [[ ${sanity_results[1]} == True ]]; then
echo "Warning: no admin user available. Consult docs for instructions." echo "Warning: no admin user available. Consult docs for instructions."
fi fi
if [[ -n $SHYNET_HOST && ${sanity_results[2]} == True ]]; then if [[ ${sanity_results[2]} == True ]]; then
echo "Warning: Shynet's hostname is not set. The script won't work correctly. Consult docs for instructions." echo "Warning: Shynet's hostname is not set. The script won't work correctly. Consult docs for instructions."
fi fi
if [[ -n $SHYNET_WHITELABEL && ${sanity_results[3]} == True ]]; then if [[ ${sanity_results[3]} == True ]]; then
echo "Warning: Shynet's whitelabel is not set. Consult docs for instructions." echo "Warning: Shynet's whitelabel is not set. Consult docs for instructions."
fi fi
echo "Startup checks complete!" echo "Startup checks complete!"