1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kavita_ynh.git synced 2024-09-03 19:26:30 +02:00

Merge pull request #13 from OniriCorpe/upgrade-v0.7.7

upgrade to v0.7.7
This commit is contained in:
eric_G 2023-08-23 07:13:11 +02:00 committed by GitHub
commit 9cde1977eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 56 additions and 33 deletions

View file

@ -2,5 +2,6 @@
"TokenKey": "__KEY__",
"Port": __PORT__,
"IpAddresses": "",
"BaseUrl": "__URL_PATH__"
"BaseUrl": "__URL_PATH__",
"Cache": 50
}

View file

@ -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

View file

@ -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

View file

@ -18,8 +18,8 @@ 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
@ -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

View file

@ -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

View file

@ -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

View file

@ -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