Initial commit after Claude implementation
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
---
|
||||
matrix_data_dir: "{{ sovereign_base_dir }}/matrix"
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: restart matrix
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ matrix_data_dir }}"
|
||||
state: present
|
||||
recreate: always
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Create Matrix directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop:
|
||||
- "{{ matrix_data_dir }}"
|
||||
- "{{ matrix_data_dir }}/synapse"
|
||||
- "{{ matrix_data_dir }}/element"
|
||||
|
||||
- name: Generate Synapse config if not present
|
||||
ansible.builtin.command:
|
||||
cmd: >
|
||||
docker run --rm
|
||||
-v {{ matrix_data_dir }}/synapse:/data
|
||||
-e SYNAPSE_SERVER_NAME={{ matrix_domain }}
|
||||
-e SYNAPSE_REPORT_STATS=no
|
||||
ghcr.io/element-hq/synapse:{{ matrix_version }}
|
||||
generate
|
||||
creates: "{{ matrix_data_dir }}/synapse/homeserver.yaml"
|
||||
|
||||
- name: Deploy Element config
|
||||
ansible.builtin.template:
|
||||
src: element-config.json.j2
|
||||
dest: "{{ matrix_data_dir }}/element/config.json"
|
||||
mode: '0644'
|
||||
|
||||
- name: Deploy Matrix docker-compose
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ matrix_data_dir }}/docker-compose.yml"
|
||||
mode: '0644'
|
||||
notify: restart matrix
|
||||
|
||||
- name: Start Matrix
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ matrix_data_dir }}"
|
||||
state: present
|
||||
@@ -0,0 +1,69 @@
|
||||
services:
|
||||
matrix-db:
|
||||
image: postgres:16-alpine
|
||||
container_name: matrix-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: synapse
|
||||
POSTGRES_PASSWORD: "{{ matrix_db_password }}"
|
||||
POSTGRES_DB: synapse
|
||||
POSTGRES_INITDB_ARGS: "--encoding='UTF8' --lc-collate='C' --lc-ctype='C'"
|
||||
volumes:
|
||||
- {{ matrix_data_dir }}/db:/var/lib/postgresql/data
|
||||
networks:
|
||||
- internal
|
||||
logging:
|
||||
driver: gelf
|
||||
options:
|
||||
gelf-address: "udp://{{ graylog_host }}:{{ graylog_gelf_port }}"
|
||||
tag: "matrix-db"
|
||||
|
||||
synapse:
|
||||
image: ghcr.io/element-hq/synapse:{{ matrix_version }}
|
||||
container_name: synapse
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- matrix-db
|
||||
environment:
|
||||
SYNAPSE_CONFIG_PATH: /data/homeserver.yaml
|
||||
volumes:
|
||||
- {{ matrix_data_dir }}/synapse:/data
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.matrix.rule=Host(`{{ matrix_domain }}`)"
|
||||
- "traefik.http.routers.matrix.tls=true"
|
||||
- "traefik.http.routers.matrix.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.matrix.loadbalancer.server.port=8008"
|
||||
networks:
|
||||
- internal
|
||||
- {{ sovereign_network_name }}
|
||||
logging:
|
||||
driver: gelf
|
||||
options:
|
||||
gelf-address: "udp://{{ graylog_host }}:{{ graylog_gelf_port }}"
|
||||
tag: "synapse"
|
||||
|
||||
element:
|
||||
image: vectorim/element-web:latest
|
||||
container_name: element
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- {{ matrix_data_dir }}/element/config.json:/app/config.json:ro
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.element.rule=Host(`{{ element_domain }}`)"
|
||||
- "traefik.http.routers.element.tls=true"
|
||||
- "traefik.http.routers.element.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.element.loadbalancer.server.port=80"
|
||||
networks:
|
||||
- {{ sovereign_network_name }}
|
||||
logging:
|
||||
driver: gelf
|
||||
options:
|
||||
gelf-address: "udp://{{ graylog_host }}:{{ graylog_gelf_port }}"
|
||||
tag: "element"
|
||||
|
||||
networks:
|
||||
internal:
|
||||
{{ sovereign_network_name }}:
|
||||
external: true
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"default_server_config": {
|
||||
"m.homeserver": {
|
||||
"base_url": "https://{{ matrix_domain }}",
|
||||
"server_name": "{{ matrix_domain }}"
|
||||
}
|
||||
},
|
||||
"brand": "Element",
|
||||
"integrations_ui_url": "https://scalar.vector.im/",
|
||||
"integrations_rest_url": "https://scalar.vector.im/api",
|
||||
"bug_report_endpoint_url": "",
|
||||
"default_country_code": "US",
|
||||
"show_labs_settings": false,
|
||||
"features": {},
|
||||
"default_federate": true,
|
||||
"default_theme": "light",
|
||||
"room_directory": {
|
||||
"servers": ["{{ matrix_domain }}"]
|
||||
},
|
||||
"enable_presence_by_hs_url": {
|
||||
"https://{{ matrix_domain }}": false
|
||||
},
|
||||
"setting_defaults": {
|
||||
"breadcrumbs": true
|
||||
},
|
||||
"jitsi": {
|
||||
"preferred_domain": "{{ jitsi_domain }}"
|
||||
},
|
||||
"sso_redirect_options": {
|
||||
"immediate": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user