Add PostgreSQL and Miniflux services to tailnet (#16)
## Summary
- Add PostgreSQL 18 as a new service at `pg.tail8d86e.ts.net:5432`
- Add Miniflux RSS/Atom feed reader at `feed.tail8d86e.ts.net`
- Both services managed via homebrew/brew services
- Pulumi ACL tags added (tag:pg, tag:feed)
- Alloy log collection configured for both services
- Zettelkasten documentation updated
## Manual Setup Required
Before running ansible, the following steps are needed on indri:
### 1. Apply Pulumi tags
```bash
mise run tailnet-up
```
Then apply tags to indri in Tailscale admin console.
### 2. Create 1Password entries
- miniflux PostgreSQL user password
- miniflux admin password (for first run)
### 3. Set PostgreSQL user password (after ansible installs postgres)
```bash
ssh indri '/opt/homebrew/opt/postgresql@18/bin/psql -c "ALTER USER miniflux PASSWORD '\''your-password'\'';"'
```
### 4. Create password files on indri
```bash
ssh indri 'echo "your-db-password" > ~/.miniflux-db-password && chmod 600 ~/.miniflux-db-password'
ssh indri 'echo "your-admin-password" > ~/.miniflux-admin-password && chmod 600 ~/.miniflux-admin-password'
```
### 5. Create ~/.pgpass for borgmatic
```bash
ssh indri 'echo "localhost:5432:miniflux:miniflux:YOUR_PASSWORD" > ~/.pgpass && chmod 600 ~/.pgpass'
```
### 6. Run ansible with first-run admin creation
```bash
mise run provision-indri -- -e miniflux_create_admin=1
```
### 7. Update borgmatic config
Add to `~/.config/borgmatic/config.yaml` on indri:
```yaml
postgresql_databases:
- name: miniflux
hostname: localhost
port: 5432
username: miniflux
```
### 8. Cleanup after first run
```bash
ssh indri 'rm ~/.miniflux-admin-password'
```
## Test plan
- [ ] Run `mise run tailnet-up` and verify Pulumi changes
- [ ] Apply tags to indri in Tailscale admin
- [ ] Run `mise run provision-indri -- --check --diff` for dry run
- [ ] Run `mise run provision-indri -- -e miniflux_create_admin=1`
- [ ] Approve services in Tailscale admin
- [ ] Verify PostgreSQL: `ssh indri '/opt/homebrew/opt/postgresql@18/bin/pg_isready'`
- [ ] Verify Miniflux: `curl https://feed.tail8d86e.ts.net/healthcheck`
- [ ] Run `mise run indri-services-check`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Reviewed-on: https://forge.tail8d86e.ts.net/eblume/blumeops/pulls/16
This commit is contained in:
parent
3f4e40f3ae
commit
adf6f4fbe9
24 changed files with 1309 additions and 13 deletions
|
|
@ -1,7 +1,48 @@
|
|||
---
|
||||
borgmatic_config: /Users/erichblume/.config/borgmatic/config.yaml
|
||||
borgmatic_config_dir: /Users/erichblume/.config/borgmatic
|
||||
borgmatic_log_dir: /Users/erichblume/Library/Logs
|
||||
|
||||
# Schedule: runs daily at 2:00 AM
|
||||
borgmatic_schedule_hour: 2
|
||||
borgmatic_schedule_minute: 0
|
||||
|
||||
# Source directories to back up
|
||||
borgmatic_source_directories:
|
||||
- /Users/erichblume/code/personal/zk
|
||||
- /opt/homebrew/var/forgejo
|
||||
- /Users/erichblume/code/3rd/kiwix-tools
|
||||
- /Users/erichblume/.config/borgmatic
|
||||
- /Users/erichblume/Documents
|
||||
- /Users/erichblume/Pictures
|
||||
- /Users/erichblume/devpi
|
||||
- /opt/homebrew/var/loki
|
||||
|
||||
# Backup repository
|
||||
borgmatic_repositories:
|
||||
- path: /Volumes/backups/borg/
|
||||
label: sifaka-borg-backups
|
||||
encryption: repokey
|
||||
append_only: true
|
||||
|
||||
# Exclude patterns
|
||||
borgmatic_exclude_patterns:
|
||||
# Exclude mirrored PyPI cache (only backup private packages)
|
||||
- /Users/erichblume/devpi/+files/root/pypi
|
||||
- /opt/homebrew/var/loki
|
||||
|
||||
# Encryption passcommand (reads borg passphrase)
|
||||
borgmatic_encryption_passcommand: cat /Users/erichblume/.borg/config.yaml
|
||||
|
||||
# Retention policy
|
||||
borgmatic_keep_daily: 7
|
||||
borgmatic_keep_monthly: 12
|
||||
borgmatic_keep_yearly: 1000
|
||||
|
||||
# PostgreSQL databases to backup (streamed via pg_dump)
|
||||
# Password is read from ~/.pgpass (managed by postgresql role)
|
||||
borgmatic_postgresql_databases:
|
||||
- name: miniflux
|
||||
hostname: localhost
|
||||
port: 5432
|
||||
username: borgmatic
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
---
|
||||
# Note: borgmatic is installed via mise (pipx), not managed here.
|
||||
# This role manages only the scheduled LaunchAgent.
|
||||
# This role manages the config file and scheduled LaunchAgent.
|
||||
|
||||
- name: Ensure borgmatic config directory exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ borgmatic_config_dir }}"
|
||||
state: directory
|
||||
mode: '0700'
|
||||
|
||||
- name: Deploy borgmatic configuration
|
||||
ansible.builtin.template:
|
||||
src: config.yaml.j2
|
||||
dest: "{{ borgmatic_config }}"
|
||||
mode: '0600'
|
||||
|
||||
- name: Deploy borgmatic LaunchAgent plist
|
||||
ansible.builtin.template:
|
||||
|
|
|
|||
45
ansible/roles/borgmatic/templates/config.yaml.j2
Normal file
45
ansible/roles/borgmatic/templates/config.yaml.j2
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
source_directories:
|
||||
{% for dir in borgmatic_source_directories %}
|
||||
- {{ dir }}
|
||||
{% endfor %}
|
||||
|
||||
source_directories_must_exist: true
|
||||
|
||||
repositories:
|
||||
{% for repo in borgmatic_repositories %}
|
||||
- path: {{ repo.path }}
|
||||
label: {{ repo.label }}
|
||||
{% if repo.encryption is defined %}
|
||||
encryption: {{ repo.encryption }}
|
||||
{% endif %}
|
||||
{% if repo.append_only is defined %}
|
||||
append_only: {{ repo.append_only | lower }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if borgmatic_exclude_patterns %}
|
||||
exclude_patterns:
|
||||
{% for pattern in borgmatic_exclude_patterns %}
|
||||
- {{ pattern }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
encryption_passcommand: {{ borgmatic_encryption_passcommand }}
|
||||
|
||||
# Retention policy
|
||||
keep_daily: {{ borgmatic_keep_daily }}
|
||||
keep_monthly: {{ borgmatic_keep_monthly }}
|
||||
keep_yearly: {{ borgmatic_keep_yearly }}
|
||||
|
||||
{% if borgmatic_postgresql_databases %}
|
||||
# PostgreSQL database backups (streamed via pg_dump)
|
||||
postgresql_databases:
|
||||
{% for db in borgmatic_postgresql_databases %}
|
||||
- name: {{ db.name }}
|
||||
hostname: {{ db.hostname | default('localhost') }}
|
||||
port: {{ db.port | default(5432) }}
|
||||
username: {{ db.username }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue