From 692696225a0e1dc950b7e9271c7f3a847484760b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Nov 2021 22:25:50 +0100 Subject: [PATCH 1/8] Fix --- conf/app.src | 5 ++--- conf/nginx.conf | 4 ---- manifest.json | 5 ++--- scripts/install | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/conf/app.src b/conf/app.src index 2b3a701..41c9e20 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,5 @@ -SOURCE_URL=https://github.com/timeoff-management/timeoff-management-application/archive/refs/tags/1.3.3.tar.gz -SOURCE_SUM=e320350dbf1d1ce272cee1db845e3658945d57e49eb97a56df3d00cf63ab6fe6 +SOURCE_URL=https://github.com/timeoff-management/timeoff-management-application/archive/refs/tags/1.4.0.tar.gz +SOURCE_SUM=2831826b689cf1f4bc7e7ae03ac42c4c846a56a8c3e1368f3a1326f46977cdcc SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/nginx.conf b/conf/nginx.conf index 9b08268..a927d57 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,8 +1,4 @@ location __PATH__/ { - - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } proxy_pass http://127.0.0.1:__PORT__/; proxy_set_header Host $host; diff --git a/manifest.json b/manifest.json index 63f3da9..a78ceef 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "ju@paraiso.me" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ @@ -31,8 +31,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "is_public", diff --git a/scripts/install b/scripts/install index 348f87f..df9bf0e 100644 --- a/scripts/install +++ b/scripts/install @@ -136,7 +136,7 @@ ynh_script_progression --message="Installing TimeOff..." pushd $final_path ynh_use_nodejs - ynh_exec_warn_less NODE_ENV=production npm install -g npm + ynh_exec_as $app env $ynh_node_load_PATH npm install -g npm popd #================================================= @@ -153,7 +153,7 @@ ynh_add_config --template="../conf/db.json" --destination="$final_path/config/db ynh_script_progression --message="Configuring a systemd service..." ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" -ynh_replace_string --match_string="__YNH_NODE__" --replace_string="$ynh_node" --target_file="../conf/systemd.service" + ynh_add_systemd_config #================================================= From 9fe691518fd9ce6c6b45872df3c3b79e3fa18580 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Nov 2021 22:27:13 +0100 Subject: [PATCH 2/8] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 6c9e02d..586e2cd 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ #Environment="PORT=__PORT__" -#Environment="PATH=__ENV_PATH__" +Environment="PATH=__ENV_PATH__" Environment="NODE_ENV=production" WorkingDirectory=__FINALPATH__/ ExecStart=__YNH_NODE__ bin/wwww From 2165c595899468a928ec1079352b91283c58d549 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Nov 2021 22:32:16 +0100 Subject: [PATCH 3/8] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index df9bf0e..4e72033 100644 --- a/scripts/install +++ b/scripts/install @@ -136,7 +136,7 @@ ynh_script_progression --message="Installing TimeOff..." pushd $final_path ynh_use_nodejs - ynh_exec_as $app env $ynh_node_load_PATH npm install -g npm + ynh_exec_as npm install -g npm popd #================================================= From 04e32ae4c736ed7a24d8fe15aec66d02aadaeb22 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Nov 2021 22:33:44 +0100 Subject: [PATCH 4/8] Fix --- scripts/_common.sh | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b56a3be..acb6dce 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # nodejs version -nodejs_version=14 +nodejs_version=16 # dependencies used by the app pkg_dependencies="sqlite3" diff --git a/scripts/install b/scripts/install index 4e72033..4854367 100644 --- a/scripts/install +++ b/scripts/install @@ -136,7 +136,7 @@ ynh_script_progression --message="Installing TimeOff..." pushd $final_path ynh_use_nodejs - ynh_exec_as npm install -g npm + npm install -g npm popd #================================================= From 0789839034253e49277c0c68dd8e1a2701770a78 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Nov 2021 22:38:12 +0100 Subject: [PATCH 5/8] Update remove --- scripts/remove | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index a039909..0402dd3 100755 --- a/scripts/remove +++ b/scripts/remove @@ -18,8 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= From 5059829c8b54e7c88677b67424c1b7942cc5e6b8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 29 Nov 2021 21:59:50 +0100 Subject: [PATCH 6/8] fix --- conf/systemd.service | 2 +- manifest.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 586e2cd..a27f238 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,7 +10,7 @@ Group=__APP__ Environment="PATH=__ENV_PATH__" Environment="NODE_ENV=production" WorkingDirectory=__FINALPATH__/ -ExecStart=__YNH_NODE__ bin/wwww +ExecStart=__YNH_NODE__ bin/wwww Restart=always [Install] diff --git a/manifest.json b/manifest.json index a78ceef..03e84ba 100644 --- a/manifest.json +++ b/manifest.json @@ -12,7 +12,6 @@ "website": "https://timeoff.management/", "demo": "https://demo.example.com", "admindoc": "https://timeoff.management/support/main-page.html", - "userdoc": "https://yunohost.org/apps", "code": "https://github.com/timeoff-management/timeoff-management-application" }, "license": "MIT", From 838b5d8563ad41230334bcd23e277ab3c263629f Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 29 Nov 2021 20:59:58 +0000 Subject: [PATCH 7/8] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index 9fabf99..7bed539 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ Web application for managing employee absences ## Documentation and resources * Official app website: https://timeoff.management/ -* Official user documentation: https://yunohost.org/apps * Official admin documentation: https://timeoff.management/support/main-page.html * Upstream app code repository: https://github.com/timeoff-management/timeoff-management-application * YunoHost documentation for this app: https://yunohost.org/app_timeoff diff --git a/README_fr.md b/README_fr.md index 49bfea3..de972ad 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,7 +24,6 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Documentations et ressources * Site officiel de l'app : https://timeoff.management/ -* Documentation officielle utilisateur : https://yunohost.org/apps * Documentation officielle de l'admin : https://timeoff.management/support/main-page.html * Dépôt de code officiel de l'app : https://github.com/timeoff-management/timeoff-management-application * Documentation YunoHost pour cette app : https://yunohost.org/app_timeoff From d10eae0f4ae5f5ba73f9cb1feb960d1ebaaf15a9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 29 Nov 2021 22:05:09 +0100 Subject: [PATCH 8/8] Fix --- scripts/install | 17 +++++++++++++++-- scripts/restore | 3 +-- scripts/upgrade | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 4854367..4214831 100644 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,6 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Validating installation parameters..." final_path=/var/www/$app -config_path=/home/yunohost.app/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path @@ -105,6 +104,20 @@ chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" #chmod -R +x "$final_path/bin" +#================================================= +# CREATE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Creating a data directory..." --weight=1 + +datadir=/home/yunohost.app/$app +ynh_app_setting_set --app=$app --key=datadir --value=$datadir + +mkdir -p $datadir + +chmod 750 "$datadir" +chmod -R o-rwx "$datadir" +chown -R $app:www-data "$datadir" + #================================================= # NGINX CONFIGURATION #================================================= @@ -136,7 +149,7 @@ ynh_script_progression --message="Installing TimeOff..." pushd $final_path ynh_use_nodejs - npm install -g npm + ynh_exec_warn_less $ynh_npm install popd #================================================= diff --git a/scripts/restore b/scripts/restore index 936e5b0..d137a15 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,8 +34,7 @@ db_user=$db_name #================================================= ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index 95b4f54..668fc5c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -113,8 +113,8 @@ then ynh_script_progression --message="Upgrading the lounge..." pushd $final_path ynh_use_nodejs - ynh_exec_warn_less NODE_ENV=production npm cache clean - ynh_exec_warn_less NODE_ENV=production npm update + ynh_exec_warn_less $ynh_npm cache clean + ynh_exec_warn_less $ynh_npm update popd fi