[arch-commits] Commit in kresus/trunk (PKGBUILD config.ini kresus.service)

Bruno Pagani archange at archlinux.org
Sat Sep 26 14:13:05 UTC 2020


    Date: Saturday, September 26, 2020 @ 14:13:05
  Author: archange
Revision: 712460

upgpkg: kresus 0.16.0-1

Modified:
  kresus/trunk/PKGBUILD
  kresus/trunk/config.ini
  kresus/trunk/kresus.service

----------------+
 PKGBUILD       |   30 ++++++++++---
 config.ini     |  119 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 kresus.service |   19 ++++++--
 3 files changed, 148 insertions(+), 20 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-09-26 12:37:33 UTC (rev 712459)
+++ PKGBUILD	2020-09-26 14:13:05 UTC (rev 712460)
@@ -1,8 +1,8 @@
 # Maintainer: Bruno Pagani <archange at archlinux.org>
 
 pkgname=kresus
-pkgver=0.15.2
-pkgrel=2
+pkgver=0.16.0
+pkgrel=1
 pkgdesc="Self-hosted personal finance manager"
 arch=(x86_64)
 url="https://kresus.org"
@@ -16,22 +16,38 @@
         ${pkgname}.service
         ${pkgname}.sysusers
         ${pkgname}.tmpfiles)
-sha256sums=('420ed94313e3343f47d84095bd9adade166cc1e5d83f211d39cb2dd254bb63a6'
-            '63e105f26d46b9402519b314a2d43e4c3363dc990198eab68d0c816b8ce56b43'
-            '3d4b07c2c029be80597e84d9fbbf67c479c6231347b83cf429af4441ec5a491e'
+sha256sums=('cf1757f317f1cc3cb659af0a76ed5ff2e0b00b9af19e7e30bec6518466ab6e97'
+            '7f86ff72e3002c2906c45e762e073642b8405046f6af1dd049ad73860c7fd042'
+            'cbbfcfc7714fa4c714e956fffa203511c47dde67e06dee9d87f8ff44ac3c708b'
             'd9d30f5470c7165e4917487b69d7ab82e463da4e1355056e1035ee501d3f1adc'
             'ba8ad7d9eb5d2b47fde5f6a3ab98596e5c679141b78d76d54b44830604b67632')
 
+prepare() {
+    cd ${pkgname}-${pkgver}
+    yarn install
+}
+
 build() {
     cd ${pkgname}-${pkgver}
-    npm install && npm run build:prod
+    yarn run build:prod
 }
 
 package() {
     cd ${pkgname}-${pkgver}
 
-    make DESTDIR="${pkgdir}" install
+    DESTDIR="${pkgdir}" npm -g install kresus
 
+    # Remove useless stuff
+    rm -rf "${pkgdir}"/usr/lib/node_modules/kresus/node_modules/leveldown/prebuilds/{{android,linux}-arm{,64},{darwin,win32}-x64}
+    rm -r "${pkgdir}"/usr/lib/node_modules/kresus/support/
+    find "${pkgdir}"/usr/lib/node_modules/kresus/ -type d -name 'test*' -exec rm -rf {} \+
+    find "${pkgdir}"/usr/lib/node_modules/kresus/ -type f \( -name '*\.md' -o -name 'LICENSE*' -o -name '\.*' \) -delete
+
+    # Compile sqlite support
+    #DESTDIR="${pkgdir}" npm -g install sqlite3
+    #find "${pkgdir}"/usr/lib/node_modules/sqlite3/ -type d -name 'test*' -exec rm -rf {} \+
+    #find "${pkgdir}"/usr/lib/node_modules/sqlite3/ -type f \( -name '*\.md' -o -name 'LICENSE*' -o -name '\.*' \) -delete
+
     # Fix npm crazyness
     chmod -R go-w "${pkgdir}"/usr
     chown -R root:root "${pkgdir}"/usr

Modified: config.ini
===================================================================
--- config.ini	2020-09-26 12:37:33 UTC (rev 712459)
+++ config.ini	2020-09-26 14:13:05 UTC (rev 712460)
@@ -13,6 +13,16 @@
 ; datadir=/home/ben/.kresus
 datadir=/var/lib/kresus
 
+; A user id obtained from using the "kresus create-user" command.
+; This allows sharing a single database with several users. If your
+; instance is only planned to host a single user, you can keep it
+; disabled, and Kresus will know how to automatically generate a new
+; user.
+; Overriden by the KRESUS_USER_ID environment variable, if it's set.
+; Example:
+; userid=1
+userid=
+
 ; This is the port that Kresus will run on. It is recommended not
 ; to expose it on port 80 directly but to use a reverse-proxy
 ; configuration like Nginx, Caddy or Apache.
@@ -20,7 +30,7 @@
 ; Overriden by the PORT environment variable, if it's set.
 ; Example:
 ; port=9876
-port=9876
+port=
 
 ; The host on which the Kresus server will listen to.
 ; Can be removed; defaults to "127.0.0.1".
@@ -27,15 +37,14 @@
 ; Overriden by the HOST environment variable, if it's set.
 ; Example:
 ; host=127.0.0.1
-host=127.0.0.1
+host=
 
 ; The executable version of Python that is going to get used when
-; interacting with Python scripts. This can be python, python2 or
-; python3.
-; Can be removed; defaults to "python2".
+; interacting with Python scripts. This can be python or python3.
+; Can be removed; defaults to "python3".
 ; Overriden by the KRESUS_PYTHON_EXEC environment variable, if it's set.
 ; Example:
-; python_exec=python2
+; python_exec=python3
 python_exec=python
 
 ; The directory prefix in the URL, if Kresus is to be served from a
@@ -57,6 +66,26 @@
 ; salt=gj4J89fkjf4h29aDi0f{}fu4389sejk`9osk`
 salt=
 
+; Set this to true if you want to use this instance only in demo
+; mode, and to never allow users to link their personal accounts.
+; 
+; WARNING! Switching this on and off may trigger data loss. Note that it
+; is still possible to try Kresus in demo mode, even if this is not set
+; to true. Setting this to true will *force* demo mode, and prevent users
+; from leaving this mode.
+; Can be removed; defaults to "false".
+; Overriden by the KRESUS_FORCE_DEMO_MODE environment variable, if it's set.
+; Example:
+; force_demo_mode=true
+force_demo_mode=
+
+; If set to a string, will enable HTTP Basic Auth, by splitting the
+; string on a colon, i.e. "<username>:<passwd>"
+; Overriden by the KRESUS_AUTH environment variable, if it's set.
+; Example:
+; auth=foo:bar
+auth=
+
 [weboob]
 
 ; The directory in which Weboob core is stored. If empty, indicates
@@ -70,7 +99,7 @@
 ; Path to a file containing a valid Weboob's source list directory.
 ; If empty (the default), indicates that Kresus will generate its own
 ; source list file and will store it in
-; DATA_DIR/weboob-data/sources.list.
+; KRESUS_DIR/weboob-data/sources.list.
 ; Overriden by the KRESUS_WEBOOB_SOURCES_LIST environment variable, if it's set.
 ; Example:
 ; sources_list=/home/ben/code/weboob/sources.list
@@ -149,6 +178,17 @@
 ; reject_unauthorized_tls=true
 reject_unauthorized_tls=
 
+[notifications]
+
+; The baseurl from which apprise-api will be called for
+; notifications to be sent.
+; See https://github.com/caronc/apprise-api#installation for
+; installation
+; Overriden by the KRESUS_APPRISE_API_BASE_URL environment variable, if it's set.
+; Example:
+; appriseApiBaseUrl=http://localhost:8000/
+appriseApiBaseUrl=
+
 [logs]
 
 ; The path to the log file to use. If empty, defaults to kresus.log
@@ -157,3 +197,68 @@
 ; Example:
 ; log_file=/var/log/kresus.log
 log_file=
+
+[db]
+
+; Database type supported by Kresus, to choose among:
+; - postgres
+; - sqlite
+; 
+; It must be set by the user. PostgreSQL is recommended and strongly supported; your experience with other databases might vary.
+; 
+; Note using sqlite is *strongly discouraged* because it can't properly handle certain kinds of database migrations. It is only intended for development purposes.
+; Overriden by the KRESUS_DB_TYPE environment variable, if it's set.
+; Example:
+; type=sqlite
+type=
+
+; Logging level for the SQL queries. Possible values are:
+; 
+; - all: will log every SQL query, including queries causing errors.
+; - error (default value): will only log SQL queries resulting in errors. This is useful for debugging purposes.
+; - none: nothing will be logged.
+; Can be removed; defaults to "error".
+; Overriden by the KRESUS_DB_LOG environment variable, if it's set.
+; Example:
+; log=error
+log=
+
+; Path to the sqlite database file. Make sure that the user running
+; Kresus has the right permissions to write into this file. Required only for
+; sqlite.
+; Overriden by the KRESUS_DB_SQLITE_PATH environment variable, if it's set.
+; Example:
+; sqlite_path=/tmp/dev.sqlite
+sqlite_path=
+
+; Host address of the database server. Required for postgres.
+; Overriden by the KRESUS_DB_HOST environment variable, if it's set.
+; Example:
+; host=localhost
+host=
+
+; Port of the database server. Required for postgres.
+; Overriden by the KRESUS_DB_PORT environment variable, if it's set.
+; Example:
+; port=5432 # postgres
+port=
+
+; Username to connect to the database server. Required for postgres.
+; Overriden by the KRESUS_DB_USERNAME environment variable, if it's set.
+; Example:
+; username=benjamin
+username=
+
+; Password to connect to the database server. Required for postgres.
+; Overriden by the KRESUS_DB_PASSWORD environment variable, if it's set.
+; Example:
+; password=hunter2
+password=
+
+; Database name to use. Required for postgres.
+; Can be removed; defaults to "kresus".
+; Overriden by the KRESUS_DB_NAME environment variable, if it's set.
+; Example:
+; name=kresus
+name=
+

Modified: kresus.service
===================================================================
--- kresus.service	2020-09-26 12:37:33 UTC (rev 712459)
+++ kresus.service	2020-09-26 14:13:05 UTC (rev 712460)
@@ -3,9 +3,10 @@
 After=network.target
 
 [Service]
+Type=simple
 User=kresus
 Group=kresus
-Type=simple
+PermissionsStartOnly=true
 WorkingDirectory=~
 StateDirectory=kresus
 Environment=NODE_ENV=production
@@ -14,17 +15,23 @@
 CapabilityBoundingSet=
 NoNewPrivileges=true
 #SecureBits=noroot-locked
+ProtectSystem=strict
+ProtectHome=true
+PrivateTmp=true
+PrivateDevices=true
 PrivateUsers=true
-PrivateDevices=true
-PrivateTmp=true
-ProtectHome=true
-ProtectSystem=strict
-ProtectControlGroups=yes
+ProtectHostname=true
+ProtectClock=true
 ProtectKernelTunables=true
 ProtectKernelModules=yes
+ProtectKernelLogs=true
+ProtectControlGroups=yes
+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
 LockPersonality=true
+#Not compatible with NodeJS
 #MemoryDenyWriteExecute=true
 RestrictRealtime=true
+RestrictSUIDSGID=true
 SystemCallArchitectures=native
 SystemCallFilter=@system-service
 



More information about the arch-commits mailing list