Reference for the Cactus Comments backend Application Service.
Application services are programs that run next to homeservers to augment their capabilities.
The purpose of the Cactus Comments application service is to manage comment section rooms in collaboration with the homeserver. For a given site, the application service is responsible for creating rooms on-demand for new comment sections and to manage moderation roles across all of the comment sections on the site.
Additionally, the application service provides a chatbot-like interface for users to register their site through.
The Cactus Comments application service implements the Application Service API. This means we have to expose an HTTP web server. We implemented our web server in the flask microframework and the entire application in Python 3.9. We interact with the Matrix homeserver with pure HTTP calls and not through an SDK using the requests HTTP library. The application is containerized with docker. You can read and contribute to the entire source code here.
The application service provides a chatbot interface for site administrators.
You can access the interface by inviting @cactusbot:cactus.chat to a
cactusbot has joined
your room, type
help to get the up-to-date documentation for the chatbot
The Cactus Comment application service is entirely configured with environment variables. You only need to configure the appservice if you are self-hosting Cactus Comments and not when using the public @cactusbot:cactus.chat.
|CACTUS_HS_TOKEN||Yes||The token used to authenticate the homeserver. This should match
|CACTUS_AS_TOKEN||Yes||The token used to authenticate the application service to the homeserver. This should match
|CACTUS_HOMESERVER_URL||Yes||The complete URL of the homeserver that the application service is registered with.|
|CACTUS_USER_ID||Yes||The user id for the chatbot interface. This should be based on
|CACTUS_NAMESPACE_REGEX||No||The regex for room aliases that the application service controls. This should match the regex in the registration YAML file. Example:
|CACTUS_NAMESPACE_PREFIX||No||The prefix of room aliases that the application service controls. This should only be set if
CACTUS_NAMESPACE_PREFIX exists in case you want
to change the room alias regex that the application service controls. This is
useful if you want to run multiple Cactus Comments deployments on the same