|
@ -19,21 +19,21 @@ yaml_opt_flatten() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CFG_DIR=/etc/synapse |
|
|
CFG_DIR=/etc/synapse |
|
|
DATA_DIR=/var/lib/synapse |
|
|
|
|
|
CONFIG_FILE="$CFG_DIR/config.yml" |
|
|
|
|
|
HOST_CONFIG_FILE="${SERVICE_CONFIGSTORE}$CONFIG_FILE" |
|
|
|
|
|
|
|
|
DATA_DIR=/data |
|
|
|
|
|
CONFIG_FILE="$DATA_DIR/homeserver.yaml" |
|
|
|
|
|
HOST_CONFIG_FILE="${SERVICE_DATASTORE}$CONFIG_FILE" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup_dirs() { |
|
|
setup_dirs() { |
|
|
local dirs dir |
|
|
local dirs dir |
|
|
|
|
|
|
|
|
dirs=("$SERVICE_DATASTORE/var/lib/synapse") |
|
|
|
|
|
uid_gid=($(docker_get_uid_gid "$SERVICE_NAME" "synapse" "synapse")) || { |
|
|
|
|
|
|
|
|
dirs=("$SERVICE_DATASTORE/data") |
|
|
|
|
|
uid_gid=($(docker_get_uid_gid "$SERVICE_NAME" "root" "root")) || { |
|
|
err "Could not fetch uid/gid on image of service ${DARKYELLOW}$SERVICE_NAME${NORMAL}." |
|
|
err "Could not fetch uid/gid on image of service ${DARKYELLOW}$SERVICE_NAME${NORMAL}." |
|
|
return 1 |
|
|
return 1 |
|
|
} |
|
|
} |
|
|
uid="${uid_gid[0]}" |
|
|
|
|
|
gid="${uid_gid[1]}" |
|
|
|
|
|
|
|
|
uid="991" |
|
|
|
|
|
gid="991" |
|
|
for dir in "${dirs[@]}"; do |
|
|
for dir in "${dirs[@]}"; do |
|
|
mkdir -p "$dir" |
|
|
mkdir -p "$dir" |
|
|
find "$dir" \! -uid "$uid" -print0 | while read-0 f; do |
|
|
find "$dir" \! -uid "$uid" -print0 | while read-0 f; do |
|
@ -46,7 +46,8 @@ setup_dirs() { |
|
|
|
|
|
|
|
|
dirs=( |
|
|
dirs=( |
|
|
"${SERVICE_CONFIGSTORE}/$CFG_DIR" |
|
|
"${SERVICE_CONFIGSTORE}/$CFG_DIR" |
|
|
"${SERVICE_DATASTORE}/var/lib/synapse/keys" |
|
|
|
|
|
|
|
|
"${SERVICE_DATASTORE}/$DATA_DIR/keys" |
|
|
|
|
|
"${SERVICE_DATASTORE}/$DATA_DIR/media" |
|
|
) |
|
|
) |
|
|
for dir in "${dirs[@]}"; do |
|
|
for dir in "${dirs[@]}"; do |
|
|
mkdir -p "$dir" |
|
|
mkdir -p "$dir" |
|
@ -63,6 +64,8 @@ cfg-merge() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg-base() { |
|
|
cfg-base() { |
|
|
cat <<EOF > "$HOST_CONFIG_FILE" |
|
|
cat <<EOF > "$HOST_CONFIG_FILE" |
|
|
|
|
|
|
|
@ -72,7 +75,7 @@ cfg-base() { |
|
|
# pid_file: /var/run/synapse/synapse.pid |
|
|
# pid_file: /var/run/synapse/synapse.pid |
|
|
web_client: False |
|
|
web_client: False |
|
|
soft_file_limit: 0 |
|
|
soft_file_limit: 0 |
|
|
log_config: "$CFG_DIR/logging.yml" |
|
|
|
|
|
|
|
|
log_config: "$DATA_DIR/logging.yml" |
|
|
|
|
|
|
|
|
## Ports |
|
|
## Ports |
|
|
|
|
|
|
|
@ -164,7 +167,7 @@ turn_user_lifetime: 1h |
|
|
trusted_third_party_id_servers: |
|
|
trusted_third_party_id_servers: |
|
|
- matrix.org |
|
|
- matrix.org |
|
|
- vector.im |
|
|
- vector.im |
|
|
|
|
|
|
|
|
|
|
|
suppress_key_server_warning: true |
|
|
## Metrics |
|
|
## Metrics |
|
|
|
|
|
|
|
|
enable_metrics: false |
|
|
enable_metrics: false |
|
@ -206,7 +209,7 @@ app_service_config_files: [] |
|
|
|
|
|
|
|
|
EOF |
|
|
EOF |
|
|
|
|
|
|
|
|
cat <<EOF > "$SERVICE_CONFIGSTORE$CFG_DIR"/logging.yml |
|
|
|
|
|
|
|
|
cat <<EOF > "$SERVICE_DATASTORE$DATA_DIR"/logging.yml |
|
|
version: 1 |
|
|
version: 1 |
|
|
|
|
|
|
|
|
formatters: |
|
|
formatters: |
|
|