__matrix_synapse: add --enable-3pid-lookups flag, normalize indentation
This commit is contained in:
parent
afe76af679
commit
c466733111
4 changed files with 42 additions and 32 deletions
|
@ -1334,7 +1334,7 @@ fi
|
||||||
cat << EOF
|
cat << EOF
|
||||||
# Enable 3PIDs lookup requests to identity servers from this server.
|
# Enable 3PIDs lookup requests to identity servers from this server.
|
||||||
#
|
#
|
||||||
#enable_3pid_lookup: true
|
enable_3pid_lookup: ${ENABLE_3PID_LOOKUPS:?}
|
||||||
|
|
||||||
# If set, allows registration of standard or admin accounts by anyone who
|
# If set, allows registration of standard or admin accounts by anyone who
|
||||||
# has the shared secret, even if registration is otherwise disabled.
|
# has the shared secret, even if registration is otherwise disabled.
|
||||||
|
|
|
@ -239,6 +239,9 @@ allow-public-rooms-without-auth
|
||||||
enable-server-notices
|
enable-server-notices
|
||||||
Enable the server notices room.
|
Enable the server notices room.
|
||||||
|
|
||||||
|
enable-3pid-lookups
|
||||||
|
Enable 3PIDs lookup requests to identity servers from this server.
|
||||||
|
|
||||||
allow-guest-access
|
allow-guest-access
|
||||||
Allows users to register as guests without a password/email/etc, and
|
Allows users to register as guests without a password/email/etc, and
|
||||||
participate in rooms hosted on this server which have been made accessible
|
participate in rooms hosted on this server which have been made accessible
|
||||||
|
|
|
@ -37,7 +37,7 @@ case "$os" in
|
||||||
--uri https://packages.matrix.org/debian/ \
|
--uri https://packages.matrix.org/debian/ \
|
||||||
--component main
|
--component main
|
||||||
package_req="__apt_source/matrix-org"
|
package_req="__apt_source/matrix-org"
|
||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
synapse_user=synapse
|
synapse_user=synapse
|
||||||
synapse_pkg=synapse
|
synapse_pkg=synapse
|
||||||
|
@ -96,7 +96,7 @@ export SERVER_NAME BASE_URL REPORT_STATS MAX_UPLOAD_SIZE EXPOSE_METRICS \
|
||||||
WEB_CLIENT_URL ROOM_ENCRYPTION_POLICY BIND_ADDRESSES
|
WEB_CLIENT_URL ROOM_ENCRYPTION_POLICY BIND_ADDRESSES
|
||||||
|
|
||||||
if [ -f "$__object/parameter/enable-server-notices" ]; then
|
if [ -f "$__object/parameter/enable-server-notices" ]; then
|
||||||
export ENABLE_SERVER_NOTICES=1
|
export ENABLE_SERVER_NOTICES=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TLS.
|
# TLS.
|
||||||
|
@ -178,51 +178,57 @@ if [ -f "$__object/parameter/registration-shared-secret" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/registration-requires-email" ]; then
|
if [ -f "$__object/parameter/registration-requires-email" ]; then
|
||||||
export REGISTRATION_REQUIRES_EMAIL=1
|
export REGISTRATION_REQUIRES_EMAIL=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/auto-join-room" ]; then
|
if [ -f "$__object/parameter/auto-join-room" ]; then
|
||||||
AUTO_JOIN_ROOMS="$(cat "$__object/parameter/auto-join-room")"
|
AUTO_JOIN_ROOMS="$(cat "$__object/parameter/auto-join-room")"
|
||||||
export AUTO_JOIN_ROOMS
|
export AUTO_JOIN_ROOMS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/registration-allows-email-pattern" ]; then
|
if [ -f "$__object/parameter/registration-allows-email-pattern" ]; then
|
||||||
RESGISTRATION_ALLOWS_EMAIL_PATTERN=$(cat "$__object/parameter/registration-allows-email-pattern")
|
RESGISTRATION_ALLOWS_EMAIL_PATTERN=$(cat "$__object/parameter/registration-allows-email-pattern")
|
||||||
export RESGISTRATION_ALLOWS_EMAIL_PATTERN
|
export RESGISTRATION_ALLOWS_EMAIL_PATTERN
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/saml2-idp-metadata-url" ]; then
|
if [ -f "$__object/parameter/saml2-idp-metadata-url" ]; then
|
||||||
# Synapse fails to start while trying to parse IDP metadata if this package
|
# Synapse fails to start while trying to parse IDP metadata if this package
|
||||||
# is not installed.
|
# is not installed.
|
||||||
__package xmlsec1
|
__package xmlsec1
|
||||||
|
|
||||||
SAML2_IDP_METADATA_URL=$(cat "$__object/parameter/saml2-idp-metadata-url")
|
SAML2_IDP_METADATA_URL=$(cat "$__object/parameter/saml2-idp-metadata-url")
|
||||||
export SAML2_IDP_METADATA_URL
|
export SAML2_IDP_METADATA_URL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/saml2-sp-key" ]; then
|
if [ -f "$__object/parameter/saml2-sp-key" ]; then
|
||||||
SAML2_SP_KEY=$(cat "$__object/parameter/saml2-sp-key")
|
SAML2_SP_KEY=$(cat "$__object/parameter/saml2-sp-key")
|
||||||
export SAML2_SP_KEY
|
export SAML2_SP_KEY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/saml2-sp-cert" ]; then
|
if [ -f "$__object/parameter/saml2-sp-cert" ]; then
|
||||||
SAML2_SP_CERT=$(cat "$__object/parameter/saml2-sp-cert")
|
SAML2_SP_CERT=$(cat "$__object/parameter/saml2-sp-cert")
|
||||||
export SAML2_SP_CERT
|
export SAML2_SP_CERT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$SAML2_SP_KEY" ] && [ -z "$SAML2_SP_CERT" ]; then
|
if [ -n "$SAML2_SP_KEY" ] && [ -z "$SAML2_SP_CERT" ]; then
|
||||||
echo "--saml2-sp-cert must be set if --saml2-sp-key is provided." >&2
|
echo "--saml2-sp-cert must be set if --saml2-sp-key is provided." >&2
|
||||||
exit 1
|
exit 1
|
||||||
elif [ -n "$SAML2_SP_CERT" ] && [ -z "$SAML2_SP_KEY" ]; then
|
elif [ -n "$SAML2_SP_CERT" ] && [ -z "$SAML2_SP_KEY" ]; then
|
||||||
echo "--saml2-sp-key must be set if --saml2-sp-cert is provided." >&2
|
echo "--saml2-sp-key must be set if --saml2-sp-cert is provided." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/default-identity-server" ]; then
|
if [ -f "$__object/parameter/default-identity-server" ]; then
|
||||||
DEFAULT_IDENTITY_SERVER=$(cat "$__object/parameter/default-identity-server")
|
DEFAULT_IDENTITY_SERVER=$(cat "$__object/parameter/default-identity-server")
|
||||||
export DEFAULT_IDENTITY_SERVER
|
export DEFAULT_IDENTITY_SERVER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ENABLE_3PID_LOOKUPS='false'
|
||||||
|
if [ -f "$__object/parameter/enable-3pid-lookup" ]; then
|
||||||
|
ENABLE_3PID_LOOKUPS='true'
|
||||||
|
fi
|
||||||
|
export ENABLE_3PID_LOOKUPS
|
||||||
|
|
||||||
# Federation.
|
# Federation.
|
||||||
ALLOW_PUBLIC_ROOMS_OVER_FEDERATION=$(get_boolean_for 'allow-public-room-over-federation')
|
ALLOW_PUBLIC_ROOMS_OVER_FEDERATION=$(get_boolean_for 'allow-public-room-over-federation')
|
||||||
ALLOW_PUBLIC_ROOMS_WITHOUT_AUTH=$(get_boolean_for 'allow-public-rooms-without-auth')
|
ALLOW_PUBLIC_ROOMS_WITHOUT_AUTH=$(get_boolean_for 'allow-public-rooms-without-auth')
|
||||||
|
@ -321,16 +327,16 @@ export ENABLE_REPLICATION ENABLE_REDIS_SUPPORT WORKER_REPLICATION_SECRET \
|
||||||
case "$DATABASE_ENGINE" in
|
case "$DATABASE_ENGINE" in
|
||||||
sqlite3)
|
sqlite3)
|
||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
psycopg2)
|
psycopg2)
|
||||||
when='database engine is psycopg2'
|
when='database engine is psycopg2'
|
||||||
is_required_when "$DATABASE_HOST" '--database-host' "$when"
|
is_required_when "$DATABASE_HOST" '--database-host' "$when"
|
||||||
is_required_when "$DATABASE_USER" '--database-user' "$when"
|
is_required_when "$DATABASE_USER" '--database-user' "$when"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid database engine: $DATABASE_ENGINE." >&2
|
echo "Invalid database engine: $DATABASE_ENGINE." >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
@ -348,13 +354,13 @@ mkdir -p "$__object/files"
|
||||||
"$__type/files/log.config.sh" > "$__object/files/log.config"
|
"$__type/files/log.config.sh" > "$__object/files/log.config"
|
||||||
|
|
||||||
require="$synapse_req" __file "$synapse_conf_dir/homeserver.yaml" \
|
require="$synapse_req" __file "$synapse_conf_dir/homeserver.yaml" \
|
||||||
--owner $synapse_user \
|
--owner $synapse_user \
|
||||||
--mode 600 \
|
--mode 600 \
|
||||||
--source "$__object/files/homeserver.yaml"
|
--source "$__object/files/homeserver.yaml"
|
||||||
require="$synapse_req" __file "$LOG_CONFIG_PATH" \
|
require="$synapse_req" __file "$LOG_CONFIG_PATH" \
|
||||||
--owner $synapse_user \
|
--owner $synapse_user \
|
||||||
--mode 600 \
|
--mode 600 \
|
||||||
--source "$__object/files/log.config"
|
--source "$__object/files/log.config"
|
||||||
|
|
||||||
for directory in $DATA_DIR $LOG_DIR; do
|
for directory in $DATA_DIR $LOG_DIR; do
|
||||||
require="$synapse_req" __directory $directory \
|
require="$synapse_req" __directory $directory \
|
||||||
|
|
|
@ -17,3 +17,4 @@ user-directory-search-all-users
|
||||||
enable-message-retention-policy
|
enable-message-retention-policy
|
||||||
worker-mode
|
worker-mode
|
||||||
enable-url-preview
|
enable-url-preview
|
||||||
|
enable-3pid-lookups
|
||||||
|
|
Loading…
Reference in a new issue