Files
wmair 8cb92b9226 Initial commit: Complete Matrix Stack with SSO and all bugfixes
This is a clean, ready-to-deploy Matrix communication stack with:

Features:
- Matrix Synapse homeserver with PostgreSQL
- Element Web client
- Matrix Authentication Service (MAS) with OIDC
- Authelia SSO with 2FA support
- Caddy reverse proxy with automatic HTTPS
- Bridges: Telegram, WhatsApp, Signal (pre-configured)

Deployment Modes:
- Local testing (all-in-one with self-signed certs)
- Production (distributed 3-machine setup with Let's Encrypt)

All Critical Bugfixes Applied:
1. Using example.test domains (not .localhost - public suffix list issue)
2. MAS assets resource enabled (fixes CSS 404 errors)
3. MAS fetch_userinfo enabled (required for Authelia claims)
4. Internal discovery URL for faster OIDC metadata fetching
5. Claims templates using preferred_username (Authelia compatible)
6. All redirect URIs configured in Authelia
7. Caddy CA certificate extraction automated
8. Correct email domains throughout

Security:
- All secrets generated dynamically on deployment
- Cryptographically secure random generation (OpenSSL)
- 4096-bit RSA keys for OIDC/JWT signing
- Argon2 password hashing
- No hardcoded secrets in repository

Documentation:
- BUGFIXES.md - Comprehensive troubleshooting guide
- DEPLOYMENT_GUIDE.md - Step-by-step deployment manual
- QUICK_REFERENCE.md - Command cheatsheet
- README.md - Quick start guide
- PRODUCTION.md - Production deployment guide

Deployment:
- Single command: ./deploy.sh
- Fully automated configuration generation
- ~10 minutes to complete setup

State: Clean slate, ready for validation deployment
2025-10-29 14:46:30 +01:00

16 lines
531 B
SQL

-- Create additional databases for Matrix Authentication Service and Authelia
-- The main 'synapse' database is already created via POSTGRES_DB env var
-- Create database for Matrix Authentication Service (MAS)
CREATE DATABASE mas;
-- Create database for Authelia
CREATE DATABASE authelia;
-- Grant privileges to the synapse user for all databases
GRANT ALL PRIVILEGES ON DATABASE mas TO synapse;
GRANT ALL PRIVILEGES ON DATABASE authelia TO synapse;
-- Display confirmation
\echo 'Additional databases created: mas, authelia'