gotosocial: vacuum the db after backing it up
Assisted-by: Claude Opus 4.8 via Claude Code
diff --git a/lotus-land-story/gotosocial.yml b/lotus-land-story/gotosocial.yml
index 11a65fb..7fb22bc 100644
--- a/lotus-land-story/gotosocial.yml
+++ b/lotus-land-story/gotosocial.yml
@@ -38,12 +38,23 @@
community.docker.docker_container:
name: gotosocial
state: stopped
+ # TODO swap to `sqlite3 .backup` — a plain copy can miss writes
+ # still in the -wal sidecar that a clean shutdown hasn't checkpointed.
- name: Backup db
ansible.builtin.copy:
src: /mnt/lotus-land-story/gotosocial/data/sqlite.db
dest: /mnt/lotus-land-story/gotosocial/sqlite.db.bak
mode: "0400"
remote_src: true
+ - name: Install sqlite3
+ ansible.builtin.apt:
+ pkg:
+ - sqlite3
+ state: present
+ - name: Vacuum db
+ ansible.builtin.command:
+ cmd: sqlite3 /mnt/lotus-land-story/gotosocial/data/sqlite.db 'VACUUM;'
+ changed_when: true
- name: Get docker network for trusted proxies
community.docker.docker_network:
@@ -70,10 +81,11 @@
GTS_OIDC_CLIENT_SECRET: "{{ gotosocial.oidc_client_secret }}"
GTS_OIDC_ADMIN_GROUPS: admin
GTS_METRICS_ENABLED: "true"
+ # GTS_ADVANCED_RATE_LIMIT_REQUESTS: "0"
+ GTS_STATUSES_CLEANUP_REMOTE_OLDER_THAN: 1 year
OTEL_METRICS_PRODUCERS: prometheus
OTEL_METRICS_EXPORTER: prometheus
OTEL_EXPORTER_PROMETHEUS_HOST: gotosocial
- # GTS_ADVANCED_RATE_LIMIT_REQUESTS: "0"
TZ: UTC
volumes:
- /mnt/lotus-land-story/gotosocial/data:/gotosocial/storage