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 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/conf/systemd.service b/conf/systemd.service index 6c9e02d..a27f238 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,10 +7,10 @@ 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 +ExecStart=__YNH_NODE__ bin/wwww Restart=always [Install] diff --git a/manifest.json b/manifest.json index 63f3da9..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", @@ -21,7 +20,7 @@ "email": "ju@paraiso.me" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ @@ -31,8 +30,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "is_public", 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 348f87f..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 - ynh_exec_warn_less NODE_ENV=production npm install -g npm + ynh_exec_warn_less $ynh_npm install popd #================================================= @@ -153,7 +166,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 #================================================= 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) #================================================= 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