diff --git a/README.md b/README.md index 7b1be38..ea4b247 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Kavita is a fast, feature rich, cross platform reading server. Built with a focu - OPDS-PS Support -**Shipped version:** 0.7.2~ynh2 +**Shipped version:** 0.7.7~ynh1 **Demo:** https://demo.kavitareader.com/ diff --git a/README_fr.md b/README_fr.md index 3b70129..27d794a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -31,7 +31,7 @@ Kavita is a fast, feature rich, cross platform reading server. Built with a focu - OPDS-PS Support -**Version incluse :** 0.7.2~ynh2 +**Version incluse :** 0.7.7~ynh1 **Démo :** https://demo.kavitareader.com/ diff --git a/conf/appsettings.json.example b/conf/appsettings.json.example index 890499a..9ef25a3 100644 --- a/conf/appsettings.json.example +++ b/conf/appsettings.json.example @@ -2,5 +2,6 @@ "TokenKey": "__KEY__", "Port": __PORT__, "IpAddresses": "", - "BaseUrl": "__URL_PATH__" + "BaseUrl": "__URL_PATH__", + "Cache": 50 } diff --git a/manifest.toml b/manifest.toml index 6ae6242..f5c27a2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Kavita" description.en = "Media server for your comics, manga and books" description.fr = "Serveur multimédia pour vos bandes dessinées, mangas et livres" -version = "0.7.2~ynh2" +version = "0.7.7~ynh1" maintainers = ["eric_G"] @@ -43,12 +43,15 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] in_subdir = true - amd64.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.2/kavita-linux-x64.tar.gz" - amd64.sha256 = "d4bc73321e1241a1e6247fc0c5ff14504e73c5b3ce9c22a237fd6eae7fc51f33" - arm64.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.2/kavita-linux-arm64.tar.gz" - arm64.sha256 = "634d8b1be654de18ac0238512b9e552e9ad2dd50e6113199907fce525f71f14c" - armhf.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.2/kavita-linux-arm.tar.gz" - armhf.sha256 = "3bf7aac85f51432c8cc0a46ea885bb0167b03e9c0209858a76b1785f884cf104" + amd64.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.7/kavita-linux-x64.tar.gz" + amd64.sha256 = "12009b69f6263274752b617d33fd9486ad8b2bf3602ff3309c0cd5496ab3a71a" + arm64.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.7/kavita-linux-arm64.tar.gz" + arm64.sha256 = "53d73c0f47822c0772c51f0f3dcc3c911e0a8706d07dd9bf75dea4a21fd89bdb" + armhf.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.7/kavita-linux-arm.tar.gz" + armhf.sha256 = "283fc142ea9b281c2242dfe7e54774ce273d8990b8f0418dd90ec5bcac85e624" + + # https://yunohost.org/fr/packaging_apps_resources#regarding-autoupdate + autoupdate.strategy = "latest_github_release" [resources.ports] main.default = 5000 diff --git a/scripts/change_url b/scripts/change_url index d0fcf24..6d7e713 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=stop --log_path=systemd +ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd #================================================= # MODIFY URL IN NGINX CONF @@ -32,13 +32,16 @@ ynh_change_url_nginx_config #================================================= ynh_backup_if_checksum_is_different --file="$install_dir/config/appsettings.json" -domain=$new_domain +key=$(ynh_app_setting_get --app="$app" --key=key) +domain="$new_domain" +ynh_app_setting_set --app="$app" --key=domain --value="$domain" url_path=${new_path#/} +ynh_app_setting_set --app="$app" --key=url_path --value="$url_path" ynh_add_config --template="../conf/appsettings.json.example" --destination="$install_dir/config/appsettings.json" chmod 400 "$install_dir/config/appsettings.json" -chown $app:$app "$install_dir/config/appsettings.json" +chown "$app":"$app" "$install_dir/config/appsettings.json" #================================================= # GENERIC FINALISATION @@ -48,7 +51,7 @@ chown $app:$app "$install_dir/config/appsettings.json" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemd_action --service_name="$app" --action=start --log_path=systemd #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 14c2de3..857975b 100755 --- a/scripts/install +++ b/scripts/install @@ -18,13 +18,13 @@ ynh_script_progression --message="Setting up source files..." --weight=4 ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x $install_dir/Kavita +chown -R "$app":www-data "$install_dir" +chmod +x "$install_dir"/Kavita #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -32,19 +32,22 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="Cross platform reading server" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Cross platform reading server" --log="/var/log/$app/$app.log" #================================================= # MODIFY A CONFIG FILE #================================================= ynh_script_progression --message="Modifying a config file..." --weight=1 -key=$(ynh_string_random --length=24) +key=$(ynh_string_random --length=70) +ynh_app_setting_set --app="$app" --key=key --value="$key" url_path=${path#/} +ynh_app_setting_set --app="$app" --key=url_path --value="$url_path" + ynh_add_config --template="../conf/appsettings.json.example" --destination="$install_dir/config/appsettings.json" chmod 600 "$install_dir/config/appsettings.json" -chown $app:$app "$install_dir/config/appsettings.json" +chown "$app":"$app" "$install_dir/config/appsettings.json" #================================================= # START SYSTEMD SERVICE @@ -52,7 +55,7 @@ chown $app:$app "$install_dir/config/appsettings.json" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 4c29204..588e772 100755 --- a/scripts/remove +++ b/scripts/remove @@ -17,10 +17,10 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null +if ynh_exec_warn_less yunohost service status "$app" >/dev/null then ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app + yunohost service remove "$app" fi # Remove the dedicated systemd config diff --git a/scripts/restore b/scripts/restore index 6d9970a..7a44c5a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -19,7 +19,7 @@ ynh_restore_file --origin_path="$install_dir" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app":www-data "$install_dir" #================================================= # RESTORE SYSTEM CONFIGURATIONS @@ -29,16 +29,16 @@ ynh_script_progression --message="Restoring system configurations related to $ap ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet +systemctl enable "$app".service --quiet -yunohost service add $app --description="Cross platform reading server" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Cross platform reading server" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 02663c1..87211f5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -33,24 +33,37 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="config" + ynh_setup_source --dest_dir="$install_dir" --keep="config/appsettings.json" fi chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x $install_dir/Kavita +chown -R "$app":www-data "$install_dir" +chmod +x "$install_dir"/Kavita #================================================= # MODIFY A CONFIG FILE #================================================= ynh_script_progression --message="Modifying a config file..." --weight=1 -key=$(ynh_string_random --length=24) -url_path=${path#/} +key=$(ynh_app_setting_get --app="$app" --key=key) + +if [ -z "$key" ] || [ "$key" == "super secret unguessable key that is longer because we require it" ] +then + key=$(ynh_string_random --length=70) + ynh_app_setting_set --app="$app" --key=key --value="$key" +fi + +url_path=$(ynh_app_setting_get --app="$app" --key=url_path) + +if [ -z "$url_path" ]; then + url_path=${path#/} + ynh_app_setting_set --app="$app" --key=url_path --value="$url_path" +fi + ynh_add_config --template="../conf/appsettings.json.example" --destination="$install_dir/config/appsettings.json" chmod 600 "$install_dir/config/appsettings.json" -chown $app:$app "$install_dir/config/appsettings.json" +chown "$app":"$app" "$install_dir/config/appsettings.json" #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -66,14 +79,14 @@ ynh_add_systemd_config # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -yunohost service add $app --description="Cross platform reading server" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Cross platform reading server" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT