-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #696 from sgfost/build/config-cleanup
build refactor: replace config.ini with combination of environment variables + docker secrets - use environment variables for basic configuration and docker secrets for anything that should not be exposed - adding new configuration variables or secrets should now be independent of each other - closes comses/planning#145
- Loading branch information
Showing
14 changed files
with
527 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# app | ||
RELEASE_VERSION= | ||
EXPIRED_JOB_DAYS_THRESHOLD=180 | ||
EXPIRED_EVENT_DAYS_THRESHOLD=2 | ||
|
||
# database | ||
DB_NAME=comsesnet | ||
DB_USER=comsesnet | ||
DB_HOST=db | ||
DB_PORT=5432 | ||
DB_PASSWORD= | ||
CLEAN_DATABASE="false" # allowed values: "true" or "false" | ||
|
||
# elastic search | ||
ES_VERSION=7.17.18 | ||
|
||
# captcha | ||
HCAPTCHA_SITEKEY= | ||
# HCAPTCHA_SECRET= | ||
|
||
# discourse | ||
DISCOURSE_BASE_URL= | ||
DISCOURSE_API_USERNAME= | ||
|
||
EMAIL_SUBJECT_PREFIX=[CoMSES Net] | ||
# MAILGUN_API_KEY= | ||
MAILGUN_SENDER_DOMAIN= | ||
|
||
# logging | ||
LOG_DIRECTORY=/shared/logs | ||
SENTRY_DSN= | ||
|
||
# secrets | ||
# DISCOURSE_SSO_SECRET= | ||
# DISCOURSE_API_KEY= | ||
# django secret key | ||
# SECRET_KEY= | ||
|
||
GITHUB_CLIENT_ID= | ||
# GITHUB_CLIENT_SECRET= | ||
ORCID_CLIENT_ID= | ||
# ORCID_CLIENT_SECRET= | ||
|
||
# storage | ||
DATA_ROOT=/shared | ||
LIBRARY_ROOT=/shared/library | ||
REPOSITORY_ROOT=/shared/repository | ||
|
||
# test | ||
TEST_USER_ID=10000000 | ||
TEST_USERNAME=__test_user__ | ||
TEST_BASIC_AUTH_PASSWORD= |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/bash | ||
|
||
# envreplace: replace environment variables in a file | ||
# usage: envreplace <VAR_NAME> <new_value> [file (default: .env)] | ||
|
||
VAR_NAME=$1 | ||
NEW_VALUE=$2 | ||
ENV_FILE=${3:-".env"} | ||
|
||
if [ -z "$VAR_NAME" ] || [ -z "$NEW_VALUE" ]; then | ||
echo "usage: envreplace <VAR_NAME> <new_value> [file (default: .env)]" | ||
exit 1 | ||
fi | ||
|
||
if sed --version 2>&1 | grep -q "GNU"; then | ||
SED_CMD="sed -i" # GNU sed | ||
else | ||
SED_CMD="sed -i ''" # BSD sed | ||
fi | ||
|
||
if grep -q "^$VAR_NAME=" "$ENV_FILE"; then | ||
$SED_CMD "s|^$VAR_NAME=.*|$VAR_NAME=$NEW_VALUE|" "$ENV_FILE" | ||
else | ||
echo "$VAR_NAME not found in $ENV_FILE" | ||
# echo "$VAR_NAME=$NEW_VALUE" >> $ENV_FILE | ||
fi |
Oops, something went wrong.