mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2025-09-22 22:08:15 +02:00
.config
.github
LICENSES
bin
collections
docs
assets
README.md
alternative-architectures.md
ansible.md
configuring-captcha.md
configuring-dns.md
configuring-ipv6.md
configuring-playbook-alertmanager-receiver.md
configuring-playbook-appservice-double-puppet.md
configuring-playbook-appservice-draupnir-for-all.md
configuring-playbook-backup-borg.md
configuring-playbook-base-domain-serving.md
configuring-playbook-bot-baibot.md
configuring-playbook-bot-buscarron.md
configuring-playbook-bot-chatgpt.md
configuring-playbook-bot-draupnir.md
configuring-playbook-bot-go-neb.md
configuring-playbook-bot-honoroit.md
configuring-playbook-bot-matrix-registration-bot.md
configuring-playbook-bot-matrix-reminder-bot.md
configuring-playbook-bot-maubot.md
configuring-playbook-bot-mjolnir.md
configuring-playbook-bridge-appservice-discord.md
configuring-playbook-bridge-appservice-irc.md
configuring-playbook-bridge-appservice-kakaotalk.md
configuring-playbook-bridge-appservice-slack.md
configuring-playbook-bridge-appservice-webhooks.md
configuring-playbook-bridge-beeper-linkedin.md
configuring-playbook-bridge-go-skype-bridge.md
configuring-playbook-bridge-heisenbridge.md
configuring-playbook-bridge-hookshot.md
configuring-playbook-bridge-matrix-bridge-sms.md
configuring-playbook-bridge-mautrix-bluesky.md
configuring-playbook-bridge-mautrix-bridges.md
configuring-playbook-bridge-mautrix-discord.md
configuring-playbook-bridge-mautrix-facebook.md
configuring-playbook-bridge-mautrix-gmessages.md
configuring-playbook-bridge-mautrix-googlechat.md
configuring-playbook-bridge-mautrix-hangouts.md
configuring-playbook-bridge-mautrix-instagram.md
configuring-playbook-bridge-mautrix-meta-instagram.md
configuring-playbook-bridge-mautrix-meta-messenger.md
configuring-playbook-bridge-mautrix-signal.md
configuring-playbook-bridge-mautrix-slack.md
configuring-playbook-bridge-mautrix-telegram.md
configuring-playbook-bridge-mautrix-twitter.md
configuring-playbook-bridge-mautrix-whatsapp.md
configuring-playbook-bridge-mautrix-wsproxy.md
configuring-playbook-bridge-mx-puppet-discord.md
configuring-playbook-bridge-mx-puppet-groupme.md
configuring-playbook-bridge-mx-puppet-instagram.md
configuring-playbook-bridge-mx-puppet-skype.md
configuring-playbook-bridge-mx-puppet-slack.md
configuring-playbook-bridge-mx-puppet-steam.md
configuring-playbook-bridge-mx-puppet-twitter.md
configuring-playbook-bridge-postmoogle.md
configuring-playbook-bridge-wechat.md
configuring-playbook-cactus-comments.md
configuring-playbook-client-cinny.md
configuring-playbook-client-element-web.md
configuring-playbook-client-fluffychat-web.md
configuring-playbook-client-hydrogen.md
configuring-playbook-client-schildichat-web.md
configuring-playbook-conduit.md
configuring-playbook-conduwuit.md
configuring-playbook-continuwuity.md
configuring-playbook-dendrite.md
configuring-playbook-dimension.md
configuring-playbook-dynamic-dns.md
configuring-playbook-element-call.md
configuring-playbook-email.md
configuring-playbook-email2matrix.md
configuring-playbook-etherpad.md
configuring-playbook-external-postgres.md
configuring-playbook-federation.md
configuring-playbook-jitsi.md
configuring-playbook-jwt-service.md
configuring-playbook-ldap-auth.md
configuring-playbook-livekit-jwt-service.md
configuring-playbook-livekit-server.md
configuring-playbook-ma1sd.md
configuring-playbook-matrix-authentication-service.md
configuring-playbook-matrix-corporal.md
configuring-playbook-matrix-ldap-registration-proxy.md
configuring-playbook-matrix-media-repo.md
configuring-playbook-matrix-registration.md
configuring-playbook-matrix-rtc.md
configuring-playbook-nginx.md
configuring-playbook-ntfy.md
configuring-playbook-own-webserver.md
configuring-playbook-pantalaimon.md
configuring-playbook-postgres-backup.md
configuring-playbook-prometheus-grafana.md
configuring-playbook-rageshake.md
configuring-playbook-rest-auth.md
configuring-playbook-riot-web.md
configuring-playbook-s3-goofys.md
configuring-playbook-s3.md
configuring-playbook-shared-secret-auth.md
configuring-playbook-sliding-sync-proxy.md
configuring-playbook-ssl-certificates.md
configuring-playbook-sygnal.md
configuring-playbook-synapse-admin.md
configuring-playbook-synapse-auto-accept-invite.md
configuring-playbook-synapse-auto-compressor.md
configuring-playbook-synapse-s3-storage-provider.md
configuring-playbook-synapse-simple-antispam.md
configuring-playbook-synapse-usage-exporter.md
configuring-playbook-synapse.md
configuring-playbook-telemetry.md
configuring-playbook-traefik.md
configuring-playbook-turn.md
configuring-playbook-user-verification-service.md
configuring-playbook.md
configuring-well-known.md
container-images.md
faq.md
getting-the-playbook.md
howto-server-delegation.md
howto-srv-server-delegation.md
importing-postgres.md
importing-synapse-media-store.md
importing-synapse-sqlite.md
installing.md
just.md
maintenance-and-troubleshooting.md
maintenance-migrating.md
maintenance-postgres.md
maintenance-synapse.md
maintenance-upgrading-services.md
obtaining-access-tokens.md
playbook-tags.md
prerequisites.md
quick-start.md
registering-users.md
self-building.md
uninstalling.md
updating-users-passwords.md
examples
group_vars
i18n
roles
.editorconfig
.envrc
.gitattributes
.gitignore
.yamllint
CHANGELOG.md
CHANGELOG.md.license
LICENSE
Makefile
README.md
README.md.license
REUSE.toml
YEAR-IN-REVIEW.md
ansible.cfg
conf.py
flake.lock
flake.nix
jitsi_jvb.yml
justfile
requirements.yml
setup.yml
setup.yml.license
Apparently ensure-matrix-users-created is relevant only for components registered to "matrix_user_creator_users_auto" on group_vars/matrix_servers. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
155 lines
7.7 KiB
Markdown
155 lines
7.7 KiB
Markdown
<!--
|
|
SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
|
|
SPDX-FileCopyrightText: 2022 Julian-Samuel Gebühr
|
|
SPDX-FileCopyrightText: 2023 MDAD project contributors
|
|
SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
-->
|
|
|
|
# Setting up Cactus Comments (optional)
|
|
|
|
The playbook can install and configure the [Cactus Comments](https://cactus.chat) system for you.
|
|
|
|
Cactus Comments is a **federated comment system** built on Matrix. It respects your privacy, and puts you in control.
|
|
|
|
See the project's [documentation](https://cactus.chat/docs/getting-started/introduction/) to learn what it does and why it might be useful to you.
|
|
|
|
The playbook contains 2 roles for configuring different pieces of the Cactus Comments system:
|
|
|
|
- `matrix-cactus-comments` — the backend appservice integrating with the Matrix homeserver
|
|
|
|
- `matrix-cactus-comments-client` — a static website server serving the [cactus-client](https://cactus.chat/docs/client/introduction/) static assets (`cactus.js` and `styles.css`)
|
|
|
|
You can enable whichever component you need (typically both).
|
|
|
|
## Adjusting DNS records (optional)
|
|
|
|
By default, this playbook installs Cactus Comments' client on the `matrix.` subdomain, at the `/cactus-comments` path (https://matrix.example.com/cactus-comments). This makes it easy to install it, because it **doesn't require additional DNS records to be set up**. If that's okay, you can skip this section.
|
|
|
|
If you wish to adjust it, see the section [below](#adjusting-the-cactus-comments-client-url-optional) for details about DNS configuration.
|
|
|
|
## Adjusting the playbook configuration
|
|
|
|
To enable Cactus Comments, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
|
|
|
|
```yaml
|
|
# This enables the backend (appservice)
|
|
matrix_cactus_comments_enabled: true
|
|
|
|
# This enables client assets static files serving on `https://matrix.example.com/cactus-comments`.
|
|
# When the backend (appservice) is enabled, this is also enabled automatically, but we explicitly enable it here.
|
|
matrix_cactus_comments_client_enabled: true
|
|
|
|
# Uncomment and adjust this part if you'd like to use a username different than the default
|
|
# matrix_cactus_comments_user_id: "bot.cactusbot"
|
|
|
|
# To allow guest comments without users needing to log in, you need to have guest registration enabled.
|
|
# To do this you need to uncomment one of the following lines (depending if you are using Synapse or Dendrite as a homeserver)
|
|
# If you don't know which one you use: The default is Synapse ;)
|
|
# matrix_synapse_allow_guest_access: true
|
|
# matrix_dendrite_allow_guest_access: true
|
|
```
|
|
|
|
### Adjusting the Cactus Comments' client URL (optional)
|
|
|
|
By tweaking the `matrix_cactus_comments_client_hostname` and `matrix_cactus_comments_client_path_prefix` variables, you can easily make the service available at a **different hostname and/or path** than the default one.
|
|
|
|
Example additional configuration for your `vars.yml` file:
|
|
|
|
```yaml
|
|
# Change the default hostname and path prefix to host the client assets at a different location
|
|
# These variables are used only if (`matrix_cactus_comments_client_enabled: true`)
|
|
matrix_cactus_comments_client_hostname: cactus.example.com
|
|
matrix_cactus_comments_client_path_prefix: /
|
|
```
|
|
|
|
If you've changed the default hostname, you may need to create a CNAME record for the Cactus Comments' client domain (`cactus.example.com`), which targets `matrix.example.com`.
|
|
|
|
When setting, replace `example.com` with your own.
|
|
|
|
### Extending the configuration
|
|
|
|
There are some additional things you may wish to configure about the components.
|
|
|
|
For `matrix-cactus-comments`, take a look at:
|
|
|
|
- `roles/custom/matrix-cactus-comments/defaults/main.yml` for some variables that you can customize via your `vars.yml` file
|
|
|
|
For `matrix-cactus-comments-client`, take a look at:
|
|
|
|
- `roles/custom/matrix-cactus-comments-client/defaults/main.yml` for some variables that you can customize via your `vars.yml` file
|
|
|
|
## Installing
|
|
|
|
After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the playbook with [playbook tags](playbook-tags.md) as below:
|
|
|
|
<!-- NOTE: let this conservative command run (instead of install-all) to make it clear that failure of the command means something is clearly broken. -->
|
|
```sh
|
|
ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start
|
|
```
|
|
|
|
The shortcut commands with the [`just` program](just.md) are also available: `just install-all` or `just setup-all`
|
|
|
|
`just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too.
|
|
|
|
## Usage
|
|
|
|
To use the component, you need to start a chat with `@bot.cactusbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain).
|
|
|
|
Then, register a site by sending `register YOUR_SITE_NAME_HERE` (where `YOUR_SITE_NAME_HERE` is a unique identifier you choose. It does not have to match your domain). You will then be invited into a moderation room.
|
|
|
|
Now you are good to go and can embed the comment section on your website!
|
|
|
|
## Embed Cactus Comments
|
|
|
|
The official [documentation](https://cactus.chat/docs/getting-started/quick-start/) provides a useful guide to embed Cactus Comments on your website.
|
|
|
|
After including the JavaScript and CSS asset files, insert a `<div>` where you'd like to display the comment section:
|
|
|
|
````html
|
|
<div id="comment-section"></div>
|
|
````
|
|
|
|
Then, you need to initialize the comment section. Make sure to replace `example.com` with your base domain and `YOUR_SITE_NAME_HERE` with the one that has been registered above:
|
|
|
|
```html
|
|
<script>
|
|
initComments({
|
|
node: document.getElementById("comment-section"),
|
|
defaultHomeserverUrl: "https://matrix.example.com:8448",
|
|
serverName: "example.com",
|
|
siteName: "YOUR_SITE_NAME_HERE",
|
|
commentSectionId: "1"
|
|
})
|
|
</script>
|
|
```
|
|
|
|
### Adjust the domain name for self-hosting
|
|
|
|
To have the assets served from your homeserver (not from `cactus.chat`), you need to adjust the domain name on the official documentation.
|
|
|
|
Make sure to replace `example.com` with your base domain before you include the following lines, instead of the one provided by the official documentation:
|
|
|
|
```html
|
|
<script type="text/javascript" src="https://matrix.example.com/cactus-comments/cactus.js"></script>
|
|
<link rel="stylesheet" href="https://matrix.example.com/cactus-comments/style.css" type="text/css">
|
|
```
|
|
|
|
**Note**: if the `matrix_cactus_comments_client_hostname` and `matrix_cactus_comments_client_path_prefix` variables are tweaked, you would need to adjust the URLs of the assets accordingly.
|
|
|
|
## Troubleshooting
|
|
|
|
As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-cactus-comments` for the backend appservice or `journalctl -fu matrix-cactus-comments-client` for the server serving the client assets, respectively.
|
|
|
|
### Increase logging verbosity
|
|
|
|
It is possible to increase logging verbosity for `matrix-cactus-comments-client`. The default logging level for this component is `error`. If you want to increase the verbosity, add the following configuration to your `vars.yml` file and re-run the playbook:
|
|
|
|
```yaml
|
|
# Controls the SERVER_LOG_LEVEL environment variable.
|
|
# See: https://static-web-server.net/configuration/environment-variables/
|
|
# Valid values: error, warn, info, debug, trace
|
|
matrix_cactus_comments_client_environment_variable_server_log_level: debug
|
|
```
|