From 11da26d782d922019d61d6139e262d3b584c8168 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 18 Jan 2021 18:52:43 +0100 Subject: [PATCH] Enable registration based of is_public --- check_process | 2 +- conf/dendrite.yaml | 2 +- manifest.json | 6 +++++- scripts/install | 21 ++++++++------------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/check_process b/check_process index 9ac5340..4cba368 100644 --- a/check_process +++ b/check_process @@ -9,7 +9,7 @@ setup_sub_dir=0 setup_root=1 setup_nourl=0 - setup_private=1 + setup_private=0 setup_public=1 upgrade=1 # upgrade=1 from_commit=CommitHash diff --git a/conf/dendrite.yaml b/conf/dendrite.yaml index 9137f9c..dfb450b 100644 --- a/conf/dendrite.yaml +++ b/conf/dendrite.yaml @@ -127,7 +127,7 @@ client_api: # Prevents new users from being able to register on this homeserver, except when # using the registration shared secret below. - registration_disabled: false + registration_disabled: __REGISTRATION__ # If set, allows registration by anyone who knows the shared secret, regardless of # whether registration is otherwise disabled. diff --git a/manifest.json b/manifest.json index dd3a8da..8fb98e2 100644 --- a/manifest.json +++ b/manifest.json @@ -44,7 +44,11 @@ "en": "Is it a public application?", "fr": "Est-ce une application publique ?" }, - "default": true + "help": { + "en": "A public server means that anybody will be able to register.", + "fr": "Un serveur public permet à quiconque de s'y enregistrer." + }, + "default": false } ] } diff --git a/scripts/install b/scripts/install index a6c3949..e220830 100644 --- a/scripts/install +++ b/scripts/install @@ -147,6 +147,14 @@ pushd "$final_path" || ynh_die ./bin/generate-keys --tls-cert server.crt --tls-key server.key popd || ynh_die +# Allow or deny registration based of is_public +if [ $is_public -eq 1 ] +then + registration = true +else + registration = false +fi + # Copy and modify the config file ynh_add_config --template="../conf/dendrite.yaml" --destination="$final_path/dentrite.yaml" @@ -202,19 +210,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --line_match="Started Dentrite Matrix homeserver" --log_path="systemd" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" -fi - #================================================= # RELOAD NGINX #=================================================