Skip to content

Commit

Permalink
feat: added restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
kemboi22 committed Jul 27, 2024
1 parent b028fa9 commit 0bd2a86
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def generate_random_password(length):

# DB Config
POSTGRES_DB = data.get("POSTGRES_DB","formbricks")
POSTGRES_USER = data.get("POSTGRES_USER","formbricks")
POSTGRES_USER = data.get("POSTGRES_USER","postgres")
POSTGRES_PASSWORD = generate_random_password(16)

db_config = {
Expand Down
4 changes: 1 addition & 3 deletions imageroot/actions/restore-module/40restore_database
Original file line number Diff line number Diff line change
Expand Up @@ -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=formbricks \
--env-file=database.env \
--env TZ=UTC \
"${POSTGRES_IMAGE}" < formbricks.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 formbricks.service
systemctl --user restart formbricks.service

0 comments on commit 0bd2a86

Please sign in to comment.