diff --git a/README.md b/README.md index 9c73f0e..75a39e0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in TiddlyWiki is a complete interactive wiki in JavaScript. It can be used as a single HTML file in the browser or as a powerful Node.js application. It is highly customisable: the entire user interface is itself implemented in hackable WikiText. -**Shipped version:** 5.3.3~ynh2 +**Shipped version:** 5.3.3~ynh1 **Demo:** https://tiddlywiki.com/ @@ -46,4 +46,4 @@ or sudo yunohost app upgrade tiddlywiki -u https://github.com/YunoHost-Apps/tiddlywiki_ynh/tree/testing --debug ``` -**More info regarding app packaging:** \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 1decdc2..549603e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,5 +1,5 @@ @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po TiddlyWiki est un wiki interactif complet en JavaScript. Il peut être utilisé comme un seul fichier HTML dans le navigateur ou comme une puissante application Node.js (cette dernière est utilisée pour YunoHost). Il est hautement personnalisable : toute l'interface utilisateur est elle-même implémentée dans WikiText modifiable. -**Version incluse :** 5.3.3~ynh2 +**Version incluse :** 5.3.3~ynh1 **Démo :** https://tiddlywiki.com/ diff --git a/conf/nginx.conf b/conf/nginx.conf index 3fe32ec..72cf237 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location ^__PATH__/ { +location __PATH__/ { proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off; diff --git a/manifest.toml b/manifest.toml index d35d760..7f71a96 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "TiddlyWiki" description.en = "Non-linear personal web notebook" description.fr = "Carnet Web personnel non linéaire" -version = "5.3.3~ynh2" +version = "5.3.3~ynh1" maintainers = ["eric_G"] diff --git a/scripts/_common.sh b/scripts/_common.sh index ec0f54e..fea6d13 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -nodejs_version="20" +nodejs_version="18" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index b26c855..022e664 100755 --- a/scripts/install +++ b/scripts/install @@ -22,6 +22,7 @@ ynh_use_nodejs #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 +# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" @@ -32,11 +33,13 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +# Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="Non-linear personal web notebook" --log="/var/log/$app/$app.log" +yunohost service add $app --description="A non-linear personal web notebook" #================================================= # ADD A CONFIGURATION diff --git a/scripts/remove b/scripts/remove index bac70ce..14092e4 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,8 +23,10 @@ then yunohost service remove $app fi +# Remove the dedicated systemd config ynh_remove_systemd_config +# Remove the dedicated NGINX config ynh_remove_nginx_config ynh_remove_nodejs diff --git a/scripts/restore b/scripts/restore index 5c67bdc..f78ee7d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -36,6 +36,7 @@ chown -R $app:www-data "$data_dir" #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +# Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs @@ -51,7 +52,7 @@ 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 -yunohost service add $app --description="Non-linear personal web notebook" --log="/var/log/$app/$app.log" +yunohost service add $app --description="A non-linear personal web notebook" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index c1b42d1..9fd049a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,6 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# CHECK VERSION +#================================================= + +upgrade_type=$(ynh_check_app_version_changed) + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -21,9 +27,14 @@ ynh_systemd_action --service_name=$app --action="stop" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." -ynh_setup_source --dest_dir="$install_dir" +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." + + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$install_dir" +fi chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -41,11 +52,13 @@ ynh_use_nodejs #================================================= ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=5 +# Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="Non-linear personal web notebook" --log="/var/log/$app/$app.log" +yunohost service add $app --description="A non-linear personal web notebook" #================================================= # START SYSTEMD SERVICE