From 3203f506393f0d6be4a1c8f0a44b30cdcc3fae47 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 25 Jul 2020 23:25:36 +0200 Subject: [PATCH] permissions --- scripts/install | 11 ++++++----- scripts/upgrade | 16 +++++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index f333dde..49f7f35 100755 --- a/scripts/install +++ b/scripts/install @@ -136,7 +136,7 @@ ynh_replace_string --match_string="__YNH_DATA_PATH__" --replace_string="$data_pa # Calculate and store the config file checksum into the app settings ynh_store_file_checksum "$final_path/config.js" -# Replace ajax.googleapis.com by local +# Replace ajax.googleapis by local file cp ../sources/jquery.min.js "$final_path/static/jquery.min.js" ynh_replace_string --match_string="jquery.min.js" --replace_string="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" --target_file="$final_path/static/jquery.min.js" @@ -150,8 +150,6 @@ ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_f cp ../conf/haste.sh /usr/bin/$app chmod +x /usr/bin/$app -echo "Please use 'cmd | $app' to paste the output of the command to your Haste server." >&2 - #================================================= # GENERIC FINALIZATION #================================================= @@ -190,10 +188,13 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP SSOWAT #================================================= +ynh_script_progression --message="Configuring SSOwat..." --weight=1 -if [ $is_public -eq 1 ]; +if [ $is_public -eq 1 ] then - ynh_app_setting_set $app skipped_uris "/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 59e610f..6765c5f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -92,7 +92,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 # Create a dedicated nginx config ynh_add_nginx_config @@ -120,8 +120,6 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version pushd "$final_path" || ynh_die ynh_use_nodejs ynh_exec_warn_less ynh_npm install - # ynh_npm cache clean - # ynh_npm update popd || ynh_die #================================================= @@ -160,6 +158,10 @@ ynh_replace_string --match_string="__YNH_DATA_PATH__" --replace_string="$data_pa # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum "$final_path/config.js" +# Replace ajax.googleapis by local file +cp ../sources/jquery.min.js "$final_path/static/jquery.min.js" +ynh_replace_string --match_string="jquery.min.js" --replace_string="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" --target_file="$final_path/static/jquery.min.js" + #================================================= # UPGRADE HASTE BINARY #================================================= @@ -191,10 +193,10 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap # SETUP SSOWAT #================================================= -if [ $is_public -eq 1 ]; -then - ynh_app_setting_set $app skipped_uris "/" -fi +# if [ $is_public -eq 1 ]; +# then +# ynh_app_setting_set $app skipped_uris "/" +# fi #================================================= # RELOAD NGINX