commit
de92f61e17
@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
# https://liberapay.com/s.pantaleev/
|
||||
liberapay: s.pantaleev
|
@ -0,0 +1,27 @@
|
||||
# Dynamic DNS
|
||||
|
||||
## Setup
|
||||
|
||||
Most cloud providers / ISPs will charge you extra for a static IP address. If you're
|
||||
not hosting a highly reliable homeserver you can workaround this via dynamic DNS. To
|
||||
set this up, you'll need to get the username/password from your DNS provider. For
|
||||
google domains, this process is described [here](https://support.google.com/domains/answer/6147083).
|
||||
After you've gotten the proper credentials you can add the following config to your `inventory/host_vars/matrix.DOMAIN/vars.yml`:
|
||||
|
||||
```yaml
|
||||
matrix_dynamic_dns_enabled: true
|
||||
|
||||
matrix_dynamic_dns_domain_configurations:
|
||||
- provider: domains.google.com
|
||||
protocol: dyndn2
|
||||
username: XXXXXXXXXXXXXXXX
|
||||
password: XXXXXXXXXXXXXXXX
|
||||
domain: "{{ matrix_domain }}"
|
||||
```
|
||||
|
||||
|
||||
## Additional Reading
|
||||
|
||||
Additional resources:
|
||||
|
||||
- https://matrix.org/docs/guides/free-small-matrix-server
|
@ -1,24 +1,40 @@
|
||||
# Uninstalling
|
||||
|
||||
**Note**: If you have some trouble with your installation configuration, you can just [re-run the playbook](installing.md) and it will try to set things up again. You don't need to uninstall and install fresh.
|
||||
**Warnings**:
|
||||
|
||||
However, if you've installed this on some server where you have other stuff you wish to preserve, and now want get rid of Matrix, it's enough to do these:
|
||||
- If your server federates with others, make sure to **leave any federated rooms before nuking your Matrix server's data**. Otherwise, the next time you set up a Matrix server for this domain (regardless of the installation method you use), you'll encounter trouble federating.
|
||||
|
||||
- ensure all Matrix services are stopped (`systemctl stop 'matrix*'`)
|
||||
- If you have some trouble with your installation, you can just [re-run the playbook](installing.md) and it will try to set things up again. **Uninstalling and then installing anew rarely solves anything**.
|
||||
|
||||
- delete the Matrix-related systemd .service files (`rm -f /etc/systemd/system/matrix*`) and reload systemd (`systemctl daemon-reload`)
|
||||
|
||||
-----------------
|
||||
|
||||
|
||||
## Uninstalling using a script
|
||||
|
||||
Installing places a `/usr/local/bin/matrix-remove-all` script on the server.
|
||||
|
||||
You can run it to to have it uninstall things for you automatically (see below). **Use with caution!**
|
||||
|
||||
|
||||
## Uninstalling manually
|
||||
|
||||
If you prefer to uninstall manually, run these commands (most are meant to be executed on the Matrix server itself):
|
||||
|
||||
- ensure all Matrix services are stopped: `ansible-playbook -i inventory/hosts setup.yml --tags=stop` (if you can't get Ansible working to run this command, you can run `systemctl stop 'matrix*'` manually on the server)
|
||||
|
||||
- delete the Matrix-related systemd `.service` files (`rm -f /etc/systemd/system/matrix*.service`) and reload systemd (`systemctl daemon-reload`)
|
||||
|
||||
- delete all Matrix-related cronjobs (`rm -f /etc/cron.d/matrix*`)
|
||||
|
||||
- delete some helper scripts (`rm -f /usr/local/bin/matrix*`)
|
||||
|
||||
- delete some cached Docker images (or just delete them all: `docker rmi $(docker images -aq)`)
|
||||
- delete some cached Docker images (`docker system prune -a`) or just delete them all (`docker rmi $(docker images -aq)`)
|
||||
|
||||
- delete the Docker network: `docker network rm matrix`
|
||||
- delete the Docker network: `docker network rm matrix` (might have been deleted already if you ran the `docker system prune` command)
|
||||
|
||||
- uninstall Docker itself, if necessary
|
||||
|
||||
- delete the `/matrix` directory (`rm -rf /matrix`)
|
||||
|
||||
The script `/usr/local/bin/matrix-remove-all` performs all these steps (**use with caution!**).
|
||||
|
||||
|
@ -1,62 +1,62 @@
|
||||
[docker-ce-stable]
|
||||
name=Docker CE Stable - $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
||||
[docker-ce-stable-debuginfo]
|
||||
name=Docker CE Stable - Debuginfo $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/stable
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/stable
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
||||
[docker-ce-stable-source]
|
||||
name=Docker CE Stable - Sources
|
||||
baseurl=https://download.docker.com/linux/centos/7/source/stable
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/source/stable
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
||||
[docker-ce-edge]
|
||||
name=Docker CE Edge - $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/7/$basearch/edge
|
||||
[docker-ce-test]
|
||||
name=Docker CE Test - $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/test
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
||||
[docker-ce-edge-debuginfo]
|
||||
name=Docker CE Edge - Debuginfo $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/edge
|
||||
[docker-ce-test-debuginfo]
|
||||
name=Docker CE Test - Debuginfo $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/test
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
||||
[docker-ce-edge-source]
|
||||
name=Docker CE Edge - Sources
|
||||
baseurl=https://download.docker.com/linux/centos/7/source/edge
|
||||
[docker-ce-test-source]
|
||||
name=Docker CE Test - Sources
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/source/test
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
||||
[docker-ce-test]
|
||||
name=Docker CE Test - $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/7/$basearch/test
|
||||
[docker-ce-nightly]
|
||||
name=Docker CE Nightly - $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/nightly
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
||||
[docker-ce-test-debuginfo]
|
||||
name=Docker CE Test - Debuginfo $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/test
|
||||
[docker-ce-nightly-debuginfo]
|
||||
name=Docker CE Nightly - Debuginfo $basearch
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/nightly
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
||||
[docker-ce-test-source]
|
||||
name=Docker CE Test - Sources
|
||||
baseurl=https://download.docker.com/linux/centos/7/source/test
|
||||
[docker-ce-nightly-source]
|
||||
name=Docker CE Nightly - Sources
|
||||
baseurl=https://download.docker.com/linux/centos/$releasever/source/nightly
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=https://download.docker.com/linux/centos/gpg
|
||||
|
@ -1,36 +0,0 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=matrix-sms-bridge-database server
|
||||
{% for service in matrix_sms_bridge_database_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_sms_bridge_database_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStartPre=-/usr/bin/docker kill matrix-sms-bridge-database
|
||||
ExecStartPre=-/usr/bin/docker rm matrix-sms-bridge-database
|
||||
|
||||
# Intentional delay, so that the homeserver (we likely depend on) can manage to start.
|
||||
ExecStartPre=/bin/sleep 5
|
||||
|
||||
ExecStart=/usr/bin/docker run --rm --name matrix-sms-bridge-database \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_docker_network }} \
|
||||
-v {{ matrix_sms_bridge_database_path }}:/data:z \
|
||||
-e NEO4J_AUTH={{ matrix_sms_bridge_database_username }}/{{ matrix_sms_bridge_database_password }} \
|
||||
{{ matrix_sms_bridge_database_docker_image }}
|
||||
|
||||
ExecStop=-/usr/bin/docker kill matrix-sms-bridge-database
|
||||
ExecStop=-/usr/bin/docker rm matrix-sms-bridge-database
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-sms-bridge
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
- name: Run Docker System Prune
|
||||
command: "{{ matrix_host_command_docker }} system prune -a -f"
|
@ -0,0 +1,46 @@
|
||||
# Whether dynamic dns is enabled
|
||||
matrix_dynamic_dns_enabled: true
|
||||
|
||||
# The dynamic dns daemon interval
|
||||
matrix_dynamic_dns_daemon_interval: '300'
|
||||
|
||||
# The docker container to use when in mode
|
||||
matrix_dynamic_dns_docker_image: '{{ matrix_dynamic_dns_docker_image_name_prefix }}linuxserver/ddclient:v3.9.1-ls45'
|
||||
|
||||
matrix_dynamic_dns_docker_image_name_prefix: "{{ 'localhost/' if matrix_dynamic_dns_container_image_self_build else 'docker.io/' }}"
|
||||
|
||||
# The image to force pull
|
||||
matrix_dynamic_dns_docker_image_force_pull: "{{ matrix_dynamic_dns_docker_image.endswith(':latest') }}"
|
||||
|
||||
# List of extra arguments to pass to the ontainer mode
|
||||
matrix_dynamic_dns_container_extra_arguments: []
|
||||
|
||||
# List of wanted services when running in mode
|
||||
matrix_dynamic_dns_systemd_wanted_services_list: []
|
||||
|
||||
# List of required services when running in mode
|
||||
matrix_dynamic_dns_systemd_required_services_list: ['docker.service']
|
||||
|
||||
# Build the container from source when running in mode
|
||||
matrix_dynamic_dns_container_image_self_build: false
|
||||
matrix_dynamic_dns_container_image_self_build_repo: "https://github.com/linuxserver/docker-ddclient.git"
|
||||
|
||||
# Config paths
|
||||
matrix_dynamic_dns_base_path: "{{ matrix_base_data_path }}/dynamic-dns"
|
||||
matrix_dynamic_dns_config_path: "{{ matrix_dynamic_dns_base_path }}/config"
|
||||
matrix_dynamic_dns_docker_src_files_path: "{{ matrix_dynamic_dns_base_path }}/docker-src"
|
||||
|
||||
# Holds the configurations (the domains to update DNS for, the providers they use, etc.)
|
||||
#
|
||||
# Example:
|
||||
# matrix_dynamic_dns_domain_configurations:
|
||||
# - provider: domains.google.com
|
||||
# protocol: dyndn2
|
||||
# username: XXXXXXXXXXXXXXXX
|
||||
# password: XXXXXXXXXXXXXXXX
|
||||
# domain: "{{ matrix_domain }}"
|
||||
matrix_dynamic_dns_domain_configurations: []
|
||||
|
||||
# Config options
|
||||
matrix_dynamic_dns_additional_configuration_blocks: []
|
||||
matrix_dynamic_dns_use: "web"
|
@ -0,0 +1,3 @@
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-dynamic-dns'] }}"
|
||||
when: "matrix_dynamic_dns_enabled|bool"
|
@ -0,0 +1,61 @@
|
||||
---
|
||||
|
||||
- name: Ensure Dynamic DNS image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_dynamic_dns_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_dynamic_dns_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_dynamic_dns_docker_image_force_pull }}"
|
||||
when: matrix_dynamic_dns_enabled|bool and not matrix_dynamic_dns_container_image_self_build
|
||||
|
||||
- name: Ensure Dynamic DNS paths exist
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0751
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- { path: "{{ matrix_dynamic_dns_base_path }}", when: true }
|
||||
- { path: "{{ matrix_dynamic_dns_config_path }}", when: true }
|
||||
- { path: "{{ matrix_dynamic_dns_docker_src_files_path }}", when: "{{ matrix_dynamic_dns_container_image_self_build }}" }
|
||||
when: matrix_dynamic_dns_enabled|bool and item.when|bool
|
||||
|
||||
- name: Ensure Dynamic DNS repository is present on self build
|
||||
git:
|
||||
repo: "{{ matrix_dynamic_dns_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_dynamic_dns_docker_src_files_path }}"
|
||||
force: "yes"
|
||||
register: matrix_dynamic_dns_git_pull_results
|
||||
when: "matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure Dynamic DNS Docker image is built
|
||||
docker_image:
|
||||
name: "{{ matrix_dynamic_dns_docker_image }}"
|
||||
source: build
|
||||
force_source: "{{ matrix_dynamic_dns_git_pull_results.changed }}"
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_dynamic_dns_docker_src_files_path }}"
|
||||
pull: yes
|
||||
when: "matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure Dynamic DNS ddclient.conf installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/ddclient.conf.j2"
|
||||
dest: "{{ matrix_dynamic_dns_config_path }}/ddclient.conf"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-dynamic-dns.service installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-dynamic-dns.service.j2"
|
||||
dest: "/etc/systemd/system/matrix-dynamic-dns.service"
|
||||
mode: 0644
|
||||
register: matrix_dynamic_dns_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-dynamic-dns.service installation
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_dynamic_dns_systemd_service_result.changed"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue