diff --git a/conf/config.json.example b/conf/config.json.example index 7b30ba4..45e0930 100644 --- a/conf/config.json.example +++ b/conf/config.json.example @@ -7,7 +7,7 @@ "loglevel": "info", "useCDN": false, "allowGravatar": false, - "allowFreeURL": false, + "allowFreeURL": __ALLOW_FREE_URL__, "allowAnonymous": __ALLOW_ANONYMOUS__, "allowAnonymousEdits": true, "defaultPermission": "locked", diff --git a/config_panel.toml b/config_panel.toml index e784143..7814eff 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -22,3 +22,13 @@ name = "HedgeDoc configuration" help = "Set to allow registration of new accounts using an email address. If set to false, you can still create accounts using the command line." bind = "allow_email_registration:__FINALPATH__/config.json" + [main.config.allow_free_url] + ask = "Allow email registration" + type = "boolean" + yes = "true" + no = "false" + help = "Set to allow new note creation by accessing a nonexistent note URL. This is the behavior familiar from Etherpad." + bind = "allow_free_url:__FINALPATH__/config.json" + + + diff --git a/scripts/install b/scripts/install index ed5aea4..d5d0569 100644 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME allow_anonymous=false allow_email_registration=false +allow_free_url=false #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -52,6 +53,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url 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 #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index d0f97ad..541592c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,6 +26,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) allow_anonymous=$(ynh_app_setting_get --app=$app --key=allow_anonymous) 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) #================================================= # CHECK VERSION @@ -48,6 +49,11 @@ if [ -z "$allow_email_registration" ]; then ynh_app_setting_set --app=$app --key=allow_email_registration --value=$allow_email_registration fi +if [ -z "$allow_free_url" ]; then + allow_free_url="false" + ynh_app_setting_set --app=$app --key=allow_free_url --value=$allow_free_url +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all