Add synapse config
This commit is contained in:
parent
0da675db1c
commit
c264a707c3
5 changed files with 1795 additions and 0 deletions
32
ansible/roles/docker/files/synapse/docker-compose.yml
Normal file
32
ansible/roles/docker/files/synapse/docker-compose.yml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
synapse:
|
||||||
|
image: matrixdotorg/synapse:v1.8.0-py3
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
- SYNAPSE_CONFIG_PATH=/etc/homeserver.yaml
|
||||||
|
- SYNAPSE_REPORT_STATS=yes
|
||||||
|
- UID=0
|
||||||
|
- GID=0
|
||||||
|
volumes:
|
||||||
|
- ./homeserver.yaml:/etc/homeserver.yaml
|
||||||
|
- ./files:/data
|
||||||
|
expose:
|
||||||
|
- 8008
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.synapse.rule=Host(`matrix.jakehoward.tech`)"
|
||||||
|
- "traefik.http.routers.synapse.tls=true"
|
||||||
|
- "traefik.http.routers.synapse.tls.certresolver=le"
|
||||||
|
- "traefik.http.routers.synapse.entrypoints=web-secure,matrix"
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:12-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=synapse
|
||||||
|
- POSTGRES_PASSWORD=synapse
|
||||||
|
volumes:
|
||||||
|
- ./postgresql:/var/lib/postgresql/data
|
1688
ansible/roles/docker/files/synapse/homeserver.yml
Normal file
1688
ansible/roles/docker/files/synapse/homeserver.yml
Normal file
File diff suppressed because it is too large
Load diff
|
@ -48,3 +48,6 @@
|
||||||
|
|
||||||
- name: Install quassel
|
- name: Install quassel
|
||||||
include: quassel.yml
|
include: quassel.yml
|
||||||
|
|
||||||
|
- name: Install synapse
|
||||||
|
include: synapse.yml
|
||||||
|
|
44
ansible/roles/docker/tasks/synapse.yml
Normal file
44
ansible/roles/docker/tasks/synapse.yml
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
- name: Include synapse variables
|
||||||
|
include_vars: synapse.yml
|
||||||
|
|
||||||
|
- name: Create synapse directory
|
||||||
|
file:
|
||||||
|
path: '/opt/synapse'
|
||||||
|
state: directory
|
||||||
|
owner: "{{ docker_user.name }}"
|
||||||
|
mode: "{{ docker_compose_directory_mask }}"
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
- name: Install synapse compose file
|
||||||
|
template:
|
||||||
|
src: files/synapse/docker-compose.yml
|
||||||
|
dest: "/opt/synapse/docker-compose.yml"
|
||||||
|
mode: "{{ docker_compose_file_mask }}"
|
||||||
|
owner: "{{ docker_user.name }}"
|
||||||
|
validate: /usr/bin/docker-compose -f %s config
|
||||||
|
register: compose_file
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
- name: Install synapse config
|
||||||
|
template:
|
||||||
|
src: files/synapse/homeserver.yml
|
||||||
|
dest: "/opt/synapse/homeserver.yaml"
|
||||||
|
mode: "{{ docker_compose_file_mask }}"
|
||||||
|
owner: "{{ docker_user.name }}"
|
||||||
|
register: homeserver_config
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
- name: Cycle synapse container
|
||||||
|
docker_compose:
|
||||||
|
project_src: /opt/synapse
|
||||||
|
pull: true
|
||||||
|
remove_orphans: true
|
||||||
|
remove_volumes: true
|
||||||
|
state: "{{ item }}"
|
||||||
|
when: compose_file.changed or homeserver_config.changed
|
||||||
|
loop:
|
||||||
|
- absent
|
||||||
|
- present
|
28
ansible/roles/docker/vars/synapse.yml
Normal file
28
ansible/roles/docker/vars/synapse.yml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
synapse:
|
||||||
|
registration_shared_secret: !vault |
|
||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
36363037303531333331356363393631623633636366653139346665316638623039323031633066
|
||||||
|
3262366439396362336338313933363539616262383461330a353638613364616134613130616665
|
||||||
|
66643239366363623536663163386138633535353066613633346131366333316538643031396537
|
||||||
|
3634356163353232620a663538393966353961353562376136303161336636663535376238383938
|
||||||
|
66623539643032353131313538313131326237313936313061616566643639623939313161633230
|
||||||
|
33663666633130373138393937323939383865623939623035373835626363386466663233333534
|
||||||
|
376362626664643664653833646162333863
|
||||||
|
macaroon_secret_key: !vault |
|
||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
64643336366430326631643331316239646539363362383531313335396231306335623538333761
|
||||||
|
3565393330656363376233356631353665636139643261360a656362623264353931613936666531
|
||||||
|
64373437366364313862326564623135643838343834633364656238356565353463393230326631
|
||||||
|
6438383561666561390a323965353136383264376265633364356265346463316161383563663939
|
||||||
|
66653565623666353833353639386634633631366234643933323836633033613963373863303466
|
||||||
|
66326435393266326233613833616263623739346634613531346535346136373965336333373566
|
||||||
|
316535323861356438623065313530346461
|
||||||
|
form_secret: !vault |
|
||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
36313462383034633133373938613161316436313631333061346664653861353062316539393536
|
||||||
|
3436373931363139653232353764393534303530366231310a643335333735656361333632346332
|
||||||
|
30393931366466666535363837663436633533366662373834643362636663386439356236393933
|
||||||
|
3532363432623637330a663263643263333764383637373339616665353631616130643537326263
|
||||||
|
38386538393032353365313733393835303630356536303635373764633139626162356165343539
|
||||||
|
64343135323833356130363262353638353533396563656566666635663263383065646630663063
|
||||||
|
366137356638386537376236623531326636
|
Loading…
Reference in a new issue