Files
microdao-daarion/infra/matrix/postgres/init.sql
Apple 557bfb5ee1 feat: Add Matrix infrastructure (Synapse + Element Web)
- Synapse homeserver.yaml configuration
- Element Web config.json
- PostgreSQL init script for synapse DB
- Nginx gateway configuration
- Docker Compose for Matrix stack
- README_MATRIX.md documentation
2025-11-26 11:56:39 -08:00

28 lines
791 B
SQL

-- Matrix Synapse PostgreSQL initialization
-- Run this on the existing dagi-postgres instance
-- Create synapse database
CREATE DATABASE synapse
ENCODING 'UTF8'
LC_COLLATE='C'
LC_CTYPE='C'
template=template0;
-- Create synapse user (password should be set via env variable)
CREATE USER synapse WITH ENCRYPTED PASSWORD 'CHANGE_ME_IN_PRODUCTION';
-- Grant privileges
GRANT ALL PRIVILEGES ON DATABASE synapse TO synapse;
-- Connect to synapse database and set up extensions
\c synapse
-- Required extensions for Synapse
CREATE EXTENSION IF NOT EXISTS pg_trgm;
-- Grant schema permissions
GRANT ALL ON SCHEMA public TO synapse;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO synapse;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO synapse;