1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

client urls

This commit is contained in:
gredin67 2023-01-11 14:03:52 +01:00
parent b28486fcd5
commit 56ad01bdb9
4 changed files with 131 additions and 108 deletions

View file

@ -50,7 +50,7 @@ pid_file: /run/matrix-__APP__/homeserver.pid
# The absolute URL to the web client which / will redirect to.
#
web_client_location: __ELEMENT_YNH_URL__
web_client_location: __WEB_CLIENT_LOCATION__
# The public-facing base URL that clients use to access this Homeserver (not
# including _matrix/...). This is the same URL a user might enter into the
@ -2320,7 +2320,7 @@ email:
# (This setting used to be called riot_base_url; the old name is still
# supported for backwards-compatibility but is now deprecated.)
#
client_base_url: __ELEMENT_YNH_URL__
client_base_url: __CLIENT_BASE_URL__
# Configure the time that a validation email will expire after sending.
# Defaults to 1h.
@ -2331,7 +2331,7 @@ email:
# to the identity server as the org.matrix.web_client_location key. Defaults
# to unset, giving no guidance to the identity server.
#
invite_client_location: __ELEMENT_YNH_URL__
invite_client_location: __INVITE_CLIENT_LOCATION__
# Subjects to use when sending emails from Synapse.
#

View file

@ -1,12 +1,19 @@
version = "1.0"
[homeserver]
name = "Synapse Homeserver"
name = "Homeserver Privacy"
services = ["__APP__"]
[homeserver.config]
name = "Configuration Options"
[homeserver.config.backup_before_upgrade]
ask = "Backup before upgrade"
type = "boolean"
yes = true
no = false
help = "Set to 'true' to back up before each upgrade."
[homeserver.config.server_statistics]
ask = "Server statistics"
type = "boolean"
@ -15,70 +22,12 @@ services = ["__APP__"]
help = "Set to 'true' to send anonymous statistics to Synapse to improve performance."
bind = "report_stats:/etc/matrix-__APP__/homeserver.yaml"
[homeserver.registration]
name = "Homeserver Registration"
[homeserver.registration.turn_allow_guests]
ask = "Should guests be allowed to use the TURN server?"
type = "boolean"
yes = true
no = false
help = "This defaults to True, otherwise VoIP will be unreliable for guests. However, it does introduce a slight security risk as it allows users to connect to arbitrary endpoints without having first signed up for a valid account (e.g. by passing a CAPTCHA)."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[homeserver.registration.enable_registration]
ask = "Enable Registration for new users."
type = "boolean"
yes = true
no = false
help = "Defaults to 'false'. If 'true', it is highly recommended to use either captcha, email, or token-based verification to avoid SPAM."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[homeserver.registration.registrations_require_3pid]
ask = "Register only with all below types of 3PID."
type = "string"
help = "Defaults to: '- email'. Phone number: '- msisdn'"
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[homeserver.registration.disable_msisdn_registration]
ask = "Disable asking Phone Number in Registration flow."
type = "boolean"
yes = true
no = false
help = "Overrides above setting if MSISDNs are set as required."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[homeserver.registration.allowed_local_3pids]
ask = "Register only with given formats of 3PIDs."
type = "string"
help = '''
allowed_local_3pids:
- medium: email - medium: email
pattern: '^[^@]+@matrix\.org$'
- medium: msisdn
pattern: '\+33'
'''
[homeserver.registration.registration_shared_secret]
ask = "Shared Secret for Registration."
type = "string"
help = "Allows registration of standard or admin accounts, even if Registration disabled."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[homeserver.registration.allow_guest_access]
ask = "Allow Users to Register as Guests?"
type = "boolean"
yes = true
no = false
help = "Guests can participate on this server in rooms with guest access enabled, without a password/email/etc."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[homeserver.privacy]
name = "Data Privacy"
[homeserver.privacy.default_identity_server]
ask = "Identity server suggested to clients."
type = "string"
type = "url"
help = "By default, no suggestion is made, so it is left up to the client."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
@ -98,10 +47,112 @@ services = ["__APP__"]
help = "If set to 'false', requires authentication to access the server's public rooms directory through the client API and forbids any other homeserver to fetch the server's public rooms directory via federation."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[account]
name = "Registration"
services = ["__APP__"]
[account.registration]
name = "Account Registration"
[account.registration.turn_allow_guests]
ask = "Should guests be allowed to use the TURN server?"
type = "boolean"
yes = true
no = false
help = "This defaults to True, otherwise VoIP will be unreliable for guests. However, it does introduce a slight security risk as it allows users to connect to arbitrary endpoints without having first signed up for a valid account (e.g. by passing a CAPTCHA)."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[account.registration.enable_registration]
ask = "Enable Registration for new users."
type = "boolean"
yes = true
no = false
help = "Defaults to 'false'. If 'true', it is highly recommended to use either captcha, email, or token-based verification to avoid SPAM."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[account.registration.registrations_require_3pid]
ask = "Register only with all below types of 3PID."
type = "string"
help = "Defaults to: '- email'. Phone number: '- msisdn'"
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[account.registration.disable_msisdn_registration]
ask = "Disable asking Phone Number in Registration flow."
type = "boolean"
yes = true
no = false
help = "Overrides above setting if MSISDNs are set as required."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[account.registration.allowed_local_3pids]
ask = "Register only with given formats of 3PIDs."
type = "string"
help = '''
allowed_local_3pids:
- medium: email - medium: email
pattern: '^[^@]+@matrix\.org$'
- medium: msisdn
pattern: '\+33'
'''
[account.registration.registration_shared_secret]
ask = "Shared Secret for Registration."
type = "string"
help = "Allows registration of standard or admin accounts, even if Registration disabled."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[account.registration.allow_guest_access]
ask = "Allow Users to Register as Guests?"
type = "boolean"
yes = true
no = false
help = "Guests can participate on this server in rooms with guest access enabled, without a password/email/etc."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[client]
name = "Matrix Client"
services = ["__APP__"]
[client.experience]
name = "User Experience"
[client.experience.web_client_location]
ask = "URL to the web client which / will redirect to."
type = "url"
help = "Basically Element instance the server should redirect to."
bind = "web_client_location:/etc/matrix-__APP__/homeserver.yaml"
[client.experience.client_base_url]
ask = "URL for client links within the email notifications."
type = "url"
help = "Used to be called 'riot_base_url', still supported"
bind = "client_base_url:/etc/matrix-__APP__/homeserver.yaml"
[client.experience.invite_client_location]
ask = "Web client location to direct users to during an invite."
type = "url"
help = "This is passed to the identity server as the org.matrix.web_client_location key. Defaults to unset, giving no guidance to the identity server."
bind = "invite_client_location:/etc/matrix-__APP__/homeserver.yaml"
[client.experience.enable_group_creation]
ask = "Allow non-server-admin Users to create Spaces?"
type = "boolean"
yes = true
no = false
help = "Defaults to 'false'."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[client.experience.e2e_enabled_by_default]
ask = "End-to-End Encryption by default for locally-created Rooms"
type = "select"
choices = ["all", "invite", "off"]
help = '''
* "all": any locally-created room
* "invite": any room created with the "private_chat" or "trusted_private_chat" room creation presets
* "off": this option will take no effect
'''
bind = "encryption_enabled_by_default_for_room_type:/etc/matrix-__APP__/homeserver.yaml"
[client.welcome]
name = "Welcome User Experience"
@ -150,44 +201,3 @@ services = ["__APP__"]
no = false
help = "Defaults to 'true'."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[client.experience]
name = "User Experience"
[client.experience.element_ynh_url]
ask = "URL of the Default Element Instance."
type = "string"
default = '#example:example.com'
help = "URL for web client links within the email notifications (client_base_url) AND to direct users to during an invite (invite_client_location) AND to which / will redirect to (web_client_location)"
bind = "client_base_url:/etc/matrix-__APP__/homeserver.yaml"
bind = "invite_client_location:/etc/matrix-__APP__/homeserver.yaml"
bind = "web_client_location:/etc/matrix-__APP__/homeserver.yaml"
[client.experience.enable_group_creation]
ask = "Allow non-server-admin Users to create Spaces?"
type = "boolean"
yes = true
no = false
help = "Defaults to 'false'."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[client.experience.e2e_enabled_by_default]
ask = "End-to-End Encryption by default for locally-created Rooms"
type = "select"
choices = ["all", "invite", "off"]
help = '''
* "all": any locally-created room
* "invite": any room created with the "private_chat" or "trusted_private_chat" room creation presets
* "off": this option will take no effect
'''
bind = "encryption_enabled_by_default_for_room_type:/etc/matrix-__APP__/homeserver.yaml"
[client.package_config]
name = "Package configuration"
[client.package_config.backup_before_upgrade]
ask = "Backup before upgrade"
type = "boolean"
yes = true
no = false
help = "Set to 'true' to back up before each upgrade."

