Compare commits

...

9 Commits

17 changed files with 126 additions and 25 deletions

View File

@ -24,12 +24,6 @@ import
export
The keyword or filter to decide what to export in the above channel.
REQUIRED MULTIPLE PARAMETERS
----------------------------
interface
An interface to include in OSPF area 0.
OPTIONAL PARAMETERS
-------------------
description
@ -39,12 +33,19 @@ instance-id
An OSPF instance ID, allowing several OSPF instances to run on the same
links.
extra-area-configuration
Configuration string added to the `area` section of the OSPF configuration.
OPTIONAL MULTIPLE PARAMETERS
----------------------------
stubnet
Add an optionless stubnet definition to the configuration.
interface
An interface to include in OSPF area 0. Is required unless
extra-area-configuration is set.
SEE ALSO
--------
cdist-type__bird_core(7)

View File

@ -44,6 +44,21 @@ then
instance_id="$(cat "${__object:?}/parameter/instance-id")"
fi
extra_area_configuration=
if [ -f "${__object:?}/parameter/extra-area-configuration" ];
then
extra_area_configuration="$(cat "${__object:?}/parameter/extra-area-configuration")"
if [ "$extra_area_configuration" = "-" ]; then
extra_area_configuration=$(cat "$__object/stdin")
fi
fi
if [ ! -f "${__object:?}/parameter/interface" ] && [ -z "$extra_area_configuration" ]; then
echo "Either --interface or --extra-area-configuration must be set." >&2
exit 1
fi
__file "${confdir:?}/ospf-${__object_id:?}.conf" \
--mode 0640 --owner root --group bird \
--source - << EOF
@ -59,6 +74,8 @@ $([ -n "${instance_id?}" ] && printf "\tinstance id %s;\n" "${instance_id?}")
area 0 {
$(sed -e 's/^/\t\tinterface "/' -e 's/$/";/' "${__object:?}/parameter/interface")
$(sed -e 's/^/\t\tsubnet /' -e 's/$/;/' "${__object:?}/parameter/subnet")
$extra_area_configuration
};
}
EOF

View File

@ -1,2 +1,3 @@
description
instance-id
extra-area-configuration

View File

@ -1 +1,2 @@
stubnet
interface

View File

@ -1 +0,0 @@
interface

View File

@ -34,12 +34,12 @@ EOF
if [ "$BRANDING_AUTH_FOOTER_LINKS" != "" ]; then
cat << EOF
"authFooterLinks": "$BRANDING_AUTH_FOOTER_LINKS",
"authFooterLinks": $BRANDING_AUTH_FOOTER_LINKS,
EOF
fi
cat << EOF
"welcomeBackgroundUrl": "themes/element/img/backgrounds/lake.jpg"
"welcomeBackgroundUrl": "$BRANDING_WELCOME_BACKGROUND_URL"
EOF
echo '},'
}
@ -52,7 +52,7 @@ cat << EOF
"server_name": "$DEFAULT_SERVER_NAME"
},
"m.identity_server": {
"base_url": "https://vector.im"
"base_url": "$IDENTITY_SERVER_URL"
}
},
"brand": "$BRAND",
@ -85,6 +85,10 @@ cat << EOF
"url": "$COOKIE_POLICY_URL",
"text": "Cookie Policy"
}
]
],
"embeddedPages": {
"welcomeUrl": "$WELCOME_PAGE_URL",
"homeUrl": "$HOME_PAGE_URL"
}
}
EOF

View File

@ -27,12 +27,28 @@ default_server_name
default_server_url
URL of matrix homeserver to connect to, defaults to 'https://matrix-client.matrix.org'.
identity_server_url
URL of matrix identity server to connect to, defaults to 'https://vector.im'.
See element documentation
`<https://github.com/vector-im/element-web/blob/develop/docs/config.md#identity-servers>_`
for details.
owner
Owner of the deployed files, passed to `chown`. Defaults to 'root'.
brand
Web UI branding, defaults to 'Element'.
branding_auth_header_logo_url
A logo image that is shown in the header during authentication flows.
branding_welcome_background_url
An image to use as a wallpaper outside the app during authentication flows. If an array is passed, an image is chosen randomly for each visit.
branding_auth_footer_links
a list of links to show in the authentication page footer: `[{"text": "Link
text", "url": "https://link.target"}, {"text": "Other link", ...}]`
default_country_code
ISO 3166 alpha2 country code to use when showing country selectors, such as
phone number inputs. Defaults to GB.

View File

