1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hedgedoc_ynh.git synced 2024-09-03 19:25:52 +02:00

Add FreeURL authentication

This commit is contained in:
Éric Gaspar 2023-01-21 12:30:12 +01:00
parent de36e0d897
commit 9158a3f076
3 changed files with 17 additions and 1 deletions

View file

@ -23,12 +23,20 @@ name = "HedgeDoc configuration"
bind = "allow_email_registration:__FINALPATH__/config.json"
[main.config.allow_free_url]
ask = "Allow email registration"
ask = "Allow new note creation"
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"
[main.config.require_free_url_authentication]
ask = "Require FreeURL authentication"
type = "boolean"
yes = "true"
no = "false"
help = "Set to require authentication for FreeURL mode style note creation."
bind = "require_free_url_authentication:__FINALPATH__/config.json"

View file

@ -32,6 +32,7 @@ app=$YNH_APP_INSTANCE_NAME
allow_anonymous=false
allow_email_registration=false
allow_free_url=false
require_free_url_authentication=false
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
@ -54,6 +55,7 @@ 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
ynh_app_setting_set --app=$app --key=require_free_url_authentication --value=$require_free_url_authentication
#=================================================
# STANDARD MODIFICATIONS

View file

@ -27,6 +27,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)
require_free_url_authentication=$(ynh_app_setting_get --app=$app --key=require_free_url_authentication)
#=================================================
# CHECK VERSION
@ -54,6 +55,11 @@ if [ -z "$allow_free_url" ]; then
ynh_app_setting_set --app=$app --key=allow_free_url --value=$allow_free_url
fi
if [ -z "$require_free_url_authentication" ]; then
require_free_url_authentication="false"
ynh_app_setting_set --app=$app --key=require_free_url_authentication --value=$require_free_url_authentication
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all