Commit 0c9178f2 authored by nimrod's avatar nimrod
Browse files

Matrix: Compose setup.

parent c95d440c
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -101,3 +101,29 @@ web-proxy host01 run:
    WORKDIR: Compose/web-proxy/host01
  when: manual
  rules: *compose-rules

# Matrix Compose deployment.

matrix-build:
  extends: .compose-build
  tags: &matrix-tags [host01.shore.co.il]
  variables: &matrix-vars
    WORKDIR: Compose/matrix

matrix-pull:
  extends: .compose-pull
  tags: *matrix-tags
  variables: *matrix-vars

matrix-run:
  extends: .compose-run
  tags: *matrix-tags
  variables: *matrix-vars
  needs:
    - job: matrix-build
    - job: matrix-pull
  after_script:
    # yamllint disable rule:line-length
    - docker-compose exec synapse sh -c "while [ ! -f /conf/homeserver.yaml ]; do echo Waiting for the config file.; sleep 1; done"
    - docker-compose exec synapse update_synapse_database --run-background-updates --database-config /conf/homeserver.yaml
    # yamllint enable rule:line-length
+3 −1
Original line number Diff line number Diff line
@@ -12,7 +12,8 @@ repos:
      - id: check-toml
      - id: check-xml
      - id: check-yaml
        exclude: ^Ansible/roles/(wap|router)/vars/main\.yaml$
        # yamllint disable-line rule:line-length
        exclude: ^Ansible/roles/(wap|router)/vars/main\.yaml$|^Compose/matrix/synapse/homeserver\.yaml$
      - id: detect-private-key
      - id: end-of-file-fixer
      - id: trailing-whitespace
@@ -50,6 +51,7 @@ repos:
    rev: v1.26.3
    hooks:
      - id: yamllint
        exclude: ^Compose/matrix/synapse/homeserver\.yaml$$

  - repo: https://github.com/executablebooks/mdformat.git
    rev: 0.7.10

Compose/matrix/.env

0 → 100644
+1 −0
Original line number Diff line number Diff line
COMPOSE_PROJECT_NAME=matrix
+4 −0
Original line number Diff line number Diff line
# Matrix

Deploy a Matrix homeserver using
[Synapse](https://element-hq.github.io/synapse/latest/).
+50 −0
Original line number Diff line number Diff line
---
version: '3.5'

services:
  postgres:
    environment:
      POSTGRES_DB: &postgres_db synapse
      POSTGRES_INITDB_ARGS: --encoding=UTF-8 --lc-collate=C --lc-ctype=C
      POSTGRES_PASSWORD: &postgres_password "${SYNAPSE_DB_PASS}"
      POSTGRES_USER: &postgres_user synapse
    image: registry.shore.co.il/postgres
    restart: always
    volumes:
      - postgres:/var/lib/postgresql/data

  synapse:
    build:
      context: synapse/
    depends_on:
      - postgres
    environment:
      LDAP_URI: ldap://ldap:389
      POSTGRES_DB: *postgres_db
      POSTGRES_HOST: postgres
      POSTGRES_PASSWORD: *postgres_password
      POSTGRES_USER: *postgres_user
      SYNAPSE_SERVER_NAME: shore.co.il
      SIGNING_KEY: "${SYNAPSE_SIGNING_KEY}"
      SYNAPSE_ADMIN_CONTACT: "mailto:postmaster@shore.co.il"
      SYNAPSE_LOG_LEVEL: WARNING
      SYNAPSE_MACAROON_SECRET_KEY: "${SYNAPSE_MACAROON_SECRET_KEY}"
      # yamllint disable-line rule:line-length
      SYNAPSE_REGISTRATION_SHARED_SECRET: "${SYNAPSE_REGISTRATION_SHARED_SECRET}"
      SYNAPSE_SMTP_HOST: smtp
    restart: always
    volumes:
      - data:/data
      - _run_slapd:/run/slapd

volumes:
  data:
  postgres:
  _run_slapd:
    external: true
    name: run_slapd

networks:
  default:
    name: shore
    external: true
Loading