forked from uumas/ansible-docker
Element
This commit is contained in:
1
roles/element/README.md
Normal file
1
roles/element/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Installs element in docker
|
||||
4
roles/element/defaults/main.yml
Normal file
4
roles/element/defaults/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
reverse_proxy_type: caddy
|
||||
|
||||
7
roles/element/meta/main.yml
Normal file
7
roles/element/meta/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- docker
|
||||
- role: uumas.general.caddy
|
||||
when: reverse_proxy_type == 'caddy'
|
||||
|
||||
39
roles/element/tasks/main.yml
Normal file
39
roles/element/tasks/main.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
|
||||
- name: Element web
|
||||
docker_container:
|
||||
name: 'element'
|
||||
image: 'vectorim/element-web:latest'
|
||||
pull: yes
|
||||
container_default_behavior: no_defaults
|
||||
volumes:
|
||||
- /app
|
||||
published_ports:
|
||||
- "127.0.0.1:{{ ports.element_http }}:80"
|
||||
restart_policy: always
|
||||
register: element_out
|
||||
|
||||
- set_fact:
|
||||
element_config_volume: "{{ element_out.container.Mounts | selectattr('Destination', 'equalto', '/app') | join }}"
|
||||
|
||||
- name: Read element config to variable
|
||||
include_vars:
|
||||
file: element_config.yml
|
||||
name: element_config
|
||||
- name: Put element config in place
|
||||
copy:
|
||||
content: "{{ element_config }}"
|
||||
dest: "{{ element_config_volume.Source }}/config.json"
|
||||
|
||||
- name: Add caddy reverse proxy config
|
||||
blockinfile:
|
||||
path: /etc/caddy/Caddyfile
|
||||
marker: "# {mark} ANSIBLE MANAGED BLOCK element"
|
||||
block: |
|
||||
element.{{ domain }} chat.{{ domain }} {
|
||||
reverse_proxy http://127.0.0.1:{{ ports.element_http }}
|
||||
}
|
||||
validate: 'caddy validate --config %s --adapter caddyfile'
|
||||
backup: yes
|
||||
notify: reload caddy
|
||||
when: reverse_proxy_type == 'caddy'
|
||||
44
roles/element/templates/config.json.j2
Normal file
44
roles/element/templates/config.json.j2
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"default_server_config": {
|
||||
"m.homeserver": {
|
||||
"base_url": "{{ matrix_external_url }}",
|
||||
"server_name": "{{ matrix_domain }}"
|
||||
}
|
||||
},
|
||||
"disable_custom_urls": true,
|
||||
"disable_guests": true,
|
||||
"disable_login_language_selector": false,
|
||||
"disable_3pid_login": true,
|
||||
"brand": "Element",
|
||||
"integrations_ui_url": "https://scalar.vector.im/",
|
||||
"integrations_rest_url": "https://scalar.vector.im/api",
|
||||
"integrations_widgets_urls": [
|
||||
"https://scalar.vector.im/_matrix/integrations/v1",
|
||||
"https://scalar.vector.im/api",
|
||||
"https://scalar-staging.vector.im/_matrix/integrations/v1",
|
||||
"https://scalar-staging.vector.im/api",
|
||||
"https://scalar-staging.riot.im/scalar/api"
|
||||
],
|
||||
"bug_report_endpoint_url": "https://element.io/bugreports/submit",
|
||||
"defaultCountryCode": "GB",
|
||||
"showLabsSettings": false,
|
||||
"default_federate": true,
|
||||
"default_theme": "dark",
|
||||
"roomDirectory": {
|
||||
"servers": [
|
||||
"{{ matrix_domain }}"
|
||||
]
|
||||
},
|
||||
"enable_presence_by_hs_url": {
|
||||
"https://matrix.org": false,
|
||||
"https://matrix-client.matrix.org": false
|
||||
},
|
||||
"settingDefaults": {
|
||||
"breadcrumbs": true
|
||||
},
|
||||
{% if jitsi_domain is defined %}
|
||||
"jitsi": {
|
||||
"preferredDomain": "{{ jitsi_domain }}"
|
||||
}
|
||||
{% endif %}
|
||||
}
|
||||
34
roles/element/vars/element_config.yml
Normal file
34
roles/element/vars/element_config.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
|
||||
default_server_config:
|
||||
m.homeserver:
|
||||
base_url: "{{ matrix_external_url }}"
|
||||
server_name: "{{ matrix_domain }}"
|
||||
disable_custom_urls: yes
|
||||
disable_guests: yes
|
||||
disable_login_language_selector: false
|
||||
disable_3pid_login: true
|
||||
brand: Element
|
||||
integrations_ui_url: https://scalar.vector.im/
|
||||
integrations_rest_url: https://scalar.vector.im/api
|
||||
integrations_widgets_urls:
|
||||
- https://scalar.vector.im/_matrix/integrations/v1
|
||||
- https://scalar.vector.im/api
|
||||
- https://scalar-staging.vector.im/_matrix/integrations/v1
|
||||
- https://scalar-staging.vector.im/api
|
||||
- https://scalar-staging.riot.im/scalar/api
|
||||
bug_report_endpoint_url: https://element.io/bugreports/submit
|
||||
defaultCountryCode: GB
|
||||
showLabsSettings: no
|
||||
default_federate: yes
|
||||
default_theme: dark
|
||||
roomDirectory:
|
||||
servers:
|
||||
- "{{ matrix_domain }}"
|
||||
enable_presence_by_hs_url:
|
||||
"https://matrix.org": no
|
||||
"https://matrix-client.matrix.org": no
|
||||
settingDefaults:
|
||||
breadcrumbs: yes
|
||||
jitsi:
|
||||
preferredDomain: "{{ jitsi_domain | default('jitsi.riot.im') }}"
|
||||
Reference in New Issue
Block a user