Commit 31a63e97 authored by sim's avatar sim

[CONF] Populate ALLOWED_HOSTS at setup

parent 4f1c8c44
...@@ -5,7 +5,7 @@ DEBUG = {DEBUG} ...@@ -5,7 +5,7 @@ DEBUG = {DEBUG}
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = {SECRET_KEY} SECRET_KEY = {SECRET_KEY}
# Space-separated list of hosts # Space-separated list of hosts
ALLOWED_HOSTS = ALLOWED_HOSTS = {HOSTNAME}
# Time-zone, possible values here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones # Time-zone, possible values here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TIME_ZONE = {TIME_ZONE} TIME_ZONE = {TIME_ZONE}
# PostgreSQL access # PostgreSQL access
......
...@@ -90,6 +90,11 @@ fi ...@@ -90,6 +90,11 @@ fi
[ "$DEBUG" = "False" ] && LOG_LEVEL=INFO || LOG_LEVEL=DEBUG [ "$DEBUG" = "False" ] && LOG_LEVEL=INFO || LOG_LEVEL=DEBUG
echo "▸ Configure allowed hosts for Django backend..."
read -p "Hostname [localhost]: " HOSTNAME
HOSTNAME=${HOSTNAME:-localhost}
echo "▸ PostgreSQL configuration..." echo "▸ PostgreSQL configuration..."
DB_NAME_DEFAULT=gargandb DB_NAME_DEFAULT=gargandb
...@@ -140,6 +145,7 @@ DB_URI="postgres://"$(escape_url "$PGREST_USER")":"$(escape_url "$PGREST_PASS")" ...@@ -140,6 +145,7 @@ DB_URI="postgres://"$(escape_url "$PGREST_USER")":"$(escape_url "$PGREST_PASS")"
PGREST_DB_URI=$(escape_pgrest "$DB_URI") PGREST_DB_URI=$(escape_pgrest "$DB_URI")
PGREST_SECRET_KEY=$(escape_pgrest "$SECRET_KEY") PGREST_SECRET_KEY=$(escape_pgrest "$SECRET_KEY")
SECRET_KEY=$(escape_ini "$SECRET_KEY") SECRET_KEY=$(escape_ini "$SECRET_KEY")
HOSTNAME=$(escape_ini "$HOSTNAME")
TIME_ZONE=$(escape_ini "$TIME_ZONE") TIME_ZONE=$(escape_ini "$TIME_ZONE")
DB_HOST=$(escape_ini "${DB_HOST:-127.0.0.1}") DB_HOST=$(escape_ini "${DB_HOST:-127.0.0.1}")
DB_PORT=$(escape_ini "${DB_PORT:-5432}") DB_PORT=$(escape_ini "${DB_PORT:-5432}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment