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 #40 from YunoHost-Apps/testing

Testing v0.7.14~ynh1
This commit is contained in:
OniriCorpe 2024-02-10 03:26:14 +01:00 committed by GitHub
commit 0b32065be2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 15 additions and 114 deletions

View file

@ -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.13~ynh1
**Shipped version:** 0.7.14~ynh1
**Demo:** https://demo.kavitareader.com/

View file

@ -30,7 +30,7 @@ Kavita est un serveur de lecture multiplateforme rapide et riche en fonctionnali
- Analyses de bibliothèque rapides et efficaces. N'effectuez pas d'E/S si le fichier sous-jacent n'a pas changé.
- Prise en charge OPDS-PS
**Version incluse :** 0.7.13~ynh1
**Version incluse :** 0.7.14~ynh1
**Démo :** https://demo.kavitareader.com/

View file

@ -1,7 +1,7 @@
{
"TokenKey": "__KEY__",
"Port": __PORT__,
"IpAddresses": "",
"IpAddresses": "127.0.0.1",
"BaseUrl": "__URL_PATH__",
"Cache": 50
}

View file

@ -1,7 +1,7 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__;
proxy_pass http://127.0.0.1:__PORT__/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; aio threads;

View file

@ -1,6 +1,6 @@
[Unit]
Description=Kavita: Media server for your comics
After=network.target
After=network.target nginx.service
[Service]
Type=simple

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.13~ynh1"
version = "0.7.14~ynh1"
maintainers = ["eric_G"]
@ -46,12 +46,12 @@ ram.runtime = "50M"
[resources.sources]
[resources.sources.main]
in_subdir = true
amd64.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.13/kavita-linux-x64.tar.gz"
amd64.sha256 = "1b699f5e1943f642a902a819dc6821685e4ced0236f1d9278704918189e51bb8"
arm64.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.13/kavita-linux-arm64.tar.gz"
arm64.sha256 = "97459143683c19e0a22208a01fa34cd098fd28af07b98cc4c9e76fea0bab3ad9"
armhf.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.13/kavita-linux-arm.tar.gz"
armhf.sha256 = "0e50acf1f3f25c3ab8486f58ad8a74d99bec36f4e04379a8984875469d9b9eb4"
amd64.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.14/kavita-linux-x64.tar.gz"
amd64.sha256 = "385e75ce4e6faae5a09b50ac0c3ebda6a5374d51c249dfcf045e1e44bb49b22b"
arm64.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.14/kavita-linux-arm64.tar.gz"
arm64.sha256 = "d0514a54537f18b3cfdc385f06796806e77a69f91825ec914cd50809a423a902"
armhf.url = "https://github.com/Kareadita/Kavita/releases/download/v0.7.14/kavita-linux-arm.tar.gz"
armhf.sha256 = "e8201324ee8cd6ad6f65d1437cc95ef194fd9518b794465c93c36e2e05b016f4"
# https://yunohost.org/fr/packaging_apps_resources#regarding-autoupdate
autoupdate.strategy = "latest_github_release"

View file

@ -36,6 +36,7 @@ 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#/}
if [ "$url_path" == "" ]; then url_path="/"; fi
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"

View file

@ -1,102 +0,0 @@
#!/bin/bash
# In simple cases, you don't need a config script.
# With a simple config_panel.toml, you can write in the app settings, in the
# upstream config file or replace complete files (logo ...) and restart services.
# The config scripts allows you to go further, to handle specific cases
# (validation of several interdependent fields, specific getter/setter for a value,
# display dynamic informations or choices, pre-loading of config type .cube... ).
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# SPECIFIC GETTERS FOR TOML SHORT KEY
#=================================================
get__amount() {
# Here we can imagine to have an API call to stripe to know the amount of donation during a month
local amount = 200
# It's possible to change some properties of the question by overriding it:
if [ $amount -gt 100 ]
then
cat << EOF
style: success
value: $amount
ask:
en: A lot of donation this month: **$amount €**
EOF
else
cat << EOF
style: danger
value: $amount
ask:
en: Not so much donation this month: $amount €
EOF
fi
}
get__prices() {
local prices = "$(grep "DONATION\['" "$final_path/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')"
if [ "$prices" == "," ];
then
# Return YNH_NULL if you prefer to not return a value at all.
echo YNH_NULL
else
echo $prices
fi
}
#=================================================
# SPECIFIC VALIDATORS FOR TOML SHORT KEYS
#=================================================
validate__publishable_key() {
# We can imagine here we test if the key is really a publisheable key
(is_secret_key $publishable_key) &&
echo 'This key seems to be a secret key'
}
#=================================================
# SPECIFIC SETTERS FOR TOML SHORT KEYS
#=================================================
set__prices() {
#---------------------------------------------
# IMPORTANT: setter are trigger only if a change is detected
#---------------------------------------------
for price in $(echo $prices | sed "s/,/ /"); do
frequency=$(echo $price | cut -d/ -f1)
currency=$(echo $price | cut -d/ -f2)
price_id=$(echo $price | cut -d/ -f3)
sed "d/DONATION\['$frequency'\]\['$currency'\]" "$final_path/settings.py"
echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$final_path/settings.py"
done
#---------------------------------------------
# IMPORTANT: to be able to upgrade properly, you have to saved the value in settings too
#---------------------------------------------
ynh_app_setting_set $app prices $prices
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_run $1

View file

@ -42,6 +42,7 @@ ynh_script_progression --message="Modifying a config file..." --weight=1
key=$(ynh_string_random --length=70)
ynh_app_setting_set --app="$app" --key=key --value="$key"
url_path=${path#/}
if [ "$url_path" == "" ]; then url_path="/"; fi
ynh_app_setting_set --app="$app" --key=url_path --value="$url_path"
ynh_add_config --template="appsettings.json.example" --destination="$install_dir/config/appsettings.json"

View file

@ -57,6 +57,7 @@ url_path=$(ynh_app_setting_get --app="$app" --key=url_path)
if [ -z "$url_path" ]; then
url_path=${path#/}
if [ "$url_path" == "" ]; then url_path="/"; fi
ynh_app_setting_set --app="$app" --key=url_path --value="$url_path"
fi