| @@ -14,20 +14,18 @@ Instructions loosely based on [this](https://github.com/Half-Shot/matrix-appserv | |||||
| 1. Create a Discord Application [here](https://discordapp.com/developers/applications). | 1. Create a Discord Application [here](https://discordapp.com/developers/applications). | ||||
| 2. Retrieve Client ID. | 2. Retrieve Client ID. | ||||
| 3. Create a bot from the Bot tab and retrieve the Bot token. | 3. Create a bot from the Bot tab and retrieve the Bot token. | ||||
| 4. From the Bot tab, enable all checkboxes related to Privileged Gateway Intents (you can skip this step if you're not using `matrix_appservice_discord_auth_usePrivilegedIntents: true` below) | |||||
| 5. Enable the bridge with the following configuration in your `vars.yml` file: | |||||
| 4. Enable the bridge with the following configuration in your `vars.yml` file: | |||||
| ```yaml | ```yaml | ||||
| matrix_appservice_discord_enabled: true | matrix_appservice_discord_enabled: true | ||||
| matrix_appservice_discord_client_id: "YOUR DISCORD APP CLIENT ID" | matrix_appservice_discord_client_id: "YOUR DISCORD APP CLIENT ID" | ||||
| matrix_appservice_discord_bot_token: "YOUR DISCORD APP BOT TOKEN" | matrix_appservice_discord_bot_token: "YOUR DISCORD APP BOT TOKEN" | ||||
| matrix_appservice_discord_auth_usePrivilegedIntents: true | |||||
| ``` | ``` | ||||
| 6. If you've already installed Matrix services using the playbook before, you'll need to re-run it (`--tags=setup-all,start`). If not, proceed with [configuring other playbook services](configuring-playbook.md) and then with [Installing](installing.md). Get back to this guide once ready. | |||||
| 7. Retrieve Discord invite link from the `{{ matrix_appservice_discord_config_path }}/invite_link` file on the server (this defaults to `/matrix/appservice-discord/config/invite_link`). You need to peek at the file on the server via SSH, etc., because it's not available via HTTP(S). | |||||
| 8. Invite the Bot to Discord servers you wish to bridge. Administrator permission is recommended. | |||||
| 9. Room addresses follow this syntax: `#_discord_guildid_channelid`. You can easily find the guild and channel ids by logging into Discord in a browser and opening the desired channel. The URL will have this format: `discordapp.com/channels/guild_id/channel_id`. Once you have figured out the appropriate room addrss, you can join by doing `/join #_discord_guildid_channelid` in your Matrix client. | |||||
| 5. If you've already installed Matrix services using the playbook before, you'll need to re-run it (`--tags=setup-all,start`). If not, proceed with [configuring other playbook services](configuring-playbook.md) and then with [Installing](installing.md). Get back to this guide once ready. | |||||
| 6. Retrieve Discord invite link from the `{{ matrix_appservice_discord_config_path }}/invite_link` file on the server (this defaults to `/matrix/appservice-discord/config/invite_link`). You need to peek at the file on the server via SSH, etc., because it's not available via HTTP(S). | |||||
| 7. Invite the Bot to Discord servers you wish to bridge. Administrator permission is recommended. | |||||
| 8. Room addresses follow this syntax: `#_discord_guildid_channelid`. You can easily find the guild and channel ids by logging into Discord in a browser and opening the desired channel. The URL will have this format: `discordapp.com/channels/guild_id/channel_id`. Once you have figured out the appropriate room addrss, you can join by doing `/join #_discord_guildid_channelid` in your Matrix client. | |||||
| Other configuration options are available via the `matrix_appservice_discord_configuration_extension_yaml` variable. | Other configuration options are available via the `matrix_appservice_discord_configuration_extension_yaml` variable. | ||||
| @@ -10,7 +10,7 @@ This playbook doesn't support running on ARM (see [this issue](https://github.co | |||||
| - `root` access to your server (or a user capable of elevating to `root` via `sudo`). | - `root` access to your server (or a user capable of elevating to `root` via `sudo`). | ||||
| - [Python](https://www.python.org/) being installed on the server. Most distributions install Python by default, but some don't (e.g. Ubuntu 18.04) and require manual installation (something like `apt-get install python`). | |||||
| - [Python](https://www.python.org/) being installed on the server. Most distributions install Python by default, but some don't (e.g. Ubuntu 18.04) and require manual installation (something like `apt-get install python3`). On some distros, Ansible may incorrectly [detect the Python version](https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html) (2 vs 3) and you may need to explicitly specify the interpreter path in `inventory/hosts` during installation (e.g. `ansible_python_interpreter=/usr/bin/python3`) | |||||
| - A `cron`-like tool installed on the server such as `cron` or `anacron` to automatically schedule the Let's Encrypt SSL certificates's renewal. *This can be ignored if you use your own SSL certificates.* | - A `cron`-like tool installed on the server such as `cron` or `anacron` to automatically schedule the Let's Encrypt SSL certificates's renewal. *This can be ignored if you use your own SSL certificates.* | ||||
| @@ -10,6 +10,9 @@ | |||||
| # | # | ||||
| # If you're running this Ansible playbook on the same server as the one you're installing to, | # If you're running this Ansible playbook on the same server as the one you're installing to, | ||||
| # consider adding an additional `ansible_connection=local` argument below. | # consider adding an additional `ansible_connection=local` argument below. | ||||
| # | |||||
| # Ansible may fail to discover which Python interpreter to use on the host for some distros (like Ubuntu 20.04). | |||||
| # You may sometimes need to explicitly add `ansible_python_interpreter=/usr/bin/python3` to lines below. | |||||
| [matrix_servers] | [matrix_servers] | ||||
| matrix.<your-domain> ansible_host=<your-server's external IP address> ansible_ssh_user=root | matrix.<your-domain> ansible_host=<your-server's external IP address> ansible_ssh_user=root | ||||
| @@ -24,20 +24,6 @@ matrix_identity_server_url: "{{ ('https://' + matrix_server_fqn_matrix) if matri | |||||
| # | # | ||||
| ###################################################################### | ###################################################################### | ||||
| ###################################################################### | |||||
| # | |||||
| # matrix-architecture | |||||
| # | |||||
| ###################################################################### | |||||
| matrix_architecture: "amd64" | |||||
| ###################################################################### | |||||
| # | |||||
| # /matrix-architecture | |||||
| # | |||||
| ###################################################################### | |||||
| ###################################################################### | ###################################################################### | ||||
| # | # | ||||
| @@ -23,6 +23,17 @@ matrix_server_fqn_jitsi: "jitsi.{{ matrix_domain }}" | |||||
| matrix_federation_public_port: 8448 | matrix_federation_public_port: 8448 | ||||
| # The architecture that your server runs. | |||||
| # Recognized values by us are 'amd64', 'arm32' and 'arm64'. | |||||
| # Not all architectures support all services, so your experience (on non-amd64) may vary. | |||||
| # See docs/alternative-architectures.md | |||||
| matrix_architecture: amd64 | |||||
| # The architecture for Debian packages. | |||||
| # See: https://wiki.debian.org/SupportedArchitectures | |||||
| # We just remap from our `matrix_architecture` values to what Debian and possibly other distros call things. | |||||
| matrix_debian_arch: "{{ 'armhf' if matrix_architecture == 'arm32' else matrix_architecture }}" | |||||
| matrix_user_username: "matrix" | matrix_user_username: "matrix" | ||||
| matrix_user_groupname: "matrix" | matrix_user_groupname: "matrix" | ||||
| @@ -11,7 +11,7 @@ | |||||
| - name: Ensure Docker's APT key is trusted | - name: Ensure Docker's APT key is trusted | ||||
| apt_key: | apt_key: | ||||
| url: https://download.docker.com/linux/ubuntu/gpg | |||||
| url: "https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg" | |||||
| id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 | id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 | ||||
| state: present | state: present | ||||
| register: add_repository_key | register: add_repository_key | ||||
| @@ -20,7 +20,7 @@ | |||||
| - name: Ensure Docker repository is enabled | - name: Ensure Docker repository is enabled | ||||
| apt_repository: | apt_repository: | ||||
| repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable" | |||||
| repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable" | |||||
| state: present | state: present | ||||
| update_cache: yes | update_cache: yes | ||||
| when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' | when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' | ||||
| @@ -5,6 +5,7 @@ | |||||
| name: | name: | ||||
| - apt-transport-https | - apt-transport-https | ||||
| - ca-certificates | - ca-certificates | ||||
| - gnupg | |||||
| state: present | state: present | ||||
| update_cache: yes | update_cache: yes | ||||
| @@ -19,7 +20,7 @@ | |||||
| - name: Ensure Docker repository is enabled | - name: Ensure Docker repository is enabled | ||||
| apt_repository: | apt_repository: | ||||
| repo: "deb [arch=armhf] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable" | |||||
| repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable" | |||||
| state: present | state: present | ||||
| update_cache: yes | update_cache: yes | ||||
| when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' | when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' | ||||
| @@ -27,7 +28,6 @@ | |||||
| - name: Ensure APT packages are installed | - name: Ensure APT packages are installed | ||||
| apt: | apt: | ||||
| name: | name: | ||||
| - python-docker | |||||
| - "{{ matrix_ntpd_package }}" | - "{{ matrix_ntpd_package }}" | ||||
| - fuse | - fuse | ||||
| state: latest | state: latest | ||||
| @@ -37,5 +37,6 @@ | |||||
| apt: | apt: | ||||
| name: | name: | ||||
| - "{{ matrix_docker_package_name }}" | - "{{ matrix_docker_package_name }}" | ||||
| - "python{{'3' if ansible_python.version.major == 3 else ''}}-docker" | |||||
| state: latest | state: latest | ||||
| when: matrix_docker_installation_enabled|bool | when: matrix_docker_installation_enabled|bool | ||||