fix: template secret, skip _FILE dance
This commit is contained in:
parent
b2a29da9a3
commit
a5f9105613
|
@ -11,7 +11,6 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- LETSENCRYPT_HOST=${DOMAIN}
|
- LETSENCRYPT_HOST=${DOMAIN}
|
||||||
- SYNAPSE_ADMIN_EMAIL
|
- SYNAPSE_ADMIN_EMAIL
|
||||||
- SYNAPSE_DB_PASSWORD_FILE=/run/secrets/db_password
|
|
||||||
- SYNAPSE_REPORT_STATS=no
|
- SYNAPSE_REPORT_STATS=no
|
||||||
- SYNAPSE_SERVER_NAME=${DOMAIN}
|
- SYNAPSE_SERVER_NAME=${DOMAIN}
|
||||||
- VIRTUAL_HOST=${DOMAIN}
|
- VIRTUAL_HOST=${DOMAIN}
|
||||||
|
|
|
@ -1,29 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
file_env() {
|
|
||||||
local var="$1"
|
|
||||||
local fileVar="${var}_FILE"
|
|
||||||
local def="${2:-}"
|
|
||||||
|
|
||||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
|
||||||
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local val="$def"
|
|
||||||
|
|
||||||
if [ "${!var:-}" ]; then
|
|
||||||
val="${!var}"
|
|
||||||
elif [ "${!fileVar:-}" ]; then
|
|
||||||
val="$(< "${!fileVar}")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export "$var"="$val"
|
|
||||||
unset "$fileVar"
|
|
||||||
}
|
|
||||||
|
|
||||||
file_env "POSTGRES_DB_PASSWORD"
|
|
||||||
|
|
||||||
/start.py
|
/start.py
|
||||||
|
|
|
@ -42,7 +42,7 @@ modules:
|
||||||
# lowercase and may contain an explicit port.
|
# lowercase and may contain an explicit port.
|
||||||
# Examples: matrix.org, localhost:8080
|
# Examples: matrix.org, localhost:8080
|
||||||
#
|
#
|
||||||
server_name: "foo.com"
|
server_name: "{{ env "DOMAIN" }}"
|
||||||
|
|
||||||
# When running as a daemon, the file to store the pid in
|
# When running as a daemon, the file to store the pid in
|
||||||
#
|
#
|
||||||
|
@ -67,7 +67,7 @@ pid_file: /data/homeserver.pid
|
||||||
#
|
#
|
||||||
# Defaults to 'https://<server_name>/'.
|
# Defaults to 'https://<server_name>/'.
|
||||||
#
|
#
|
||||||
#public_baseurl: https://example.com/
|
public_baseurl: https://{{ env "DOMAIN" }}/
|
||||||
|
|
||||||
# Uncomment the following to tell other servers to send federation traffic on
|
# Uncomment the following to tell other servers to send federation traffic on
|
||||||
# port 443.
|
# port 443.
|
||||||
|
@ -363,7 +363,7 @@ manhole_settings:
|
||||||
|
|
||||||
# How to reach the server admin, used in ResourceLimitError
|
# How to reach the server admin, used in ResourceLimitError
|
||||||
#
|
#
|
||||||
#admin_contact: 'mailto:admin@server.com'
|
admin_contact: 'mailto:{{ env "ADMIN_EMAIL" }}'
|
||||||
|
|
||||||
# Global blocking
|
# Global blocking
|
||||||
#
|
#
|
||||||
|
@ -751,37 +751,17 @@ caches:
|
||||||
# * for sqlite: https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
|
# * for sqlite: https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
|
||||||
# * for postgres: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
|
# * for postgres: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
|
||||||
# * for the connection pool: https://twistedmatrix.com/documents/current/api/twisted.enterprise.adbapi.ConnectionPool.html#__init__
|
# * for the connection pool: https://twistedmatrix.com/documents/current/api/twisted.enterprise.adbapi.ConnectionPool.html#__init__
|
||||||
#
|
|
||||||
#
|
|
||||||
# Example SQLite configuration:
|
|
||||||
#
|
|
||||||
#database:
|
|
||||||
# name: sqlite3
|
|
||||||
# args:
|
|
||||||
# database: /path/to/homeserver.db
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Example Postgres configuration:
|
|
||||||
#
|
|
||||||
#database:
|
|
||||||
# name: psycopg2
|
|
||||||
# txn_limit: 10000
|
|
||||||
# args:
|
|
||||||
# user: synapse_user
|
|
||||||
# password: secretpassword
|
|
||||||
# database: synapse
|
|
||||||
# host: localhost
|
|
||||||
# port: 5432
|
|
||||||
# cp_min: 5
|
|
||||||
# cp_max: 10
|
|
||||||
#
|
|
||||||
# For more information on using Synapse with Postgres,
|
|
||||||
# see https://matrix-org.github.io/synapse/latest/postgres.html.
|
|
||||||
#
|
|
||||||
database:
|
database:
|
||||||
name: sqlite3
|
name: psycopg2
|
||||||
|
txn_limit: 10000
|
||||||
args:
|
args:
|
||||||
database: /data/homeserver.db
|
user: synapse
|
||||||
|
password: {{ env "db_password" }}
|
||||||
|
database: synapse
|
||||||
|
host: db
|
||||||
|
port: 5432
|
||||||
|
cp_min: 5
|
||||||
|
cp_max: 10
|
||||||
|
|
||||||
|
|
||||||
## Logging ##
|
## Logging ##
|
||||||
|
|
Loading…
Reference in New Issue