Commit Graph

12 Commits (d2b3b1f7b3caeaac092c111e44ba1877aa629021)

Author SHA1 Message Date
Dustin 87e8ec2ed4 synapse: Back up data using BURP
Most of the Synapse server's state is in its SQLite database.  It also
has a `media_store` directory that needs to be backed up, though.

In order to back up the SQLite database while the server is running, the
database must be in "WAL mode."  By default, Synapse leaves the database
in the default "rollback journal mode," which disallows multiple
processes from accessing the database, even for read-only operations.
To change the journal mode:

```sh
sudo systemctl stop synapse
sudo -u synapse sqlite3 /var/lib/synapse/homeserver.db 'PRAGMA journal_mode=WAL;'
sudo systemctl start synapse
```
2023-05-23 09:52:50 -05:00
Dustin 74243080bb r/burp-client: Support pre/post-restore scripts
BURP can run scripts before and after restore.  This may be useful, for
example, to clean up files in a backup that may be in an inconsistent
state.
2023-05-23 09:52:50 -05:00
Dustin 66d0a9157f burp-client: Switch from cron to systemd timer
systemd timer units are supported on all relevant OS versions now.
There is no longer any reason to use cron.
2023-05-23 09:51:07 -05:00
Dustin 5efbee725e home-assistant: Omit history DB from backups
The state history database is entirely too big.  It takes over an hour
to create a backup of it, which usually causes BURP to time out.  The
data it stores isn't particularly interesting anyway.  Instead of trying
to back it up and ultimately not getting any backup at all, we'll just
skip it altogether to ensure we have a consistent backup of everything
else that is actually important.
2022-01-02 12:07:12 -06:00
Dustin 739ffb2845 home-assistant: Configure BURP backups
Take a snapshot of the history database first, then back up everything
in `/var/lib/homeassistant`.
2021-12-17 20:57:38 -06:00
Dustin fdfdaa6fe6 bitwarden_rs: Update burp backup path
Vaultwarden data are stored in a different location since the migration
to Podman.
2021-12-17 20:33:31 -06:00
Dustin 80b267d6e5 r/burp: Enable progress counter for ad-hoc runs
Before the `burp` tool gained the `-Q` option, the only way to disable
the progress counter was through the configuration file.  Since we do
not want any output from automatic backups (except of course
catastrophic failures), since it would end up being e-mailed by cron,
the progress counter had to be disabled globally.  This meant that
on-demand runs on a terminal could not have a progress counter, which
was pretty disappointing.

Now that `burp` has `-Q`, this is no longer the case.  Scheduled backups
can run with `-Q`, but ad-hoc runs can omit it to get a progress
counter.
2021-12-17 20:19:30 -06:00
Dustin 87843e5926 burp-client: Use burp.p.b name
Using the generic *burp.pyrocufflink.blue* name will allow easier
transition to a new BURP server.  However, since this is not the actual
name, it cannot be used for task delegation, so a separate variable is
required to store the real name of the BURP server.  This is only used
during client deployment, and not by BURP itself.
2020-01-18 12:10:53 -06:00
Dustin 6e57abfe2e bitwarden_rs: Configure BURP client
This commit configures *bw0.pyrocufflink.blue* as a BURP client, so that
the Bitwarden data can be backed up.  A pre-backup script is used to
take a consistent snapshot of the SQLite database before copying it to
the BURP server.
2019-09-19 19:27:30 -05:00
Dustin e8ca37fa7c roles/burp-client: Set clientconfdir file owner
The BURP server runs as user *burp*, and nas such, requires that the
client-specific configuration files be owned by that user so they can be
read when a client connects.
2019-09-19 19:27:30 -05:00
Dustin 799d24f4b9 roles/burp-client: Update burp.conf for newer BURP
Newer versions of the BURP client require `status_port` to be set.  This
commit updates the `burp.conf.j2` template to more closely match the
default configuration shipped with the *burp* package, including setting
this new value.
2019-09-19 19:27:30 -05:00
Dustin b7fafa6734 roles/burp-client: Deploy BURP client
The *burp-client* role installs and configures a BURP client. It should
support RHEL/CentOS/Fedora and Gentoo.

To manage the client password and other server-mandated configuration,
the role uses Ansible's delegation feature to generate a configuration
file in the "clientconfdir" on the BURP server.

An hourly cron task is scheduled that runs `burp -a t` every hour. This
allows the server to configure backup timebands and intervals.
2018-08-08 20:11:46 -05:00