View file

@ -100,6 +100,10 @@ element_ynh_url="https://"+element_domain+element_path
# element_ynh_url="https://matrix.to/"
fi
web_client_location=$element_ynh_url
client_base_url=$element_ynh_url
invite_client_location=$element_ynh_url
allow_public_rooms_without_auth="false"
allow_public_rooms_over_federation="false"
disable_msisdn_registration="true"
@ -116,7 +120,9 @@ enable_notifs="true"
notif_for_new_users="true"
enable_group_creation="true"
ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url
ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location
ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url
ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location
ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth
ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation
ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration

View file

@ -60,7 +60,9 @@ data_path="/home/yunohost.app/matrix-$app"
#=================================================
# GET CONFIG PANEL SETTINGS
#=================================================
element_ynh_url=$(ynh_app_setting_get --app=$app --key=element_ynh_url)
web_client_location=$(ynh_app_setting_get --app=$app --key=web_client_location)
client_base_url=$(ynh_app_setting_get --app=$app --key=client_base_url)
invite_client_location=$(ynh_app_setting_get --app=$app --key=invite_client_location)
allow_public_rooms_without_auth=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_without_auth)
allow_public_rooms_over_federation=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_over_federation)
disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisdn_registration)
@ -198,7 +200,7 @@ fi
# Get app name of first Element Instance
if [ -z "$element_ynh_url" ]
if [ -z "$web_client_location" ]
then
element_ynh_url="https://matrix.to/"
element_instance="element"
@ -209,8 +211,13 @@ then
#else
element_ynh_url="https://"+element_domain+element_path
fi
web_client_location=$element_ynh_url
client_base_url=$element_ynh_url
invite_client_location=$element_ynh_url
fi
ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url
ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location
ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url
ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location
if [ -z "$allow_public_rooms_without_auth" ]
then