Skip to content

Commit

Permalink
nixos/onlyoffice: don't drop database on start
Browse files Browse the repository at this point in the history
If nextcloud is down, or the changes can otherwise not be saved back
to nextcloud (e.g. because of [1]), the onlyoffice database contains
_all the user data_ and should absolutely not be dropped on startup!

[1]: ONLYOFFICE/onlyoffice-nextcloud#931
  • Loading branch information
lheckemann committed Jul 4, 2024
1 parent 20cada2 commit 92bc824
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions nixos/modules/services/web-apps/onlyoffice.nix
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,7 @@ in
${jsonFormat.generate "onlyoffice-nixos.json" cfg.settings} > /run/onlyoffice/config/nixos.json
jq '. * $nixos[0]' /run/onlyoffice/config/default.json.orig --slurpfile nixos /run/onlyoffice/config/nixos.json > /run/onlyoffice/config/default.json
if psql -d onlyoffice -c "SELECT 'task_result'::regclass;" >/dev/null; then
psql -f ${cfg.package}/var/www/onlyoffice/documentserver/server/schema/postgresql/removetbl.sql
psql -f ${cfg.package}/var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
else
psql -f ${cfg.package}/var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
fi
psql -f ${cfg.package}/var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
'';
in
{
Expand Down

0 comments on commit 92bc824

Please sign in to comment.