@ -25,11 +25,13 @@ INSTALL_DIR=$(cat "$__object/parameter/install_dir")
export DEFAULT_SERVER_NAME=$(cat "$__object/parameter/default_server_name")
export DEFAULT_SERVER_URL=$(cat "$__object/parameter/default_server_url")
export IDENTITY_SERVER_URL=$(cat "$__object/parameter/identity_server_url")
export BRAND=$(cat "$__object/parameter/brand")
export DEFAULT_COUNTRY_CODE=$(cat "$__object/parameter/default_country_code")
export ROOM_DIRECTORY_SERVERS=$(cat "$__object/parameter/room_directory_servers")
export PRIVACY_POLICY_URL=$(cat "$__object/parameter/privacy_policy_url")
export COOKIE_POLICY_URL=$(cat "$__object/parameter/cookie_policy_url")
export BRANDING_WELCOME_BACKGROUND_URL=$(cat "$__object/parameter/branding_welcome_background_url")
if [ -f "$__object/parameter/jitsi_domain" ]; then
export JITSI_DOMAIN=$(cat "$__object/parameter/jitsi_domain")
@ -44,14 +46,24 @@ if [ -f "$__object/parameter/branding_auth_footer_links" ]; then
fi
if [ -f "$__object/parameter/homepage" ]; then
export EMBED_HOMEPAGE=1
homepage=$(cat "$__object/parameter/homepage")
if [ -f "$homepage" ]; then
upload_homepage=1
else
export HOME_PAGE_URL=$homepage
fi
fi
WELCOME_PAGE_URL="welcome.html"
if [ -f "$__object/parameter/welcomepage" ]; then
export EMBED_WELCOMEPAGE=1
welcomepage=$(cat "$__object/parameter/welcomepage")
if [ -f welcomepage ]; then
export UPLOAD_WELCOMEPAGE=1
else
WELCOME_PAGE_URL=$welcomepage
fi
fi
export WELCOME_PAGE_URL
if [ -f "$__object/parameter/custom_asset" ]; then
"$__object/parameter/custom_asset" | while IFS= read -r file; do
@ -91,14 +103,14 @@ require="__directory/$INSTALL_DIR/cdist" __file "$INSTALL_DIR/cdist/config.json"
--mode 0664 \
--state present
if [ $EMBED_HOMEPAGE ]; then
if [ $upload_homepage ]; then
require="__directory/$INSTALL_DIR/cdist" __file "$INSTALL_DIR/cdist/home.html" \
--source "$homepage" \
--mode 0664 \
--state present
fi
if [ $EMBED_WELCOMEPAGE ]; then
if [ $upload_welcomepage ]; then
require="__directory/$INSTALL_DIR/cdist" __file "$INSTALL_DIR/cdist/welcome.html" \
--source "$welcomepage" \
--mode 0664 \

View File

@ -0,0 +1 @@
themes/element/img/backgrounds/lake.jpg

View File

@ -1,5 +1,6 @@
default_server_url
default_server_name
identity_server_url
brand
default_country_code
privacy_policy_url
@ -11,3 +12,4 @@ welcomepage
jitsi_domain
branding_auth_header_logo_url
branding_auth_footer_links
branding_welcome_background_url

View File

@ -448,7 +448,7 @@ retention:
# matter much because Synapse doesn't take it into account yet.
#
default_policy:
min_lifetime: 1d
min_lifetime: ${MESSAGE_RETENTION_POLICY_MIN_LIFETIME:?}
max_lifetime: ${MESSAGE_RETENTION_POLICY_MAX_LIFETIME:?}
# Retention policy limits. If set, and the state of a room contains a
@ -1808,7 +1808,15 @@ cat << EOF
# The custom module's class. Uncomment to use a custom module.
#
#module: mapping_provider.SamlMappingProvider
EOF
if [ -n "$SAML2_MAPPING_PROVIDER_MODULE" ]; then
cat << EOF
module: "$SAML2_MAPPING_PROVIDER_MODULE"
EOF
fi
cat << EOF
# Custom configuration values for the module. Below options are
# intended for the built-in provider, they should be changed if
# using a custom module. This section will be passed as a Python
@ -1838,6 +1846,17 @@ cat << EOF
# value will be used instead.
#
#mxid_mapping: dotreplace
EOF
if [ -n "$SAML2_MAPPING_PROVIDER_EXTRA_CONFIG" ]; then
echo "$SAML2_MAPPING_PROVIDER_EXTRA_CONFIG" | while IFS= read -r entry; do
cat << EOF
$entry
EOF
done
fi
cat << EOF
# In previous versions of synapse, the mapping from SAML attribute to
# MXID was always calculated dynamically rather than stored in a
@ -2172,7 +2191,7 @@ sso:
# You can see the default templates at:
# https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
#
#template_dir: "res/templates"
template_dir: "${SSO_TEMPLATE_DIR:?}"
# JSON web token integration. The following settings can be used to make

View File

