From fec2f932c454b276711a9aefc6f4c6cc14a74145 Mon Sep 17 00:00:00 2001 From: deathrow Date: Thu, 3 Nov 2022 18:38:09 -0400 Subject: [PATCH] Setup dimension --- .env.sample | 5 ++++- README.md | 15 +++++++++++++++ docker-compose.yml | 28 +++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.env.sample b/.env.sample index 59f6a57..b7dd5d3 100644 --- a/.env.sample +++ b/.env.sample @@ -3,4 +3,7 @@ POSTGRES_PASSWORD=password POSTGRES_DB=db SWAG_URL=example.tld SWAG_SUBDOMAINS=matrix, dimension, adminer, maubot -SWAG_EMAIL=email@example.tld \ No newline at end of file +SWAG_EMAIL=email@example.tld +DIMENSION_DB_USER=user +DIMENSION_DB_PASSWORD=password +DIMENSION_DB_DB=db \ No newline at end of file diff --git a/README.md b/README.md index 4243bdd..b808b0b 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,21 @@ modules: The [synapse-captcha](https://codeberg.org/deathrow/synapse-captcha) is included with this deployment. Refer to this for configuration. +### Dimension + +To setup dimension, refer to the [official documentation](https://github.com/turt2live/matrix-dimension/blob/master/docs/installing.md) + +For the database: + +``` +database: + uri: "postgres://admin:password@dimension:5432/dbname" + botData: "/data/bot.json" +``` + +These values are set in the `.env` file. + + ### Additional To bypass ratelimits for certain users: diff --git a/docker-compose.yml b/docker-compose.yml index 5627951..92c9f44 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -149,9 +149,10 @@ services: volumes: - ./dimension:/data:Z depends_on: - - synapse + - dimension_db networks: - matrix + - dimension ports: - 127.0.0.1:8184:8184 read_only: true @@ -160,6 +161,30 @@ services: cap_drop: - ALL + dimension_db: + image: docker.io/postgres:14.5-alpine + container_name: dimension_db + user: "70:70" + restart: always + environment: + - POSTGRES_USER=${DIMENSION_DB_USER} + - POSTGRES_PASSWORD=${DIMENSION_DB_PASSWORD} + - POSTGRES_DB=${DIMENSION_DB_DB} + - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C + volumes: + - ./dimension/db:/var/lib/dimension_db/data:Z + ports: + - 127.0.0.1:5433:5432 + networks: + - dimension + read_only: true + security_opt: + - no-new-privileges:true + cap_drop: + - ALL + tmpfs: + - /var/run/postgresql:size=50M,mode=0770,uid=70,gid=70,noexec,nosuid,nodev + # WORKERS sync3: @@ -436,4 +461,5 @@ networks: matrix: registration: adminer: + dimension: \ No newline at end of file