1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/calibreweb_ynh.git synced 2024-09-03 18:16:20 +02:00
Typo in upgrade
update README with todo
This commit is contained in:
Krakinou 2020-05-02 20:39:20 +02:00
parent 0a5473fb1c
commit af40936709
4 changed files with 19 additions and 9 deletions

View file

@ -81,9 +81,13 @@ sudo yunohost app upgrade calibreweb -u https://github.com/Yunohost-Apps/calibre
- [X] rework LDAP integration to create user automatically - [X] rework LDAP integration to create user automatically
- [X] Package_check integration - [X] Package_check integration
- [X] On backup/remove/upgrade : check for database location to update settings - [X] On backup/remove/upgrade : check for database location to update settings
- [ ] Update mail settings with yunohost settings
- [ ] enable magic link - [ ] enable magic link
- [ ] Add cronjob to reload database - [ ] Add cronjob to reload database (for nextcloud integration)
- [ ] OPDS activation - [ ] OPDS activation
- [ ] Add action to restart the server
- [ ] Add action to synchronize users
- [ ] Add action to deactivate LDAP et retrieve admin password
## LICENSE ## LICENSE

View file

@ -11,7 +11,7 @@
"license": "free", "license": "free",
"maintainer": { "maintainer": {
"name": "Krakinou", "name": "Krakinou",
"email": "nicolas@aubonalbanais.ovh" "email": "misterl56@hotmail.com"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.7.1" "yunohost": ">= 3.7.1"

View file

@ -36,6 +36,7 @@ ynh_script_progression --message="Backing up the app before changing its url (ma
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"

View file

@ -39,6 +39,7 @@ source _common.sh
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
current_upstream_package_version=$(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$app/manifest.json") #0.96.0 current_upstream_package_version=$(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$app/manifest.json") #0.96.0
@ -59,9 +60,13 @@ fi
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10 ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting
# restore it if the upgrade fails # restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
@ -87,15 +92,15 @@ path_url=$(ynh_normalize_url_path $path_url)
#================================================= #=================================================
#binaries version is 0.6.0, we need to go throught upgrade to 0.6.6 so that app.db is correctly updated, otherwise database is corrupted #binaries version is 0.6.0, we need to go throught upgrade to 0.6.6 so that app.db is correctly updated, otherwise database is corrupted
if version_gt "0.6.6" $current_upstream_app_version && [ $current_upstream_package_version == "0.6.0" ] && [ "$upgrade_type" == "UPGRADE_APP" ]; then if version_gt "0.6.6" "$current_upstream_app_version" && [ "$current_upstream_package_version" == "0.6.0" ] && [ "$upgrade_type" == "UPGRADE_APP" ]; then
ynh_script_progression --message="Upgrading from $current_upstream_app_version to 0.6.6..." --weight=50 ynh_script_progression --message="Upgrading from $current_upstream_app_version to 0.6.6..." --weight=50
ynh_setup_source --dest_dir="$final_path" --source_id="app066" ynh_setup_source --dest_dir="$final_path" --source_id="app066"
pip install --no-cache-dir --upgrade --target $final_path/vendor -r $final_path/requirements.txt pip install --no-cache-dir --upgrade --target $final_path/vendor -r $final_path/requirements.txt
chown -R $app: $final_path chown -R $app: $final_path
#set database settings as per conf file : restart server so that app.db is regenerated #set database settings as per conf file : restart server so that app.db is regenerated
ynh_systemd_action --service_name=$app --action="start" -line_match="server on " --log_path=$final_path/calibre-web.log -t 20 ynh_systemd_action --service_name=$app --action="start" --line_match="server on " --log_path="$final_path/calibre-web.log" -t 20
#sleep required on low spec like raspberryPi #sleep required on low spec like raspberryPi
sleep 5s sleep 2s
ynh_systemd_action --service_name=$app --action="stop" ynh_systemd_action --service_name=$app --action="stop"
current_upstream_app_version="0.6.6" current_upstream_app_version="0.6.6"
#remove unwanted entry in settings db #remove unwanted entry in settings db
@ -164,13 +169,13 @@ ynh_script_progression --message="Update database..." --weight=1
ynh_backup_if_checksum_is_different "$final_path/app.db" ynh_backup_if_checksum_is_different "$final_path/app.db"
#set database settings as per conf file : restart server so that app.db is regenerated, then add new ldap & log settings #set database settings as per conf file : restart server so that app.db is regenerated, then add new ldap & log settings
if [ $current_upstream_app_version == '0.6.6' ] ; then if [ "$current_upstream_app_version" == '0.6.6' ]; then
ynh_systemd_action --service_name=$app --action="start" -line_match="server on " --log_path=$final_path/calibre-web.log -t 20 ynh_systemd_action --service_name=$app --action="start" --line_match="server on " --log_path="$final_path/calibre-web.log" -t 20
else else
ynh_systemd_action --service_name=$app --action="start" -line_match="server on :$port" -t 20 ynh_systemd_action --service_name=$app --action="start" --line_match="server on :$port" -t 20
fi fi
#sleep required on low spec like raspberryPi #sleep required on low spec like raspberryPi
sleep 2s sleep 3s
ynh_systemd_action --service_name=$app --action="stop" ynh_systemd_action --service_name=$app --action="stop"
conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_settings))), $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\"" conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_settings))), $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\""