1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/limesurvey_ynh.git synced 2024-09-03 19:36:32 +02:00

fix upgrade, restore

This commit is contained in:
Salamandar 2024-01-23 23:54:37 +01:00
parent 976000f0bc
commit a173b40577
3 changed files with 21 additions and 10 deletions

View file

@ -37,6 +37,12 @@ ram.runtime = "50M"
type = "path" type = "path"
default = "/poll" default = "/poll"
[install.init_main_permission]
# this is a generic question - ask strings are automatically handled by YunoHost's core
# This won't be saved as setting and will instead be used to initialize the SSOwat permission
type = "group"
default = "visitors"
[install.language] [install.language]
ask.en = "Choose the default language of this LimeSurvey" ask.en = "Choose the default language of this LimeSurvey"
ask.fr = "Choisissez la langue par défault de LimeSurvey" ask.fr = "Choisissez la langue par défault de LimeSurvey"
@ -50,12 +56,6 @@ ram.runtime = "50M"
[install.password] [install.password]
type = "password" type = "password"
[install.is_admin_public]
ask.en = "In private mode, only authorized YunoHost members can create poll, with the public mode, it's possible to create account to people with no YunoHost account. "
ask.fr = "En mode privé, seuls les utilisateurs YunoHost autorisés peuvent créer un sondage. En mode public, il est possible de créer un sondage avec un compte Limesurvey mais sans compte YunoHost."
type = "boolean"
default = true
[resources] [resources]
[resources.sources] [resources.sources]
[resources.sources.main] [resources.sources.main]
@ -80,6 +80,8 @@ ram.runtime = "50M"
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"
admin.url = "/admin"
admin.allowed = "admin"
[resources.apt] [resources.apt]
packages = [ packages = [
@ -92,6 +94,7 @@ ram.runtime = "50M"
"php7.4-ldap", "php7.4-ldap",
"php7.4-zip", "php7.4-zip",
"php7.4-mbstring", "php7.4-mbstring",
"mariadb-server",
] ]
[resources.database] [resources.database]

View file

@ -17,9 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
ynh_secure_remove "$install_dir/upload"
ln -s "$data_dir/upload" "$install_dir/upload"
chmod 750 "$install_dir" chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"

View file

@ -33,13 +33,24 @@ if [ ! -L "$install_dir/upload" ]; then
mv "$install_dir/upload" "$data_dir/upload" mv "$install_dir/upload" "$data_dir/upload"
fi fi
# Legacy permission setting
if [ -z "${is_admin_public:-}" ]; then
if [ "$is_admin_public" -eq 1 ]; then
ynh_permission_update --permission="admin" --add="visitors"
fi
ynh_app_setting_delete --app="$app" --key=is_admin_public
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="plugins/ application/config/config.php upload" ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="plugins/ application/config/config.php"
ynh_secure_remove --file="$install_dir/upload"
ln -s "$data_dir/upload" "$install_dir/upload"
chmod 750 "$install_dir" chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"