Migrate from SQLite to PostgreSQL

- Replace modernc.org/sqlite with jackc/pgx/v5
- Update all SQL queries for PostgreSQL syntax ($1, $2 placeholders)
- Use snake_case column names throughout
- Replace SQLite FTS5 with PostgreSQL tsvector/tsquery full-text search
- Add connection pooling with pgxpool
- Support Docker secrets for database password
- Add trigger to normalize feed URLs (strip https://, http://, www.)
- Fix anchor feed detection regex to avoid false positives
- Connect app container to atproto network for PostgreSQL access
- Add version indicator to dashboard UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-01-28 20:38:13 -05:00
parent 75835d771d
commit f4afb29980
11 changed files with 1525 additions and 1137 deletions
+15 -1
View File
@@ -6,11 +6,19 @@ services:
stop_grace_period: 30s
env_file:
- pds.env
environment:
DB_HOST: atproto-postgres
DB_PORT: 5432
DB_USER: news_1440
DB_PASSWORD_FILE: /run/secrets/db_password
DB_NAME: news_1440
secrets:
- db_password
volumes:
- ./feeds:/app/feeds
- ./vertices.txt.gz:/app/vertices.txt.gz:ro
networks:
- proxy
- atproto
labels:
- "traefik.enable=true"
# Production: HTTPS with Let's Encrypt
@@ -29,6 +37,12 @@ services:
# Shared service
- "traefik.http.services.app-1440-news.loadbalancer.server.port=4321"
secrets:
db_password:
file: ../postgres/secrets/news_1440_password.txt
networks:
proxy:
external: true
atproto:
external: true