Inject REST port, user, password from environment (#220)

Enable the port, user, and password used by Core for the REST API to be
injected using environment variables.
This commit is contained in:
skoranda
2018-03-10 01:24:20 -06:00
committed by Abhilash Raj
parent d26c402617
commit 5a8e7f02fc
2 changed files with 28 additions and 0 deletions

View File

@@ -41,6 +41,19 @@ if [[ ! -v SMTP_PORT ]]; then
export SMTP_PORT=25
fi
# Check if REST port, username, and password are set, if not, set them
# to default values.
if [[ ! -v MAILMAN_REST_PORT ]]; then
export MAILMAN_REST_PORT='8001'
fi
if [[ ! -v MAILMAN_REST_USER ]]; then
export MAILMAN_REST_USER='restadmin'
fi
if [[ ! -v MAILMAN_REST_PASSWORD ]]; then
export MAILMAN_REST_PASSWORD='restpass'
fi
function setup_database () {
if [[ ! -v DATABASE_URL ]]
@@ -116,6 +129,9 @@ sleep_time: 10s
[webservice]
hostname: $MM_HOSTNAME
port: $MAILMAN_REST_PORT
admin_user: $MAILMAN_REST_USER
admin_pass: $MAILMAN_REST_PASSWORD
[archiver.hyperkitty]
class: mailman_hyperkitty.Archiver