From 2f34f06591a26d0a5a7481c25ea2541dffba24ba Mon Sep 17 00:00:00 2001 From: Patrick Cernko Date: Wed, 14 May 2025 14:37:17 +0200 Subject: [PATCH 1/2] support and instructions for manual install using systemd services (tested with Debian 12 only) --- docker/sidekiq-entrypoint.sh | 0 docker/web-entrypoint.sh | 0 systemd/README.md | 113 +++++++++++++++++++++++++++++++ systemd/dawarich-sidekiq.service | 14 ++++ systemd/dawarich.service | 14 ++++ systemd/environment | 34 ++++++++++ systemd/install.sh | 44 ++++++++++++ 7 files changed, 219 insertions(+) mode change 100644 => 100755 docker/sidekiq-entrypoint.sh mode change 100644 => 100755 docker/web-entrypoint.sh create mode 100644 systemd/README.md create mode 100644 systemd/dawarich-sidekiq.service create mode 100644 systemd/dawarich.service create mode 100644 systemd/environment create mode 100644 systemd/install.sh diff --git a/docker/sidekiq-entrypoint.sh b/docker/sidekiq-entrypoint.sh old mode 100644 new mode 100755 diff --git a/docker/web-entrypoint.sh b/docker/web-entrypoint.sh old mode 100644 new mode 100755 diff --git a/systemd/README.md b/systemd/README.md new file mode 100644 index 00000000..aafece8b --- /dev/null +++ b/systemd/README.md @@ -0,0 +1,113 @@ +# Installing dawarich with systemd + +This guide is based on my experience setting up dawarich on Debian 12. + +## Prerequisites + +### Postgresql + +You need a recent version of [Postgresql](https://www.postgresql.org/) +with [PostGIS](https://postgis.net/) support. + +In Debian you can install it with +```sh +apt install postgresql-postgis +``` + +If you do not want to run the database on the same host as the +dawarich service, you need to reconfigure Postgresql to allow +connections from that host. + +Dawarich will populate it's database itself and only needs a user +account to do so. This account needs to have superuser capabilities as +the database population includes enabling the postgis extention: +```sh +sudo -u postgres psql <&2 + exit 1 +fi + +# make shellcheck happy (vars are defined in while loop below) +BUNDLE_VERSION='' +GEM_HOME='' +# "source" "$dirname"/environment and EXPORT all vars +# export all vars from env +envfile="$dirname"/environment +while IFS='#' read -r line; do + if [[ "$line" =~ ^([A-Z0-9_]+)=\"?(.*)\"?$ ]]; then + k=${BASH_REMATCH[1]} + v=${BASH_REMATCH[2]} + export "$k"="$v" + fi +done < "$envfile" + +if [ "$APP_PATH" != "$PWD" ]; then + echo "Error: APP_PATH (defined in $envfile) != $PWD!" >&2 + exit 1 +fi + +set -x + +# from docker/Dockerfile.dev + +# Update gem system and install bundler +gem update --system 3.6.2 +gem install bundler --version "$BUNDLE_VERSION" +rm -rf "$GEM_HOME"/cache/* + +# Install all gems into the image +bundle config set --local path 'vendor/bundle' +bundle install --jobs 4 --retry 3 +rm -rf vendor/bundle/ruby/3.4.1/cache/*.gem + +exit 0 From 0394b31630a88231d8a8cfea527e4c6ba9b4d189 Mon Sep 17 00:00:00 2001 From: Patrick Cernko Date: Mon, 14 Jul 2025 05:36:57 +0200 Subject: [PATCH 2/2] fixed created postgresql username thanks to @sshaikh for reporting --- systemd/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systemd/README.md b/systemd/README.md index aafece8b..4a93bae2 100644 --- a/systemd/README.md +++ b/systemd/README.md @@ -23,8 +23,8 @@ account to do so. This account needs to have superuser capabilities as the database population includes enabling the postgis extention: ```sh sudo -u postgres psql <