A spam checker for Synapse designed to block upload or links to child sexual abuse imagery
  • Python 90.4%
  • Shell 7.9%
  • Dockerfile 1.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-07-31 22:32:56 +01:00
.github Screw building Synapse docker image 2022-10-31 23:15:34 +00:00
synapse_spamcheck_badlist Use run_as_background_process shim (#32) 2025-07-31 22:31:43 +01:00
test Use buildkit? 2022-10-31 23:07:56 +00:00
.dockerignore [CI] Support for CI tests 2020-12-22 16:25:37 +01:00
.gitignore Remove incorrectly-commited .egg-info (#14) 2021-06-08 11:42:02 +01:00
docker-compose.yaml [CI] Updating CI 2021-02-04 11:03:20 +01:00
Dockerfile Screw building Synapse docker image 2022-10-31 23:15:34 +00:00
LICENSE Initial commit 2020-12-15 11:46:05 +01:00
README.md Version bump and update minimum Synapse version (#25) 2021-09-15 16:07:41 +01:00
setup.py Bump version to 0.3.4 2025-07-31 22:32:56 +01:00

Synapse badlist filter

A simple spam checker module for Synapse, designed to block upload of identified child sexual abuse imagery and links to identified child sexual abuse websites.

This filter requires:

  • a database of links of identified child sexual abuse websites (as published by e.g. the IWF);
  • a database of MD5s of identified child sexual abuse imagery (as published by e.g. the IWF).

The filter:

  • rejects any message containing a link that matches the database;
  • rejects any upload containing a file that matches the database.

Requirements

You need Synapse >= 1.41.0.

Installation

In your Synapse python environment:

pip install git+https://github.com/matrix-org/synapse-spamcheck-badlist#egg=synapse-spamcheck-badlist

Then add to your homeserver.yaml:

modules:
  - module: "synapse_spamcheck_badlist.BadListFilter"
    config:
      # The URL of the server using this filter.
      base_url: "https://example.matrix.org"
      # The name of the table containing links.
      # It MUST contain at least one value `url TEXT PRIMARY KEY NOT NULL`.
      links_table: "image_filter.iwf_links"
      # The name of the table containing MD5s
      # It MUST contain at least one value `md5 TEXT PRIMARY KEY NOT NULL`.
      md5_table: "image_filter.iwf_md5"
      # How often we should check for changes in the database, in seconds.
      pull_from_db_every_sec: 600

Synapse will need to be restarted to apply the changes. Links added to the database will be used within pull_from_db_every_sec second, while MD5s added to the database will be used immediately.