From 149ae3cfa9dd59eebab24e7909336ff59bc02ee0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Wed, 1 Aug 2018 06:25:29 +0200 Subject: [PATCH 1/7] Don't rebuild package and fix weboob detection --- conf/config.ini | 2 +- scripts/install | 5 ++--- scripts/upgrade | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/conf/config.ini b/conf/config.ini index 9700243..dfe2402 100644 --- a/conf/config.ini +++ b/conf/config.ini @@ -48,7 +48,7 @@ python_exec= ; Overridden by the KRESUS_WEBOOB_DIR environment variable, if it's set. ; Example: ; srcdir=/home/ben/code/weboob -srcdir=__FINALPATH__/venv/bin/ +srcdir=__FINALPATH__/venv/lib/python2.7/site-packages/ ; Path to a file containing a valid Weboob's source list directory. ; Can be removed; defaults to "", indicating that Kresus will generate its own diff --git a/scripts/install b/scripts/install index efd888f..2043f3b 100644 --- a/scripts/install +++ b/scripts/install @@ -103,7 +103,7 @@ virtualenv "${final_path}/venv" set -o nounset pip install --upgrade pip - pip install weboob + pip install weboob html2text simplejson BeautifulSoup PyExecJS ) #================================================= @@ -114,8 +114,7 @@ ynh_use_nodejs ( cd "$final_path" chown -R $app: "$final_path" - npm install --unsafe-perm - npm run build:prod + npm install --production --unsafe-perm ) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 397d7a2..912d039 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -113,7 +113,7 @@ virtualenv "${final_path}/venv" set -o nounset pip install --upgrade pip - pip install weboob + pip install weboob html2text simplejson BeautifulSoup PyExecJS ) #================================================= @@ -124,8 +124,7 @@ ynh_use_nodejs ( cd "$final_path" chown -R $app: "$final_path" - npm install --unsafe-perm - npm run build:prod + npm install --production --unsafe-perm ) #================================================= From f47765f1620fa1d5057af4641a9aa4c85880a096 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Wed, 1 Aug 2018 06:31:27 +0200 Subject: [PATCH 2/7] Fix warning --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 912d039..5c93105 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,7 @@ if [ -z $final_path ]; then ynh_app_setting_set $app final_path $final_path fi -if [ -z "/home/ynh$app"]; then +if [ -z "/home/ynh$app" ]; then mv "/home/ynh$app/data" "$final_path/data" ynh_secure_remove "/home/ynh$app" fi From 9fee1c1156284a240160f55e4ef150e248d593b5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Wed, 1 Aug 2018 06:40:03 +0200 Subject: [PATCH 3/7] Fix nginx alias traversal issue --- conf/nginx.conf | 3 ++- scripts/install | 6 ++++++ scripts/upgrade | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 521a8f2..d3ae0b8 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ -location __PATH__ { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { proxy_pass http://127.0.0.1:__PORT__; proxy_set_header Host $host; proxy_redirect off; diff --git a/scripts/install b/scripts/install index 2043f3b..204de79 100644 --- a/scripts/install +++ b/scripts/install @@ -76,6 +76,12 @@ mkdir "$final_path/data" # Create a dedicated nginx config ynh_add_nginx_config +if [ "$path_url" != "/" ] +then + ynh_replace_string "^#sub_path_only" "" "/etc/nginx/conf.d/$domain.d/$app.conf" +fi +ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # CREATE DEDICATED USER #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5c93105..bc1f861 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,6 +84,11 @@ mkdir -p "$final_path/data" # Create a dedicated nginx config ynh_add_nginx_config +if [ "$path_url" != "/" ] +then + ynh_replace_string "^#sub_path_only" "" "/etc/nginx/conf.d/$domain.d/$app.conf" +fi +ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # CREATE DEDICATED USER From c6fd143452a0a75b31d2dc57617949986a1c05d4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Thu, 2 Aug 2018 07:59:52 +0200 Subject: [PATCH 4/7] Improve readme and hange maintainer --- README.md | 32 +++++++++++++++++++++++--------- manifest.json | 8 ++++---- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 90f4d80..79e82eb 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,28 @@ -WARNING: this package has not been tested. Use it at your own risks, for testing purposes and not on a daily used server. - - # Kresus for YunoHost Kresus is an open-source libre self-hosted personal finance manager. It allows you to safely track your banking history, check your overall balance and know exactly on what you are spending money with the use of tags! -It has started as a fork of cozy-pfm but is way different now. -It was continued following this https://framagit.org/bnjbvr/kresus/issues/515 +**Shipped version:** 0.13.2 -**More information on the documentation page:** -https://framagit.org/bnjbvr/kresus -https://kresus.org -https://yunohost.org/ +# State of this package + +* works fine: + + * [x] install/remove/backup/remove/upgrade with x86_64 + +* to be confirmed + * [x] ARM support + +* to be added: + * [ ] Email support + * [ ] Restrict more file access ($app is owner of everything, we should limit it more) + * [ ] Add user who will access the app (by default every one has access to the installed app) + * [ ] Email admin about installation with ynh_send_readme_to_admin helper + +## Links + + * Report a bug about this package: https://github.com/YunoHost-Apps/kresus_ynh + * Report a bug about Kresus itself: https://framagit.org/bnjbvr/kresus + * Documentation: https://docs.funkwhale.audio + * Kresus website: https://kresus.org + * YunoHost website: https://yunohost.org/ diff --git a/manifest.json b/manifest.json index 1771056..06db9f8 100644 --- a/manifest.json +++ b/manifest.json @@ -9,13 +9,13 @@ "url": "https://framagit.org/bnjbvr/kresus", "license": "AGPL-3.0-only", "maintainer": { - "name": "Scith", - "url": "https://github.com/scith" + "name": "Jean-Baptiste Holcroft", + "email": "jean-baptiste@holcroft.fr" }, "requirements": { - "yunohost": ">= 2.7.10" + "yunohost": ">= 2.7.14" }, - "version": "0.13.2-2", + "version": "0.13.2~ynh2", "multi_instance": true, "services": [ "nginx" From f28d375abf4aa040947b0d37d16cae4d17b34b3c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Fri, 3 Aug 2018 22:02:30 +0200 Subject: [PATCH 5/7] Remove previous commit upgrade, there is no commit in community.json --- check_process | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/check_process b/check_process index fea2e73..283091a 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,6 @@ setup_private=1 setup_public=0 upgrade=1 - upgrade=1 from_commit=c1345759860b9886b51a406366d1fcc090f05012 backup_restore=1 multi_instance=1 incorrect_path=1 @@ -36,8 +35,4 @@ Level 10=0 ;;; Options Email=jean-baptiste@holcroft.fr -Notification=all -;;; Upgrade options - ; commit=c1345759860b9886b51a406366d1fcc090f05012 - name=Upgrade from old package version -manifest_arg=domain=DOMAIN&path=PATH +Notification=all \ No newline at end of file From f653d8b36c93acf9cdc7a77aea9ef2855b0a6819 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Fri, 3 Aug 2018 23:33:28 +0200 Subject: [PATCH 6/7] Improve venv support --- conf/config.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/config.ini b/conf/config.ini index dfe2402..85595f3 100644 --- a/conf/config.ini +++ b/conf/config.ini @@ -39,7 +39,7 @@ url_prefix=__PATH__ ; Overridden by the KRESUS_PYTHON_EXEC environment variable, if it's set. ; Example: ; python_exec=python3 -python_exec= +python_exec=__FINALPATH__/venv/bin/python [weboob] ; The directory in which Weboob core is stored. @@ -48,7 +48,7 @@ python_exec= ; Overridden by the KRESUS_WEBOOB_DIR environment variable, if it's set. ; Example: ; srcdir=/home/ben/code/weboob -srcdir=__FINALPATH__/venv/lib/python2.7/site-packages/ +srcdir= ; Path to a file containing a valid Weboob's source list directory. ; Can be removed; defaults to "", indicating that Kresus will generate its own From a4b3d0010d311d7b58f24ba04f02fed42dc50d4b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Fri, 3 Aug 2018 23:33:51 +0200 Subject: [PATCH 7/7] change URL --- README.md | 3 +-- manifest.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 79e82eb..d44239c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ Kresus is an open-source libre self-hosted personal finance manager. It allows y ## Links * Report a bug about this package: https://github.com/YunoHost-Apps/kresus_ynh - * Report a bug about Kresus itself: https://framagit.org/bnjbvr/kresus - * Documentation: https://docs.funkwhale.audio + * Report a bug about Kresus itself: https://framagit.org/kresusapp/kresus * Kresus website: https://kresus.org * YunoHost website: https://yunohost.org/ diff --git a/manifest.json b/manifest.json index 06db9f8..8944e6c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Kresus is a personal finance manager.", "fr": "Kresus est un outil personnel de gestion de finances." }, - "url": "https://framagit.org/bnjbvr/kresus", + "url": "https://framagit.org/kresusapp/kresus", "license": "AGPL-3.0-only", "maintainer": { "name": "Jean-Baptiste Holcroft",