mirror of
https://github.com/YunoHost-Apps/vikunja_ynh.git
synced 2024-09-03 18:06:26 +02:00
fix
This commit is contained in:
parent
1ddbadcb5b
commit
33ca6f7ad5
7 changed files with 15 additions and 90 deletions
|
@ -1,6 +0,0 @@
|
||||||
SOURCE_URL=https://dl.vikunja.io/frontend/vikunja-frontend-0.20.3.zip
|
|
||||||
SOURCE_SUM=f95b5d81b25a5dc3e53bbd06aacbabea8b016fb880bd59cfbf689a1dbb364669
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=zip
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=true
|
|
|
@ -17,7 +17,7 @@ admindoc = "https://vikunja.io/docs/"
|
||||||
code = "https://kolaente.dev/vikunja/"
|
code = "https://kolaente.dev/vikunja/"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.1.15"
|
yunohost = ">= 11.1.17"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
ldap = false
|
ldap = false
|
||||||
|
|
|
@ -9,25 +9,6 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
#REMOVEME? ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_print_info --message="Loading installation settings..."
|
|
||||||
|
|
||||||
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
|
||||||
#REMOVEME? backend_path=$(ynh_app_setting_get --app=$app --key=backend_path)
|
|
||||||
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
||||||
#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -12,28 +12,10 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
||||||
backend_path=$(ynh_app_setting_get --app=$app --key=backend_path)
|
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
|
||||||
db_user=$db_name
|
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
|
||||||
secret=$(ynh_string_random --length=32)
|
secret=$(ynh_string_random --length=32)
|
||||||
timezone="$(cat /etc/timezone)"
|
timezone="$(cat /etc/timezone)"
|
||||||
|
redis_db=$(ynh_redis_get_free_db)
|
||||||
set_motd=$(ynh_app_setting_get --app=$app --key=set_motd)
|
|
||||||
enable_registration=$(ynh_app_setting_get --app=$app --key=enable_registration)
|
|
||||||
enable_linksharing=$(ynh_app_setting_get --app=$app --key=enable_linksharing)
|
|
||||||
enable_taskattachments=$(ynh_app_setting_get --app=$app --key=enable_taskattachments)
|
|
||||||
enable_taskcomments=$(ynh_app_setting_get --app=$app --key=enable_taskcomments)
|
|
||||||
enable_emailreminders=$(ynh_app_setting_get --app=$app --key=enable_emailreminders)
|
|
||||||
enable_userdeletion=$(ynh_app_setting_get --app=$app --key=enable_userdeletion)
|
|
||||||
maxavatarsize=$(ynh_app_setting_get --app=$app --key=maxavatarsize)
|
|
||||||
maxitemsperpage=$(ynh_app_setting_get --app=$app --key=maxitemsperpage)
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -49,29 +31,7 @@ ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||||
|
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
ynh_change_url_nginx_config
|
||||||
|
|
||||||
# Change the path in the NGINX config file
|
|
||||||
if [ $change_path -eq 1 ]
|
|
||||||
then
|
|
||||||
# Make a backup of the original NGINX config file if modified
|
|
||||||
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
|
||||||
# Set global variables for NGINX helper
|
|
||||||
domain="$old_domain"
|
|
||||||
path_url="$new_path"
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change the domain for NGINX
|
|
||||||
if [ $change_domain -eq 1 ]
|
|
||||||
then
|
|
||||||
# Delete file checksum for the old conf file location
|
|
||||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
|
||||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
|
||||||
# Store file checksum for the new config file location
|
|
||||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
|
@ -80,7 +40,6 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
domain="$new_domain"
|
domain="$new_domain"
|
||||||
path="$new_path"
|
path="$new_path"
|
||||||
redis_db=$(ynh_redis_get_free_db)
|
|
||||||
ynh_add_config --template="../conf/config.yml" --destination="$backend_path/config.yml"
|
ynh_add_config --template="../conf/config.yml" --destination="$backend_path/config.yml"
|
||||||
|
|
||||||
chmod 600 "$backend_path/config.yml"
|
chmod 600 "$backend_path/config.yml"
|
||||||
|
|
|
@ -69,7 +69,7 @@ ynh_app_setting_set --app=$app --key=backend_path --value=$backend_path
|
||||||
mkdir -p "$backend_path"
|
mkdir -p "$backend_path"
|
||||||
mkdir -p "$backend_path/files"
|
mkdir -p "$backend_path/files"
|
||||||
tempdir="$(mktemp -d)"
|
tempdir="$(mktemp -d)"
|
||||||
ynh_setup_source --dest_dir=$tempdir --source_id=$YNH_ARCH
|
ynh_setup_source --dest_dir=$tempdir --source_id="back"
|
||||||
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
|
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
|
||||||
cp "$back" "$backend_path/vikunja"
|
cp "$back" "$backend_path/vikunja"
|
||||||
|
|
||||||
|
|
|
@ -18,14 +18,6 @@ ynh_script_progression --message="Restoring the NGINX configuration..." --weight
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RECREATE THE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
|
||||||
#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -30,50 +30,50 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
# If backend_path doesn't exist, create it
|
# If backend_path doesn't exist, create it
|
||||||
if [ -z "$backend_path" ]; then
|
if [ -z "$backend_path" ]; then
|
||||||
backend_path=/opt/$app
|
backend_path=/opt/$app
|
||||||
#REMOVEME? ynh_app_setting_set --app=$app --key=backend_path --value=$backend_path
|
ynh_app_setting_set --app=$app --key=backend_path --value=$backend_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$set_motd" ]; then
|
if [ -z "${set_motd:-}" ]; then
|
||||||
set_motd=""
|
set_motd=""
|
||||||
ynh_app_setting_set --app=$app --key=set_motd --value=$set_motd
|
ynh_app_setting_set --app=$app --key=set_motd --value=$set_motd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$enable_registration" ]; then
|
if [ -z "${enable_registration:-}" ]; then
|
||||||
enable_registration="true"
|
enable_registration="true"
|
||||||
ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration
|
ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$enable_linksharing" ]; then
|
if [ -z "${enable_linksharing:-}" ]; then
|
||||||
enable_linksharing="true"
|
enable_linksharing="true"
|
||||||
ynh_app_setting_set --app=$app --key=enable_linksharing --value=$enable_linksharing
|
ynh_app_setting_set --app=$app --key=enable_linksharing --value=$enable_linksharing
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$enable_taskattachments" ]; then
|
if [ -z "${enable_taskattachments:-}" ]; then
|
||||||
enable_taskattachments="true"
|
enable_taskattachments="true"
|
||||||
ynh_app_setting_set --app=$app --key=enable_taskattachments --value=$enable_taskattachments
|
ynh_app_setting_set --app=$app --key=enable_taskattachments --value=$enable_taskattachments
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$enable_taskcomments" ]; then
|
if [ -z "${enable_taskcomments:-}" ]; then
|
||||||
enable_taskcomments="true"
|
enable_taskcomments="true"
|
||||||
ynh_app_setting_set --app=$app --key=enable_taskcomments --value=$enable_taskcomments
|
ynh_app_setting_set --app=$app --key=enable_taskcomments --value=$enable_taskcomments
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$enable_emailreminders" ]; then
|
if [ -z "${enable_emailreminders:-}" ]; then
|
||||||
enable_emailreminders="true"
|
enable_emailreminders="true"
|
||||||
ynh_app_setting_set --app=$app --key=enable_emailreminders --value=$enable_emailreminders
|
ynh_app_setting_set --app=$app --key=enable_emailreminders --value=$enable_emailreminders
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$enable_userdeletion" ]; then
|
if [ -z "${enable_userdeletion:-}" ]; then
|
||||||
enable_userdeletion="true"
|
enable_userdeletion="true"
|
||||||
ynh_app_setting_set --app=$app --key=enable_userdeletion --value=$enable_userdeletion
|
ynh_app_setting_set --app=$app --key=enable_userdeletion --value=$enable_userdeletion
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$maxavatarsize" ]; then
|
if [ -z "${maxavatarsize:-}" ]; then
|
||||||
maxavatarsize=1024
|
maxavatarsize=1024
|
||||||
ynh_app_setting_set --app=$app --key=maxavatarsize --value=$maxavatarsize
|
ynh_app_setting_set --app=$app --key=maxavatarsize --value=$maxavatarsize
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$maxitemsperpage" ]; then
|
if [ -z "${maxitemsperpage:-}" ]; then
|
||||||
maxitemsperpage=50
|
maxitemsperpage=50
|
||||||
ynh_app_setting_set --app=$app --key=maxitemsperpage --value=$maxitemsperpage
|
ynh_app_setting_set --app=$app --key=maxitemsperpage --value=$maxitemsperpage
|
||||||
fi
|
fi
|
||||||
|
@ -102,12 +102,11 @@ then
|
||||||
# Backend
|
# Backend
|
||||||
mkdir -p "$backend_path/files"
|
mkdir -p "$backend_path/files"
|
||||||
tempdir="$(mktemp -d)"
|
tempdir="$(mktemp -d)"
|
||||||
ynh_setup_source --dest_dir=$tempdir --source_id=$YNH_ARCH
|
ynh_setup_source --dest_dir=$tempdir --source_id="back"
|
||||||
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
|
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
|
||||||
cp "$back" "$backend_path/vikunja"
|
cp "$back" "$backend_path/vikunja"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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"
|
||||||
chmod +x "$backend_path/vikunja"
|
chmod +x "$backend_path/vikunja"
|
||||||
|
|
Loading…
Reference in a new issue