@ -1,5 +1,5 @@
cdist-type__matrix_synapse(7)
======================
=============================
NAME
----
@ -8,7 +8,7 @@ cdist-type__matrix_synapse - Install and configure Synapse, a Matrix homeserver
DESCRIPTION
-----------
This type install and configure the Synapse Matrix homeserver. This is a
This type installs and configures the Synapse Matrix homeserver. This is a
signleton type.
@ -52,13 +52,13 @@ ldap-base-dn
Base DN of your LDAP tree.
ldap-uid-attribute
LDAP attriute mapping to Synapse's uid field, default to uid.
LDAP attribute mapping to Synapse's uid field, default to uid.
ldap-mail-attribute
LDAP attriute mapping to Synapse's mail field, default to mail.
LDAP attribute mapping to Synapse's mail field, default to mail.
ldap-name-attribute
LDAP attriute mapping to Synapse's name field, default to givenName.
LDAP attribute mapping to Synapse's name field, default to givenName.
ldap-bind-dn
User used to authenticate against your LDAP server in 'search' mode.
@ -81,7 +81,7 @@ smtp-host
The hostname of the outgoing SMTP server to use. Defaults to 'localhost'.
smtp-port
# The port on the mail server for outgoing SMTP. Defaults to 25.
The port on the mail server for outgoing SMTP. Defaults to 25.
smtp-user
Username for authentication to the SMTP server. By
@ -198,6 +198,16 @@ saml2-sp-key
saml2-sp-cert
Path to PEM-formatted cert file for use by PySAML2.
saml2-mapping-provider-module
Name of custom Python module used to map SAML2 attributes to synapse internals.
saml2-mapping-provider-extra-settings
Extra YAML-formatted key/pair values provided as configuration to the SAML2
mapping provider module (e.g. 'key: value'). Can be specified multiple times.
sso-template-dir
Directory used to source SSO-related HTML templates.
extra-setting
Arbitrary string to be added to the configuration file. Can be specified multiple times.

View File

@ -210,6 +210,19 @@ if [ -f "$__object/parameter/saml2-sp-cert" ]; then
export SAML2_SP_CERT
fi
if [ -f "$__object/parameter/saml2-mapping-provider-module" ]; then
SAML2_MAPPING_PROVIDER_MODULE=$(cat "$__object/parameter/saml2-mapping-provider-module")
export SAML2_MAPPING_PROVIDER_MODULE
fi
if [ -f "$__object/parameter/saml2-mapping-provider-extra-config" ]; then
SAML2_MAPPING_PROVIDER_EXTRA_CONFIG=$(cat "$__object/parameter/saml2-mapping-provider-extra-config")
export SAML2_MAPPING_PROVIDER_EXTRA_CONFIG
fi
SSO_TEMPLATE_DIR=$(cat "$__object/parameter/sso-template-dir")
export SSO_TEMPLATE_DIR
if [ -n "$SAML2_SP_KEY" ] && [ -z "$SAML2_SP_CERT" ]; then
echo "--saml2-sp-cert must be set if --saml2-sp-key is provided." >&2
exit 1
@ -224,7 +237,7 @@ if [ -f "$__object/parameter/default-identity-server" ]; then
fi
ENABLE_3PID_LOOKUPS='false'
if [ -f "$__object/parameter/enable-3pid-lookup" ]; then
if [ -f "$__object/parameter/enable-3pid-lookups" ]; then
ENABLE_3PID_LOOKUPS='true'
fi
export ENABLE_3PID_LOOKUPS
@ -244,7 +257,8 @@ fi
# Message retention.
ENABLE_MESSAGE_RETENTION_POLICY=$(get_boolean_for 'enable-message-retention-policy')
MESSAGE_RETENTION_POLICY_MAX_LIFETIME=$(cat "$__object/parameter/message-max-lifetime")
export ENABLE_MESSAGE_RETENTION_POLICY MESSAGE_RETENTION_POLICY_MAX_LIFETIME
MESSAGE_RETENTION_POLICY_MIN_LIFETIME=$MESSAGE_RETENTION_POLICY_MAX_LIFETIME
export ENABLE_MESSAGE_RETENTION_POLICY MESSAGE_RETENTION_POLICY_MAX_LIFETIME MESSAGE_RETENTION_POLICY_MIN_LIFETIME
# Previews.
ENABLE_URL_PREVIEW=$(get_boolean_for 'enable-url-preview')

View File

@ -0,0 +1 @@
res/template

View File

@ -40,3 +40,5 @@ saml2-idp-metadata-url
saml2-sp-key
saml2-sp-cert
default-identity-server
saml2-mapping-provider-module
sso-template-dir

View File

@ -5,3 +5,4 @@ app-service-config-file
extra-setting
bind-address
outbound-federation-worker
saml2-mapping-provider-extra-config