diff --git a/element/config.json b/element/config.json new file mode 100644 index 0000000..d022287 --- /dev/null +++ b/element/config.json @@ -0,0 +1,23 @@ +{ + "default_server_name": "matrix.teier.eu", + "brand": "Matrix - teier.eu", + "hosting_signup_link": "https://element.io/matrix-services?utm_source=element-web&utm_medium=web", + "showLabsSettings": true, + "defaultCountryCode": "AT", + "piwik": false, + "default_theme": "dark", + "enable_presence_by_hs_url": { + "https://matrix.org": false, + "https://matrix-client.matrix.org": false + }, + "terms_and_conditions_links": [ + { + "url": "https://element.io/privacy", + "text": "Privacy Policy" + }, + { + "url": "https://element.io/cookie-policy", + "text": "Cookie Policy" + } + ] +} diff --git a/element/docker-compose.yml b/element/docker-compose.yml new file mode 100644 index 0000000..32151f0 --- /dev/null +++ b/element/docker-compose.yml @@ -0,0 +1,9 @@ +version: '2.4' +services: + mariadb: + image: vectorim/element-web + volumes: + - ./config.json:/app/config.json + ports: + - 8083:80 + \ No newline at end of file diff --git a/element/start.yml b/element/start.yml new file mode 100644 index 0000000..1b7573e --- /dev/null +++ b/element/start.yml @@ -0,0 +1,31 @@ +--- +- hosts: teier.eu + gather_facts: no + tasks: + - name: Check dc directory + stat: + path: /dc/element + register: element_dc_dir_stat + + - name: Create element dc directory + file: + path: /dc/element + state: directory + mode: 0755 + group: root + owner: root + when: element_dc_dir_stat.islnk is not defined + + - name: Copy config + copy: + src: config.json + dest: /dc/element/ + + - name: Copy compose file + copy: + src: docker-compose.yml + dest: /dc/element/ + + - name: Start element + shell: "cd /dc/element && docker-compose up -d" + \ No newline at end of file diff --git a/element/teardown.yml b/element/teardown.yml new file mode 100644 index 0000000..bc94167 --- /dev/null +++ b/element/teardown.yml @@ -0,0 +1,6 @@ +--- +- hosts: teier.eu + gather_facts: no + tasks: + - name: Teardown element + shell: "cd /dc/element && docker-compose down" \ No newline at end of file diff --git a/nginx/sites/synapse b/nginx/sites/matrix similarity index 66% rename from nginx/sites/synapse rename to nginx/sites/matrix index 422ef80..adf55b7 100644 --- a/nginx/sites/synapse +++ b/nginx/sites/matrix @@ -25,4 +25,18 @@ server { client_max_body_size 50M; } + + location / { + proxy_pass http://127.0.0.1:8083; + + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + client_max_body_size 50M; + } + + location /.well-known/matrix/ { + alias /var/www/html/well-known/matrix/; + } }