mirror of
https://github.com/YunoHost-Apps/privatebin_ynh.git
synced 2024-09-03 20:15:56 +02:00
Merge remote-tracking branch 'origin/public_pastes' into testing
This commit is contained in:
commit
204989f3d9
4 changed files with 36 additions and 2 deletions
|
@ -49,6 +49,10 @@
|
||||||
"en": "Is it a public site?",
|
"en": "Is it a public site?",
|
||||||
"fr": "Est-ce un site public ?"
|
"fr": "Est-ce un site public ?"
|
||||||
},
|
},
|
||||||
|
"help": {
|
||||||
|
"en": "If private, only YunoHost users can create a paste, but everyone can read it.",
|
||||||
|
"fr": "Si privé, seul les utilisateurs YunoHost peuvent créer un paste, mais tout le monde peut lire."
|
||||||
|
},
|
||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -76,6 +76,24 @@ then
|
||||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# UPDATE SSOWAT
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Reconfiguring SSOwat..."
|
||||||
|
|
||||||
|
if [ $is_public -eq 0 ]
|
||||||
|
then
|
||||||
|
# If the app is private, viewing images stays publicly accessible.
|
||||||
|
if [ "$new_path" == "/" ]; then
|
||||||
|
# If the path is /, clear it to prevent any error with the regex.
|
||||||
|
new_path=""
|
||||||
|
fi
|
||||||
|
# Modify the domain to be used in a regex
|
||||||
|
domain_regex=$(echo "$new_domain" | sed 's@-@.@g')
|
||||||
|
ynh_app_setting_set --app=$app --key=protected_regex --value="$domain_regex$new_path/$"
|
||||||
|
ynh_app_setting_set --app=$app --key=unprotected_regex --value="$domain_regex$new_path/.*$"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -105,8 +105,14 @@ ynh_script_progression --message="Configuring SSOwat..."
|
||||||
|
|
||||||
# If app is public, add url to SSOWat conf as skipped_uris
|
# If app is public, add url to SSOWat conf as skipped_uris
|
||||||
if [ $is_public -eq 1 ]; then
|
if [ $is_public -eq 1 ]; then
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
# unprotected_uris allows SSO credentials to be passed anyway.
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||||
|
else
|
||||||
|
# If the app is private, viewing paste stays publicly accessible.
|
||||||
|
# Modify the domain to be used in a regex
|
||||||
|
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
||||||
|
ynh_app_setting_set --app=$app --key=protected_regex --value="$domain_regex$path_url/$"
|
||||||
|
ynh_app_setting_set --app=$app --key=unprotected_regex --value="$domain_regex$path_url/.*$"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -143,6 +143,12 @@ ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1
|
||||||
if [ $is_public -eq 1 ]; then
|
if [ $is_public -eq 1 ]; then
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
# unprotected_uris allows SSO credentials to be passed anyway.
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||||
|
else
|
||||||
|
# If the app is private, viewing paste stays publicly accessible.
|
||||||
|
# Modify the domain to be used in a regex
|
||||||
|
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
||||||
|
ynh_app_setting_set --app=$app --key=protected_regex --value="$domain_regex$path_url/$"
|
||||||
|
ynh_app_setting_set --app=$app --key=unprotected_regex --value="$domain_regex$path_url/.*$"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue