Skip to main content

A Synapse module that forwards spam checking to an HTTP server

Project description

synapse-http-antispam

A Synapse spam checker module that forwards requests to an HTTP server.

Installation

pip install synapse-http-antispam

or

pip install git+https://github.com/maunium/synapse-http-antispam#egg=synapse-http-antispam

Configuration

Add the following to your homeserver.yaml:

modules:
  - module: synapse_http_antispam.HTTPAntispam
    config:
      base_url: http://localhost:8080
      enabled_callbacks:
        - user_may_invite

If enabled_callbacks is not specified, all callbacks will be enabled.

See https://element-hq.github.io/synapse/v1.126/modules/spam_checker_callbacks.html for the list of available callbacks. All callbacks except check_media_file_for_spam are available.

The module will make HTTP requests to <base_url>/<callback_name> with all function parameters as JSON fields.

Any 2xx response will be return NOT_SPAM to Synapse and the response body will be ignored.

Any other response is treated as a rejection. The response body must be JSON and will be returned to the client as is. If the errcode field is not present, it will default to M_FORBIDDEN.

If the server returns a non-JSON response or if the request fails, the module will fail closed and reject the callback with an M_UNKNOWN error.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synapse_http_antispam-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synapse_http_antispam-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file synapse_http_antispam-0.1.0.tar.gz.

File metadata

  • Download URL: synapse_http_antispam-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for synapse_http_antispam-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2fd23f2116f75007accb6aa333495532dd5ee94412da09de255ac9f73bab76a6
MD5 c60383c238b4114820753472ce72033e
BLAKE2b-256 34993c9453754b018d919dc9615ed3b47524ca15124d5782d7289c31331f904e

See more details on using hashes here.

File details

Details for the file synapse_http_antispam-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for synapse_http_antispam-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5945f7f878b7143fae98aafc50277b8eb69498f74bdf1e4d600fd1f0023a9dd
MD5 a58d2a38d17fc6a9d02e57e8d8a5df52
BLAKE2b-256 a223adbb83874c50eb6d39b4cd29e4a92871fa8ad18ba5d61f5505de106dcd36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page