Skip to content

feat: migrate app to sqlite and add bare-metal VPS ops#76

Draft
rrvsh wants to merge 4 commits into
primefrom
feat/sqlite-vps-migration
Draft

feat: migrate app to sqlite and add bare-metal VPS ops#76
rrvsh wants to merge 4 commits into
primefrom
feat/sqlite-vps-migration

Conversation

@rrvsh

@rrvsh rrvsh commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • migrate the runtime database layer from SQLx Postgres to SQLx SQLite, including settings/bootstrap paths, handler query bindings, and SQLite-compatible migration DDL
  • remove docker- and Cloud Run-oriented repo wiring, replacing CI with Rust checks and simplifying local/dev defaults for a bare-metal target
  • add deploy-ready VPS assets under ops/vps/ (systemd service, nginx site template, env template, bootstrap script, deploy script, and end-to-end rollout docs)

Validation

  • cargo fmt
  • cargo clippy --fix --allow-dirty
  • cargo build
  • cargo test

VPS rollout instructions

  1. Clone the repo to /opt/aenyrathia/current on the VPS.
  2. Run sudo ./ops/vps/bootstrap.sh.
  3. Edit /etc/nginx/sites-available/aenyrathia and set server_name to your domain.
  4. Edit /etc/aenyrathia/aenyrathia.env:
    • set DATABASE_URL (default is sqlite:///var/lib/aenyrathia/app.db)
    • set GIT_REMOTE, PB_LOG, and any custom sync interval
  5. Add SSH credentials for git sync as aenyrathia user:
    • /home/aenyrathia/.ssh/id_ed25519
    • /home/aenyrathia/.ssh/known_hosts
    • permissions: 700 for .ssh, 600 for files
  6. Validate and reload nginx:
    • sudo nginx -t
    • sudo systemctl reload nginx
  7. Issue TLS cert:
    • sudo certbot --nginx -d <your-domain>
  8. Build and restart app:
    • sudo ./ops/vps/deploy.sh
  9. Point DNS A/AAAA to the VPS IP and verify login/edit/save/git-sync flows.

Notes

  • this removes Postgres and Docker from runtime expectations for this service
  • SQLite WAL mode and connection busy timeout are enabled in startup options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant