v0.25.0
Another security enhancement with enforced RLS per Guild. Backup your databases and follow the Upgrade Notes below
Added
- Row Level Security (RLS) enforcement across all API endpoints
- Database-level access control ensures users can only access data within their guild
- All guild-scoped endpoints now set RLS context (user, guild, role) before querying
- Super admin bypass via
app.is_superadminsession variable - RLS policies added for tags, document_links, task_tags, project_tags, and document_tags tables
- Guild table now has command-specific policies (SELECT/INSERT/UPDATE/DELETE) instead of a single blanket policy
- Guild memberships allow cross-guild SELECT for own memberships (needed for guild list, leave checks)
- NULLIF-safe policies prevent empty string cast crashes (fail-closed with 0 rows instead of 500 errors)
Changed
- Admin endpoints now use dedicated admin database sessions (bypass RLS for cross-guild platform operations)
- Registration, invite acceptance, and account deletion use admin sessions (bootstrapping operations that span guilds)
- Database sessions pin their connection for the entire request lifetime to prevent RLS context loss after commits
Upgrade Notes
Docker deployments should update their setup to enable RLS enforcement:
-
Add the init script — copy
docker/init-db.shfrom the repository into adocker/directory next to yourdocker-compose.yml. This script creates two PostgreSQL roles:app_user— RLS-enforced, used for normal API queriesapp_admin— BYPASSRLS, used for migrations and background jobs
-
Update
docker-compose.yml— add the following to yourdbservice:services: db: environment: APP_USER_PASSWORD: ${APP_USER_PASSWORD:-app_user_password} APP_ADMIN_PASSWORD: ${APP_ADMIN_PASSWORD:-app_admin_password} volumes: - ./docker/init-db.sh:/docker-entrypoint-initdb.d/01-create-roles.sh
And add these environment variables to your
initiativeservice:services: initiative: environment: # RLS-enforced connection (app_user role, no BYPASSRLS) DATABASE_URL_APP: postgresql+asyncpg://app_user:${APP_USER_PASSWORD:-app_user_password}@db:5432/initiative # Admin connection for migrations and background jobs (app_admin role, BYPASSRLS) DATABASE_URL_ADMIN: postgresql+asyncpg://app_admin:${APP_ADMIN_PASSWORD:-app_admin_password}@db:5432/initiative
See
docker-compose.example.ymlfor a complete reference. -
Fresh databases only — the init script runs on first
docker-compose up(when the postgres data volume is empty). For existing databases, the Alembic migration (20260207_0040) creates the roles automatically. You will still need to setDATABASE_URL_APPandDATABASE_URL_ADMINenvironment variables. -
Backward compatible — if
DATABASE_URL_APPis not set, the app falls back toDATABASE_URLand RLS remains inert (existing behavior).
Downloads
Android App
Download the APK from the assets below and install on your Android device.
Docker Image
docker pull morelitea/initiative:0.25.0Or use latest tag. View on Docker Hub.