diff --git a/check_process b/check_process index b991b3d..e662171 100644 --- a/check_process +++ b/check_process @@ -38,12 +38,11 @@ # setup_sub_dir=1 # setup_root=1 # upgrade=1 from_commit=3b9c5041e4fa73cb965368379f2b83d076c65341 -;;; Levels - Level 5=auto ;;; Options Email=nicolas@aubonalbanais.ovh Notification=none ;;; Upgrade options ; commit=11f5b96df7d8850beff47f9904745fa53a6f7ed9 name=Version 0.96.0~ynh4 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=1& \ No newline at end of file + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=1& + \ No newline at end of file diff --git a/manifest.json b/manifest.json index 6b501c0..7d1b69d 100644 --- a/manifest.json +++ b/manifest.json @@ -8,13 +8,13 @@ }, "version": "0.96.9~ynh5", "url": "https://github.com/janeczku/calibre-web", - "license": "free", + "license": "GPL-3.0-only", "maintainer": { "name": "Krakinou", "email": "misterl56@hotmail.com" }, "requirements": { - "yunohost": ">= 3.7.1" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index c6b3b07..3e67c31 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -27,7 +27,7 @@ ynh_multimedia_build_main_dir () { local checksum="806a827ba1902d6911095602a9221181" # Download yunohost.multimedia scripts - wget -nv https://github.com/Yunohost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz + wget -nv https://github.com/Yunohost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz 2>&1 # Check the control sum echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \ diff --git a/scripts/install b/scripts/install index 8b96265..b807e14 100755 --- a/scripts/install +++ b/scripts/install @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +source _common.sh source /usr/share/yunohost/helpers #================================================= @@ -27,8 +28,6 @@ if [ $is_public -eq 1 ]; then public_library=1 fi -source _common.sh - #================================================= # MANAGE SCRIPT FAILURE #================================================= @@ -36,7 +35,6 @@ source _common.sh # Exit if an error occurs during the execution of the script ynh_abort_if_errors - #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -45,9 +43,6 @@ ynh_script_progression --message="Validating installation parameters..." --weigh final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" -# Normalize the url path syntax -path_url=$(ynh_normalize_url_path $path_url) - # Check web path availability ynh_webpath_available $domain $path_url # Register (book) web path @@ -63,7 +58,6 @@ ynh_app_setting_set $app path $path_url ynh_app_setting_set $app admin $admin ynh_app_setting_set $app is_public $is_public - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -192,16 +186,6 @@ eval sqlite3 $final_path/app.db "$conf" conf="\"UPDATE user SET $(. <(echo -E echo $(<../conf/init_calibre_db_user))) WHERE ID=1\"" eval sqlite3 $final_path/app.db "$conf" -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -#disabled - do not work when calibreweb is not owner -#chown -R root: $final_path -#chown $app: $final_path/app.db - - #================================================= # STORE THE CHECKSUM OF THE CONFIG FILE #================================================= @@ -210,10 +194,10 @@ eval sqlite3 $final_path/app.db "$conf" ynh_store_file_checksum "${final_path}/app.db" #================================================= -# ADVERTISE SERVICE IN ADMIN PANEL +# INTEGRATE SERVICE IN YUNOHOST #================================================= -yunohost service add $app --description "Browse eBook in the web" --log "/var/log/$app/$app.log" +yunohost service add $app --description="Browse eBook in the web" --log="/var/log/$app/$app.log" #================================================= # SETUP SSOWAT @@ -230,7 +214,6 @@ if [ $public_library -eq 0 ]; then yunohost app addaccess $app -u $admin fi - #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/restore b/scripts/restore index 70df492..8bd3aea 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= @@ -19,6 +20,7 @@ ynh_abort_if_errors # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading settings..." --weight=1 + app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) @@ -27,7 +29,6 @@ final_path=$(ynh_app_setting_get $app final_path) calibre_dir=$(ynh_app_setting_get $app calibre_dir) is_public=$(ynh_app_setting_get $app is_public) port=$(ynh_app_setting_get $app port) -source ../settings/scripts/_common.sh #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -99,7 +100,7 @@ curl https://bootstrap.pypa.io/get-pip.py | python3 ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/upgrade b/scripts/upgrade index fcf73ef..44a58c5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -10,6 +10,7 @@ version_gt() { # IMPORT GENERIC HELPERS #================================================= +source _common.sh source /usr/share/yunohost/helpers #================================================= @@ -34,8 +35,6 @@ ynh_app_setting_set $app calibre_dir $calibre_dir upload=$(sqlite3 $final_path/app.db "SELECT config_uploading FROM settings WHERE ID=1") ynh_app_setting_set $app upload $upload -source _common.sh - #================================================= # CHECK VERSION #================================================= @@ -86,13 +85,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="stop" -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path $path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -224,6 +216,12 @@ ynh_add_systemd_config # Set permissions on app files chown -R $app: $final_path +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= + +yunohost service add $app --description="Browse eBook in the web" --log="/var/log/$app/$app.log" + #================================================= # SETUP SSOWAT #================================================= @@ -262,4 +260,3 @@ ynh_systemd_action --service_name=$app --action="start" -l "server on :$port" -t #================================================= ynh_script_progression --message="Upgrade of $app completed" --last -