Cactus Comments is a federated comment system for the open web built on Matrix.
Deploy this app to Linode with a free $100 credit!
Cactus Comments is a federated comment system that you can embed anywhere. It respects your privacy, and puts you in control.
This is the application service backend for https://cactus.chat. It is a flask application written in Python. It interacts with the matrix server with pure HTTP calls and not through an SDK. If you want to deploy this, we recommend the docker image. If you want to hack on this, see HACKING.md. You can chat with us in the official Cactus Comments Matrix room.
This application is deployed and freely availble. To interact with it, start a
chat with
@cactusbot:cactus.chat
. You can
get started by typing "help"
or visiting
https://cactus.chat/docs/getting-started.
This part of the stack is mainly interacted with by site administrators. The purpose is to assign everyone a site, provide an interactive user interface and to help ease moderation. For now, this services creates rooms with proper permissions / initial configuration, bans users across your entire site and promotes moderators across your entire site.
Cactus Comments is free and open source software and you can run it yourself. Here we describe how to set it up in docker, connecting to Synapse.
First off, we need to register this appservice with Synapse.
Let's call the file cactus-appservice.yaml
. Synapse needs to be able to read
this file. Use this file as an sample and be sure to change the tokens:
# A unique, user-defined ID of the application service which will never change.
id: "Cactus Comments"
# Where the service is hosted:
url: "http://cactus:5000"
# Unique tokens used to authenticate requests between our service and the
# homeserver (and the other way). Use the sha256 hashes of something random.
# CHANGE THESE VALUES.
as_token: "a2d7789eedb3c5076af0864f4af7bef77b1f250ac4e454c373c806876e939cca"
hs_token: "b3b05236568ab46f0d98a978936c514eac93d8f90e6d5cd3895b3db5bb8d788b"
# User associated with our service. In this case "@cactusbot:yourserver.org"
sender_localpart: "cactusbot"
namespaces:
aliases:
- exclusive: true
regex: "#comments_.*"
Then you should add the file path to your synapse homeserver.yaml
:
app_service_config_files:
- "/path/to/cactus-appservice.yaml"
Additionally, you can set allow_guest_access: true
, to allow visitors to read
comments without logging in.
The application service is entirely configured with environment variables. If
you have changed the namespace room alias in the appservice registration above,
you need to set CACTUS_NAMESPACE_REGEX
and CACTUS_NAMESPACE_PREFIX
.
Otherwise, you just need 4 environment variables. Assume, that the following is
saved to a file, cactus.env
:
CACTUS_HS_TOKEN=b3b05236568ab46f0d98a978936c514eac93d8f90e6d5cd3895b3db5bb8d788b
CACTUS_AS_TOKEN=a2d7789eedb3c5076af0864f4af7bef77b1f250ac4e454c373c806876e939cca
CACTUS_HOMESERVER_URL=http://synapse:8008
CACTUS_USER_ID=@cactusbot:yourserver.org
In docker
, you need to run something like:
$ docker run --env-file cactus.env --name cactus cactuscomments/cactus-appservice:latest
In docker-compose
, this service might look like:
services:
cactus:
image: cactuscomments/cactus-appservice:latest
env_file: "cactus.env"
Copyright (C) 2021 Carl Bordum Hansen and Asbjørn Olling
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Please login to review this project.
No reviews for this project yet.
Comments (0)
Please login to join the discussion on this project.