1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hedgedoc_ynh.git synced 2024-09-03 19:25:52 +02:00
This commit is contained in:
Éric Gaspar 2023-01-21 12:35:07 +01:00
parent f503e6443c
commit b37c69ed16
4 changed files with 18 additions and 1 deletions

View file

@ -10,7 +10,7 @@
"allowFreeURL": __ALLOW_FREE_URL__,
"requireFreeURLAuthentication": __REQUIRE_FREE_URL_AUTHENTICATION__,
"allowAnonymous": __ALLOW_ANONYMOUS__,
"allowAnonymousEdits": true,
"allowAnonymousEdits": __ALLOW_ANONYMOUS_EDITS__,
"defaultPermission": "locked",
"email": true,
"allowEmailRegister": __ALLOW_EMAIL_REGISTRATION__,

View file

@ -14,6 +14,15 @@ name = "HedgeDoc configuration"
help = "Set to allow anonymous usage (default is true)."
bind = "allow_anonymous:__FINALPATH__/config.json"
[main.config.allow_anonymous_edits]
ask = "Allow anonymous edits"
type = "boolean"
yes = "true"
no = "false"
help = "Allow users to select freely permission, allowing guests to edit existing notes."
bind = "allow_anonymous_edits:__FINALPATH__/config.json"
[main.config.allow_email_registration]
ask = "Allow email registration"
type = "boolean"

View file

@ -30,6 +30,7 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
allow_anonymous=false
allow_anonymous_edits=false
allow_email_registration=false
allow_free_url=false
require_free_url_authentication=false
@ -56,6 +57,7 @@ ynh_app_setting_set --app=$app --key=allow_anonymous --value=$allow_anonymous
ynh_app_setting_set --app=$app --key=allow_email_registration --value=$allow_email_registration
ynh_app_setting_set --app=$app --key=allow_free_url --value=$allow_free_url
ynh_app_setting_set --app=$app --key=require_free_url_authentication --value=$require_free_url_authentication
ynh_app_setting_set --app=$app --key=allow_anonymous_edits --value=$allow_anonymous_edits
#=================================================
# STANDARD MODIFICATIONS

View file

@ -25,6 +25,7 @@ db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
allow_anonymous=$(ynh_app_setting_get --app=$app --key=allow_anonymous)
allow_anonymous_edits=$(ynh_app_setting_get --app=$app --key=allow_anonymous_edits)
allow_email_registration=$(ynh_app_setting_get --app=$app --key=allow_email_registration)
allow_free_url=$(ynh_app_setting_get --app=$app --key=allow_free_url)
require_free_url_authentication=$(ynh_app_setting_get --app=$app --key=require_free_url_authentication)
@ -45,6 +46,11 @@ if [ -z "$allow_anonymous" ]; then
ynh_app_setting_set --app=$app --key=allow_anonymous --value=$allow_anonymous
fi
if [ -z "$allow_anonymous_edits" ]; then
allow_anonymous_edits="false"
ynh_app_setting_set --app=$app --key=allow_anonymous_edits --value=$allow_anonymous_edits
fi
if [ -z "$allow_email_registration" ]; then
allow_email_registration="false"
ynh_app_setting_set --app=$app --key=allow_email_registration --value=$allow_email_registration