1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/agendav_ynh.git synced 2024-09-03 20:36:12 +02:00

Remove is_public

This commit is contained in:
Jean-Baptiste Holcroft 2017-10-21 00:28:10 +02:00
parent aa5d2e8b98
commit 6aef7cac93
4 changed files with 8 additions and 44 deletions

View file

@ -5,13 +5,16 @@
path="/path" (PATH)
is_public=1 (PUBLIC|public=1|private=0)
language="fr"
; pre-install
sudo yunohost domain add --verbose baikaldomain.tld --admin-password $PASSWORD
sudo yunohost app install baikal -a "domain=baikaldomain.tld&path=/baikal&password=admin"
; Checks
pkg_linter=1
setup_sub_dir=1
setup_root=0
setup_root=1
setup_nourl=0
setup_private=1
setup_public=1
setup_public=0
upgrade=1
backup_restore=1
multi_instance=1

View file

@ -43,14 +43,6 @@
"example": "/agendav",
"default": "/agendav"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Should Agendav be publicly accessible?"
},
"default": "0"
},
{
"name": "language",
"ask": {

View file

@ -13,7 +13,6 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
language=$YNH_APP_ARG_LANGUAGE
is_public=$YNH_APP_ARG_IS_PUBLIC
# Set app specific variables
app=$YNH_APP_INSTANCE_NAME
@ -26,7 +25,6 @@ path_url=$(ynh_normalize_url_path "$path_url")
language=${LANGUAGES[$language]}
ynh_app_setting_set "$app" language "$language"
ynh_app_setting_set "$app" is_public "$is_public"
ynh_app_setting_set "$app" path "$path_url"
# Check web path availability
@ -87,7 +85,7 @@ caldav_url="https://${caldav_domain}${caldav_path%/}"
sed -i "s@{CALDAV_BASEURL}@${caldav_url}${caldav_baseurl}@g" "$conf_path"
sed -i "s@{CALDAV_DOMAIN}@${caldav_domain}@g" "$conf_path"
ynh_system_user_create "$app" "$final_path"
ynh_system_user_create "$app"
# Protect source code against modifications
find "${final_path}" -type f -exec chown root:root {} \; -exec chmod 644 {} \;
@ -120,21 +118,7 @@ ynh_add_nginx_config
# Copy and set php-fpm configuration
ynh_add_fpm_config
if [ "$is_public" -eq 0 ]
then # Remove the public access
ynh_app_setting_delete "$app" skipped_uris
fi
# Make app public if necessary
if [ "$is_public" -eq 1 ]
then
# unprotected_uris allows SSO credentials to be passed anyway.
ynh_app_setting_set "$app" unprotected_uris "/"
# ynh panel is not needed
ynh_replace_string " include conf.d/" " #include conf.d/" "$finalnginxconf"
ynh_store_file_checksum "$finalnginxconf"
fi
ynh_app_setting_delete "$app" skipped_uris
# Reload services
service php5-fpm restart

View file

@ -20,7 +20,6 @@ path_url=$(ynh_app_setting_get "$app" path)
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
encryptkey=$(ynh_app_setting_get "$app" encryptkey)
language=$(ynh_app_setting_get "$app" language)
is_public=$(ynh_app_setting_get "$app" is_public)
# Set and store language
if [[ -z "$language" ]]; then
@ -108,21 +107,7 @@ ynh_add_nginx_config
# Copy and set php-fpm configuration
ynh_add_fpm_config
if [ $is_public -eq 0 ]
then # Remove the public access
ynh_app_setting_delete "$app" skipped_uris
fi
# Make app public if necessary
if [ $is_public -eq 1 ]
then
# unprotected_uris allows SSO credentials to be passed anyway
ynh_app_setting_set "$app" unprotected_uris "/"
# ynh panel is not needed
ynh_replace_string " include conf.d/" " #include conf.d/" "$finalnginxconf"
ynh_store_file_checksum "$finalnginxconf"
fi
ynh_app_setting_delete "$app" skipped_uris
# Reload services
service php5-fpm restart