{"id":44813784,"url":"https://github.com/maunium/synapse-http-antispam","last_synced_at":"2026-02-16T17:37:12.735Z","repository":{"id":281552786,"uuid":"945632382","full_name":"maunium/synapse-http-antispam","owner":"maunium","description":"A Synapse module that forwards spam checking to an HTTP server","archived":false,"fork":false,"pushed_at":"2025-06-27T13:19:53.000Z","size":32,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-28T02:03:10.756Z","etag":null,"topics":["matrix-synapse","spam-checker"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/synapse-http-antispam/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maunium.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-09T21:26:23.000Z","updated_at":"2025-08-13T08:23:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"0676506f-bb1d-4242-9c51-1aea33455d14","html_url":"https://github.com/maunium/synapse-http-antispam","commit_stats":null,"previous_names":["maunium/synapse-http-antispam"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/maunium/synapse-http-antispam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maunium%2Fsynapse-http-antispam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maunium%2Fsynapse-http-antispam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maunium%2Fsynapse-http-antispam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maunium%2Fsynapse-http-antispam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maunium","download_url":"https://codeload.github.com/maunium/synapse-http-antispam/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maunium%2Fsynapse-http-antispam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29514036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matrix-synapse","spam-checker"],"created_at":"2026-02-16T17:37:12.256Z","updated_at":"2026-02-16T17:37:12.723Z","avatar_url":"https://github.com/maunium.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# synapse-http-antispam\nA Synapse spam checker module that forwards requests to an HTTP server.\n\n## Discussion\nThis project was written for use with Meowlnir, so it can be discussed in the\nMeowlnir room: [#meowlnir:maunium.net](https://matrix.to/#/#meowlnir:maunium.net)\n\n## Installation\nIn the Python environment where Synapse is installed:\n\n```\npip install synapse-http-antispam\n```\n\nor if you want the main branch instead of the last release:\n\n```\npip install synapse-http-antispam@git+https://github.com/maunium/synapse-http-antispam.git\n```\n\n### Installation with Synapse Debian packages\nThe upstream Debian packages for Synapse create a virtualenv in\n`/opt/matrix-synapse`. You must install the module inside that virtualenv,\nnot globally on the system.\n\n### Installation inside Docker\nYou can make your own overlay image to install the module:\n\n```Dockerfile\nFROM matrixdotorg/synapse\n\nRUN pip install synapse-http-antispam\n```\n\nAlternatively, you can create a bind mount at runtime, e.g.\n\n```\ndocker run -v /path/to/synapse_http_antispam.py:/usr/local/lib/python3.12/site-packages/synapse_http_antispam.py:ro ...\n```\n\n(you need to acquire `synapse_http_antispam.py` yourself and may need to adjust\nthe python version in the path)\n\n## Configuration reference\nThe exact callbacks to enable depend on what you want to do with antispam.\nMost users should not read these docs and should instead refer to the docs\nof whatever antispam server they have. For example, if you want to block\ninvites, refer to the [Meowlnir] or [Draupnir] docs.\n\nIf you want to write your own antispam server or just want to find out all\navailable options, continue reading here.\n\n[Meowlnir]: https://docs.mau.fi/meowlnir/invite-blocking.html\n[Draupnir]: https://the-draupnir-project.github.io/draupnir-documentation/bot/synapse-http-antispam\n\nReference for the module configuration in `homeserver.yaml`:\n\n```yaml\nmodules:\n  - module: synapse_http_antispam.HTTPAntispam\n    config:\n      base_url: http://localhost:8080\n      authorization: random string\n      do_ping: true\n      enabled_callbacks:\n        - user_may_invite\n      async:\n        user_may_join_room: true\n      fail_open:\n        check_event_for_spam: true\n```\n\nIf `enabled_callbacks` is not specified, all callbacks will be enabled.\n\nSee \u003chttps://element-hq.github.io/synapse/v1.126/modules/spam_checker_callbacks.html\u003e\nfor the list of available callbacks. All callbacks except `check_media_file_for_spam`,\n`check_registration_for_spam` and `should_drop_federated_event` are available.\n\nThe module will make HTTP requests to `\u003cbase_url\u003e/\u003ccallback_name\u003e` with all\nfunction parameters as JSON fields. The `authorization` field will be sent as\na `Authorization: Bearer \u003cvalue\u003e` header if specified.\n\nThe response body must always be JSON. Any 2xx response will be return\n`NOT_SPAM` to Synapse. The content of 2xx responses is ignored, so an empty\nobject is sufficient. Any other response is treated as a rejection and the\nresponse body will be returned to the client as-is. If the `errcode` field is\nnot present in error responses, it will default to `M_FORBIDDEN`.\n\nIf the server returns a non-JSON response or if the request fails, the module\nwill fail closed and reject the callback with an `M_UNKNOWN` error by default,\nexcept for callbacks specified in `fail_open`. Additionally, the `check_event_for_spam`\ncallback will fail open by default, unless set to `false` in `fail_open`.\n\nAny callbacks set to `true` in the `async` map will be executed in the background\nand will always return `NOT_SPAM` to Synapse. The response status and data will\nbe ignored for async callbacks.\n\nif `do_ping` is set to `true`, the module will call the `ping` callback with an\n`id` field, expecting a response with the same ID and `\"status\": \"ok\"`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaunium%2Fsynapse-http-antispam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaunium%2Fsynapse-http-antispam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaunium%2Fsynapse-http-antispam/lists"}