From 2b33dbc4af7d2a63a85f598af2d60b9f72da99df Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Tue, 16 Jun 2020 00:06:45 +0200 Subject: [PATCH] fix: db location and directory permission --- controller-testing/PKGBUILD | 9 +++++---- controller-testing/controller.ini | 2 +- core-testing/PKGBUILD | 7 ++++--- core-testing/core.ini | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/controller-testing/PKGBUILD b/controller-testing/PKGBUILD index e28a464..cd83147 100644 --- a/controller-testing/PKGBUILD +++ b/controller-testing/PKGBUILD @@ -18,7 +18,7 @@ source=("$pkgname-$pkgver.tar.gz::https://ci.serguzim.me/archive/emgauwa-control "emgauwa-controller-testing.sysusers" "emgauwa-controller-testing.tmpfiles") sha256sums=("SKIP" - "8175d418a57c6fedfaaf9c622b1c714576dc117e920a3426ffe1095d3d87f597" + "7d9d0d23190660d91045e11ccb281ffedab65d76f1f3b0fc63eae105732bd2e5" "0bbc44d680be2011800c553ae863663148be0820f08349993578c88e9a23b143" "b9cde58b9e9b0605ca4a1eddd78067c55aa3c8d40f80cde0a25c4da9f6f95798" "5a4ce46c1302546509c0024d4614b5b0d47dde02467b7bf52b28ef6c4ead91e7") @@ -30,17 +30,18 @@ prepare() { build() { cd "$pkgname/build" || exit 1 - cmake .. + cmake -DWIRING_PI_DEBUG=ON .. make } package() { install -Dm755 "${pkgname}/build/controller" "${pkgdir}/usr/bin/emgauwa-controller" - install -Dm644 "controller.ini" "${pkgdir}/etc/emgauwa/controller.ini" + install -Dm660 "controller.ini" "${pkgdir}/etc/emgauwa/controller.ini" install -Dm644 "${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service" install -Dm644 "${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf" install -Dm644 "${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf" - install -Ddm644 "${pkgdir}/var/lib/emgauwa/controller" + install -Ddm750 "${pkgdir}/var/lib/emgauwa" + install -Ddm750 "${pkgdir}/var/lib/emgauwa/controller" } diff --git a/controller-testing/controller.ini b/controller-testing/controller.ini index 854acd5..660b473 100644 --- a/controller-testing/controller.ini +++ b/controller-testing/controller.ini @@ -3,7 +3,7 @@ name = new emgauwa device : 4421 for dev-env; 4420 for testing-env; 4419 for prod-env; 4422 for testing discovery-port = 4420 relay-count = 10 -database = /var/lib/emgauwa/db.lmdb +database = /var/lib/emgauwa/controller/db.lmdb log-level = debug [relay-0] diff --git a/core-testing/PKGBUILD b/core-testing/PKGBUILD index b0602c6..7bbcea7 100644 --- a/core-testing/PKGBUILD +++ b/core-testing/PKGBUILD @@ -18,7 +18,7 @@ source=("$pkgname-$pkgver.tar.gz::https://ci.serguzim.me/archive/emgauwa-core-te "emgauwa-core-testing.sysusers" "emgauwa-core-testing.tmpfiles") sha256sums=("SKIP" - "e6089a8730c1a24b8c3c78082e9ffa96551cfc712eb1a8da7c544b8899eee14d" + "aa9c9355caaa75d6e8eb27290df9242a8def15abd2616c598f02ecef01494d76" "c781f4d50da8e158551a47a8549981dad05faaf2d632c4fde8b36b48474ab0ec" "b9cde58b9e9b0605ca4a1eddd78067c55aa3c8d40f80cde0a25c4da9f6f95798" "0531f10303410afd7e53099e66b124ef2fd14afec9d33c4a0146793375acb6c2") @@ -37,10 +37,11 @@ build() { package() { install -Dm755 "${pkgname}/build/core" "${pkgdir}/usr/bin/emgauwa-core" - install -Dm644 "core.ini" "${pkgdir}/etc/emgauwa/core.ini" + install -Dm600 "core.ini" "${pkgdir}/etc/emgauwa/core.ini" install -Dm644 "${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service" install -Dm644 "${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf" install -Dm644 "${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf" - install -Ddm644 "${pkgdir}/var/lib/emgauwa/core" + install -Ddm750 "${pkgdir}/var/lib/emgauwa" + install -Ddm750 "${pkgdir}/var/lib/emgauwa/core" } diff --git a/core-testing/core.ini b/core-testing/core.ini index 2bbcd4c..13a485a 100644 --- a/core-testing/core.ini +++ b/core-testing/core.ini @@ -1,6 +1,6 @@ [core] server-port = 80 -database = /var/lib/emgauwa/db.sqlite +database = /var/lib/emgauwa/core/db.sqlite not-found-file = 404.html not-found-file-mime = text/html not-found-content = 404 - NOT FOUND