backup: add tor identity and tailscale state; fix dump dir
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
75bbdb3dab
commit
7972fad90b
2 changed files with 53 additions and 1 deletions
45
deploy.md
Normal file
45
deploy.md
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
# Deploying bucur
|
||||||
|
|
||||||
|
## Connect
|
||||||
|
|
||||||
|
SSH via Tailscale (preferred) or direct IP:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh tobias@bucur # via Tailscale
|
||||||
|
ssh tobias@194.68.44.28 # direct
|
||||||
|
```
|
||||||
|
|
||||||
|
User `tobias` has passwordless sudo (`wheel` group).
|
||||||
|
|
||||||
|
## Deploy
|
||||||
|
|
||||||
|
SSH into the server and run nixos-rebuild there — do not build locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh tobias@194.68.44.28 'cd /etc/nixos && sudo git pull && sudo nixos-rebuild switch --flake /etc/nixos#bucur'
|
||||||
|
```
|
||||||
|
|
||||||
|
The server pulls from Codeberg (`codeberg.org:randogoth/bucur`) using the deploy key in `secrets/bucur.yaml`.
|
||||||
|
|
||||||
|
## Adding secrets
|
||||||
|
|
||||||
|
Edit `secrets/bucur.yaml` with sops (age key at `secrets/age/keys.txt`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
SOPS_AGE_KEY_FILE=secrets/age/keys.txt nix run nixpkgs#sops -- secrets/bucur.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
Reference the new secret in the relevant module via `config.sops.secrets.<name>.path`.
|
||||||
|
|
||||||
|
## Manual service ops
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check a service
|
||||||
|
ssh tobias@194.68.44.28 'sudo journalctl -fu <service>'
|
||||||
|
|
||||||
|
# Trigger the daily database backup
|
||||||
|
ssh tobias@194.68.44.28 'sudo systemctl start borgbackup-job-databases'
|
||||||
|
|
||||||
|
# List backup archives
|
||||||
|
ssh tobias@194.68.44.28 'sudo bash -c "BORG_RSH=\"ssh -i /run/secrets/borg_ssh_key\" BORG_PASSPHRASE=\$(cat /run/secrets/borg_passphrase) borg list ssh://snh7mkwh@snh7mkwh.repo.borgbase.com/./repo"'
|
||||||
|
```
|
||||||
|
|
@ -10,7 +10,14 @@ in
|
||||||
|
|
||||||
services.borgbackup.jobs.databases = {
|
services.borgbackup.jobs.databases = {
|
||||||
repo = "ssh://snh7mkwh@snh7mkwh.repo.borgbase.com/./repo";
|
repo = "ssh://snh7mkwh@snh7mkwh.repo.borgbase.com/./repo";
|
||||||
paths = [ dumpDir ];
|
paths = [
|
||||||
|
dumpDir
|
||||||
|
"/var/lib/tor/keys"
|
||||||
|
"/var/lib/tor/fingerprint"
|
||||||
|
"/var/lib/tor/fingerprint-ed25519"
|
||||||
|
"/var/lib/tor/hashed-fingerprint"
|
||||||
|
"/var/lib/tailscale"
|
||||||
|
];
|
||||||
|
|
||||||
encryption = {
|
encryption = {
|
||||||
mode = "repokey-blake2";
|
mode = "repokey-blake2";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue