Compare commits
2 Commits
73c5bf51a8
...
13c8081395
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13c8081395 | ||
|
|
7e76a7f79a |
19
docs/element.md
Normal file
19
docs/element.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Required variables
|
||||||
|
These variables are required. Example values included. Some general variables might also be required for this role.
|
||||||
|
|
||||||
|
```
|
||||||
|
ports:
|
||||||
|
element_http: 8080
|
||||||
|
|
||||||
|
matrix_domain: domain.tld
|
||||||
|
matrix_server_domain: matrix.domain.tld
|
||||||
|
```
|
||||||
|
|
||||||
|
These variables are optional and have the following default values:
|
||||||
|
```
|
||||||
|
matrix_external_url: https://{{ matrix_server_domain }}
|
||||||
|
reverse_proxy_type: caddy
|
||||||
|
|
||||||
|
jitsi_domain: jitsi.riot.im
|
||||||
|
```
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace: uumas
|
namespace: uumas
|
||||||
name: docker
|
name: docker
|
||||||
version: 0.1.1
|
version: 0.2.0
|
||||||
readme: README.md
|
readme: README.md
|
||||||
repository: https://git.uumas.fi/uumas/ansible-docker
|
repository: https://git.uumas.fi/uumas/ansible-docker
|
||||||
license_file: LICENSE
|
license_file: LICENSE
|
||||||
@@ -10,4 +10,3 @@ dependencies:
|
|||||||
uumas.general: '>0.3.0'
|
uumas.general: '>0.3.0'
|
||||||
authors:
|
authors:
|
||||||
- uumas
|
- uumas
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
requires_ansible: ">=2.10"
|
requires_ansible: ">=2.10"
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
- curl
|
- curl
|
||||||
- gnupg
|
- gnupg
|
||||||
- lsb-release
|
- lsb-release
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
|
|
||||||
- name: Add docker repo signing key
|
- name: Add docker repo signing key
|
||||||
apt_key:
|
apt_key:
|
||||||
|
|||||||
1
roles/element/README.md
Normal file
1
roles/element/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Installs element in docker
|
||||||
3
roles/element/defaults/main.yml
Normal file
3
roles/element/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
reverse_proxy_type: caddy
|
||||||
6
roles/element/meta/main.yml
Normal file
6
roles/element/meta/main.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
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: true
|
||||||
|
container_default_behavior: no_defaults
|
||||||
|
volumes:
|
||||||
|
- /app
|
||||||
|
published_ports:
|
||||||
|
- "127.0.0.1:{{ ports.element_http }}:80"
|
||||||
|
restart_policy: always
|
||||||
|
register: element_out
|
||||||
|
|
||||||
|
- name: Get element config volume path from container creation output
|
||||||
|
set_fact:
|
||||||
|
element_config_volume: "{{ element_out.container.Mounts | selectattr('Destination', 'equalto', '/app') | join }}"
|
||||||
|
|
||||||
|
- name: Read element config to variable
|
||||||
|
include_vars: element_config.yml
|
||||||
|
- name: Put element config in place
|
||||||
|
copy:
|
||||||
|
content: "{{ element_config }}"
|
||||||
|
dest: "{{ element_config_volume.Source }}/config.json"
|
||||||
|
mode: '644'
|
||||||
|
|
||||||
|
- 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: true
|
||||||
|
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 %}
|
||||||
|
}
|
||||||
35
roles/element/vars/element_config.yml
Normal file
35
roles/element/vars/element_config.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
element_config:
|
||||||
|
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
|
||||||
|
jitsi:
|
||||||
|
preferredDomain: "{{ jitsi_domain | default('jitsi.riot.im') }}"
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
docker_container:
|
docker_container:
|
||||||
name: 'jitsi_meet_web'
|
name: 'jitsi_meet_web'
|
||||||
image: 'jitsi/web:latest'
|
image: 'jitsi/web:latest'
|
||||||
pull: yes
|
pull: true
|
||||||
container_default_behavior: no_defaults
|
container_default_behavior: no_defaults
|
||||||
published_ports:
|
published_ports:
|
||||||
- "{{ localhost_ip }}:{{ ports.jitsi_http }}:80"
|
- "{{ localhost_ip }}:{{ ports.jitsi_http }}:80"
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
docker_container:
|
docker_container:
|
||||||
name: 'jitsi_meet_prosody'
|
name: 'jitsi_meet_prosody'
|
||||||
image: 'jitsi/prosody:latest'
|
image: 'jitsi/prosody:latest'
|
||||||
pull: yes
|
pull: true
|
||||||
container_default_behavior: no_defaults
|
container_default_behavior: no_defaults
|
||||||
env:
|
env:
|
||||||
PUBLIC_URL: "{{ jitsi_external_url }}"
|
PUBLIC_URL: "{{ jitsi_external_url }}"
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
docker_container:
|
docker_container:
|
||||||
name: 'jitsi_meet_jicofo'
|
name: 'jitsi_meet_jicofo'
|
||||||
image: 'jitsi/jicofo:latest'
|
image: 'jitsi/jicofo:latest'
|
||||||
pull: yes
|
pull: true
|
||||||
container_default_behavior: no_defaults
|
container_default_behavior: no_defaults
|
||||||
env:
|
env:
|
||||||
TZ: "{{ timezone }}"
|
TZ: "{{ timezone }}"
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
docker_container:
|
docker_container:
|
||||||
name: 'jitsi_meet_jvb'
|
name: 'jitsi_meet_jvb'
|
||||||
image: 'jitsi/jvb:latest'
|
image: 'jitsi/jvb:latest'
|
||||||
pull: yes
|
pull: true
|
||||||
container_default_behavior: no_defaults
|
container_default_behavior: no_defaults
|
||||||
published_ports:
|
published_ports:
|
||||||
- "{{ ports.jitsi_jvb | default(10000) }}:10000/udp"
|
- "{{ ports.jitsi_jvb | default(10000) }}:10000/udp"
|
||||||
@@ -120,5 +120,5 @@
|
|||||||
reverse_proxy http://{{ localhost_ip }}:{{ ports.jitsi_http }}
|
reverse_proxy http://{{ localhost_ip }}:{{ ports.jitsi_http }}
|
||||||
}
|
}
|
||||||
validate: 'caddy validate --config %s --adapter caddyfile'
|
validate: 'caddy validate --config %s --adapter caddyfile'
|
||||||
backup: yes
|
backup: true
|
||||||
notify: reload caddy
|
notify: reload caddy
|
||||||
|
|||||||
Reference in New Issue
Block a user