mirror of
https://github.com/YunoHost-Apps/dendrite_ynh.git
synced 2024-09-03 18:25:58 +02:00
Enable registration based of is_public
This commit is contained in:
parent
d2abbf373d
commit
11da26d782
4 changed files with 15 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue