mirror of
https://github.com/YunoHost-Apps/libreto_ynh.git
synced 2024-09-03 19:36:14 +02:00
set permissions
This commit is contained in:
parent
7a4ef3b394
commit
afc719d2bb
3 changed files with 14 additions and 32 deletions
|
@ -28,13 +28,6 @@ $providers = array(
|
||||||
'markdown' => false,
|
'markdown' => false,
|
||||||
'html' => true,
|
'html' => true,
|
||||||
),
|
),
|
||||||
'factor' => array(
|
|
||||||
'name' => "Factor",
|
|
||||||
'url' => "https://factor.cc/pad",
|
|
||||||
'default_text' => "Welcome to factor.cc Pad!",
|
|
||||||
'markdown' => false,
|
|
||||||
'html' => true,
|
|
||||||
),
|
|
||||||
'etherpad' => array(
|
'etherpad' => array(
|
||||||
'name' => "Etherpad.net",
|
'name' => "Etherpad.net",
|
||||||
'url' => "https://etherpad.net",
|
'url' => "https://etherpad.net",
|
||||||
|
|
|
@ -50,7 +50,6 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
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=path --value=$path_url
|
||||||
ynh_app_setting_set --app=$app --key=etherpad_instance --value=$etherpad_instance
|
ynh_app_setting_set --app=$app --key=etherpad_instance --value=$etherpad_instance
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
|
||||||
ynh_app_setting_set --app=$app --key=creation_open --value=$creation_open
|
ynh_app_setting_set --app=$app --key=creation_open --value=$creation_open
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -125,17 +124,12 @@ ynh_store_file_checksum "$final_path/config.php"
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring SSOwat..." --weight=1
|
ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
if [ $creation_open -eq 1 ]
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
then
|
|
||||||
ynh_app_setting_set $app skipped_uris "/"
|
|
||||||
else
|
|
||||||
ynh_app_setting_set $app skipped_regex "/[^/]+"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -17,7 +17,6 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
etherpad_instance=$(ynh_app_setting_get --app=$app --key=etherpad_instance)
|
etherpad_instance=$(ynh_app_setting_get --app=$app --key=etherpad_instance)
|
||||||
creation_open=$(ynh_app_setting_get --app=$app --key=creation_open)
|
creation_open=$(ynh_app_setting_get --app=$app --key=creation_open)
|
||||||
|
@ -41,6 +40,18 @@ ynh_clean_setup () {
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
|
# Cleaning legacy permissions
|
||||||
|
if ynh_legacy_permissions_exists; then
|
||||||
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -95,22 +106,6 @@ ynh_backup_if_checksum_is_different "$final_path/config.php"
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
ynh_store_file_checksum "$final_path/config.php"
|
ynh_store_file_checksum "$final_path/config.php"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1
|
|
||||||
|
|
||||||
# Make app public if necessary
|
|
||||||
if [ $is_public -eq 1 ]
|
|
||||||
then
|
|
||||||
if [ $creation_open -eq 1 ]
|
|
||||||
then
|
|
||||||
ynh_app_setting_set $app skipped_uris "/"
|
|
||||||
else
|
|
||||||
ynh_app_setting_set $app skipped_regex "/[^/]+"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue