Skip to content

Commit

Permalink
Merge pull request #3 from geniusdynamics/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
compgeniuses authored Jul 30, 2024
2 parents dc5f7c4 + 18c1635 commit b816be5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
6 changes: 2 additions & 4 deletions imageroot/actions/restore-module/40restore_database
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exec 1>&2 # Redirect any output to the journal (stderr)
mkdir -vp restore
cat - >restore/docmost_restore.sh <<'EOS'
# Read dump file from standard input:
pg_restore --no-owner --no-privileges -U postgres -d docmost
pg_restore --no-owner --no-privileges -U docmost -d docmost
ec=$?
docker_temp_server_stop
exit $ec
Expand All @@ -27,9 +27,7 @@ podman run \
--volume=./restore:/docker-entrypoint-initdb.d/:Z \
--volume=postgres-data:/var/lib/postgresql/data:Z \
--replace --name=restore_db \
--env POSTGRES_USER=postgres \
--env POSTGRES_PASSWORD=Nethesis,1234 \
--env POSTGRES_DB=docmost \
--env-file database.env \
--env TZ=UTC \
"${POSTGRES_IMAGE}" < docmost.pg_dump

Expand Down
17 changes: 17 additions & 0 deletions imageroot/actions/restore-module/80start_services
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

#
# Copyright (C) 2023 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#
set -e

# Redirect any output to the journal (stderr)
exec 1>&2

# If the control reaches this step, the service can be enabled and started

touch smarthost.env

systemctl --user enable docmost.service
systemctl --user restart docmost.service
3 changes: 3 additions & 0 deletions imageroot/etc/state-include.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@


state/docmost.sql
state/database.env
state/app.env
state/smtp-config.env
volumes/docmost-app

2 changes: 1 addition & 1 deletion imageroot/systemd/user/docmost-app.service
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ExecStartPre=-runagent discover-smarthost
ExecStart=/usr/bin/podman run --conmon-pidfile %t/docmost-app.pid \
--cidfile %t/docmost-app.ctr-id --cgroups=no-conmon \
--pod-id-file %t/docmost.pod-id --replace -d --name docmost-app \
--volume docmost:/app/data/storage:Z \
--volume docmost-app:/app/data/storage:Z \
--env-file=%S/state/app.env \
--env-file=%S/state/smtp-config.env \
--env APP_URL=${APP_URL} \
Expand Down

0 comments on commit b816be5

Please sign in to comment.