Commit graph

12 commits

Author SHA1 Message Date
Till Wegmueller
b6bf4ceee0
feat: migrate from raw SQL to SeaORM migrations
Replace raw SQL CREATE TABLE statements with proper SeaORM migration
system. This eliminates verbose SQL logs on startup and provides
proper migration tracking and rollback support.

Changes:
- Add sea-orm-migration dependency and migration crate
- Create initial migration (m20250101_000001) with all 8 tables
- Update storage::init() to only connect to database
- Run migrations automatically in main.rs on startup
- Remove unused detect_backend() function and imports

The migration system properly handles both SQLite and PostgreSQL
backends with appropriate type handling (e.g., BIGSERIAL vs INTEGER
for auto-increment columns).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:42:58 +01:00
Till Wegmueller
f2f7f4be00
chore: release 0.2.0-alpha.13 2025-11-30 18:13:48 +01:00
Till Wegmueller
a1056bb237
feat: add admin GraphQL API, background jobs, and user sync CLI
Major Features:
- Admin GraphQL API with dual endpoints (Seaography + custom)
- Background job scheduler with execution tracking
- Idempotent user sync CLI for Kubernetes deployments
- Secure PUT /properties endpoint with Bearer token auth

Admin GraphQL API:
- Entity CRUD via Seaography at /admin/graphql
- Custom job management API at /admin/jobs
- Mutations: triggerJob
- Queries: jobLogs, availableJobs
- GraphiQL playgrounds for both endpoints

Background Jobs:
- tokio-cron-scheduler integration
- Automated cleanup of expired sessions (hourly)
- Automated cleanup of expired refresh tokens (hourly)
- Job execution tracking in database
- Manual job triggering via GraphQL

User Sync CLI:
- Command: barycenter sync-users --file users.json
- Idempotent user synchronization from JSON
- Creates new users with hashed passwords
- Updates existing users (enabled, email_verified, email)
- Syncs custom properties per user
- Perfect for Kubernetes init containers

Security Enhancements:
- PUT /properties endpoint requires Bearer token
- Users can only modify their own properties
- Public registration disabled by default
- Admin API on separate port for network isolation

Database:
- New job_executions table for job tracking
- User update functions (update_user, update_user_email)
- PostgreSQL + SQLite support maintained

Configuration:
- allow_public_registration setting (default: false)
- admin_port setting (default: main port + 1)

Documentation:
- Comprehensive Kubernetes deployment guide
- User sync JSON schema and examples
- Init container and CronJob examples
- Production deployment patterns

Files Added:
- src/admin_graphql.rs - GraphQL schema builders
- src/admin_mutations.rs - Custom mutations and queries
- src/jobs.rs - Job scheduler and tracking
- src/user_sync.rs - User sync logic
- src/entities/ - SeaORM entities (8 entities)
- docs/kubernetes-deployment.md - K8s deployment guide
- users.json.example - User sync example

Dependencies:
- tokio-cron-scheduler 0.13
- seaography 1.1.4
- async-graphql 7.0
- async-graphql-axum 7.0

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 18:06:50 +01:00
Till Wegmueller
06ff10dda9
chore: release 0.2.0-alpha.12 2025-11-29 20:52:42 +01:00
Till Wegmueller
3afdb6308e
chore: release 0.2.0-alpha.11 2025-11-29 20:46:00 +01:00
Till Wegmueller
6ef8f0b266
chore: release 0.2.0-alpha.10 2025-11-29 20:30:58 +01:00
Till Wegmueller
c381e00c37
chore: release 0.2.0-alpha.9 2025-11-29 17:36:59 +01:00
Till Wegmueller
6e0fb3cb68
chore: release 0.2.0-alpha.8 2025-11-29 17:22:01 +01:00
Till Wegmueller
876c659292
chore: release 0.2.0-alpha.7 2025-11-29 16:41:28 +01:00
Till Wegmueller
55a0141a2f
chore: release 0.2.0-alpha.6 2025-11-29 16:21:57 +01:00
Till Wegmueller
6b388de790
chore: release 0.2.0-alpha.5 2025-11-29 16:15:02 +01:00
Till Wegmueller
0ce360f004
fix: commit Cargo.lock for reproducible builds
Cargo.lock should be committed for applications (not libraries) to ensure
reproducible builds across environments. This is required for Docker builds
and is the recommended practice per Rust guidelines.

Removed Cargo.lock from:
- .gitignore
- .dockerignore

This fixes the Docker build error:
  ERROR: "/Cargo.lock": not found
2025-11-29 16:14:39 +01:00