No description
  • Python 96.8%
  • Dockerfile 3.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2023-09-24 22:51:00 +02:00
.github ci: finally working dcker push 2023-09-24 22:51:00 +02:00
pictrs_safety_api version incremented 2023-09-24 20:45:08 +00:00
.env_template feat: Added missing/stale worker threshold (#14) 2023-09-23 00:11:02 +02:00
.gitignore Scan threshold and auto-deploy to docker (#7) 2023-09-20 11:40:37 +02:00
api_server.py Scan threshold and auto-deploy to docker (#7) 2023-09-20 11:40:37 +02:00
CHANGELOG.md version incremented 2023-09-24 20:45:08 +00:00
docker-compose.yml update docker compose file to utilize variables for secrets (#13) 2023-09-20 18:36:55 +02:00
Dockerfile Initial dockerfile and docker compose. Tested to _start_ not tested in production yet (#3) 2023-09-19 23:12:34 +02:00
LICENSE Initial commit 2023-09-18 22:58:12 +02:00
README.md doc: readmew 2023-09-20 10:45:17 +02:00
requirements.txt Wal (#4) 2023-09-20 00:40:24 +02:00

pictrs-safety

Provides an API which can be used by pict-rs external_validation option

Setup

You need to copy .env_template into .env and then edit in your variables, or pass them as env variable

Afterwards you need to set up your pict-rs configuration to send the image valiation to this service's

PICTRS__MEDIA__EXTERNAL_VALIDATION=http://127.0.0.1:14051/api/v1/scan/IPADDR

The above assumes this services is running in the same host pict-rs is running. This will allow pict-rs to connect to it with minimum authentication

Connecting remotely

If your service is running in a different IP, change the 127.0.0.1 above to be your address, and then use either KNOWN_PICTRS_IDS or KNOWN_PICTRS_IPS in your .env to specify the authentication for pict-rs (or else anyone in the internet can upload images to your checker)

Serving via http

If you're going to consume this service only from your local pict-rs in localhost, you can just run this as a simply http service.

Start it with

python -i api_server.py

-i is insecure and will listen to all IPs by default. You can use -l to specify a different listen address

Serving via https

If you want to run service on https, you will need need to deploy a reverse proxy in front of it

Start it with

python api_server.py

This will only listen to 127.0.0.1

Docker setup

Add the docker-compose.yml contents into your docker compose. As this service is very lightweight, you can add it to the same docker-compose as your pict-rs.

fedi-safety

This tool has been also designed to be used along with fedi-safety. Check the relevant instructions on how to setup this connection.