Mirror of https://github.com/roostorg/coop
github.com/roostorg/coop
1# Copyright (c) Meta Platforms, Inc. and affiliates.
2
3"""
4A development version of an omm_config, with every field visible and commented.
5
6This is the configuration that is used by default for the developer instance
7which runs in the dev container by default. Every config field is present
8to make it easier to copy the file as a template for others.
9"""
10
11import logging
12import os
13
14from OpenMediaMatch.storage.postgres.impl import DefaultOMMStore
15from OpenMediaMatch.utils.fetch_benchmarking import InfiniteRandomExchange
16from threatexchange.signal_type.pdq.signal import PdqSignal
17from threatexchange.signal_type.md5 import VideoMD5Signal
18from threatexchange.content_type.photo import PhotoContent
19from threatexchange.content_type.video import VideoContent
20from threatexchange.exchanges.impl.static_sample import StaticSampleSignalExchangeAPI
21from threatexchange.exchanges.impl.ncmec_api import NCMECSignalExchangeAPI
22from threatexchange.exchanges.impl.stop_ncii_api import StopNCIISignalExchangeAPI
23from threatexchange.exchanges.impl.fb_threatexchange_api import (
24 FBThreatExchangeSignalExchangeAPI,
25)
26
27# Database configuration
28DBUSER = os.environ.get("POSTGRES_USER", "postgres")
29DBPASS = os.environ.get("POSTGRES_PASSWORD", "postgres123")
30DBHOST = os.environ.get("POSTGRES_HOST", "postgres")
31DBNAME = os.environ.get("POSTGRES_DB", "postgres")
32DATABASE_URI = f"postgresql+psycopg2://{DBUSER}:{DBPASS}@{DBHOST}/{DBNAME}"
33
34# Role configuration
35PRODUCTION = False
36ROLE_HASHER = True
37ROLE_MATCHER = True
38ROLE_CURATOR = True
39UI_ENABLED = True
40# APScheduler (background threads for development)
41TASK_FETCHER = True
42TASK_INDEXER = True
43TASK_INDEX_CACHE = True
44
45
46TASK_FETCHER_INTERVAL_SECONDS = 60 * 5
47TASK_INDEXER_INTERVAL_SECONDS = 60 * 2
48TASK_INDEX_CACHE_INTERVAL_SECONDS = 60
49MAX_REMOTE_FILE_SIZE = 100 * 1024 * 1024 # 100MB max file size
50
51# Core functionality configuration
52STORAGE_IFACE_INSTANCE = DefaultOMMStore(
53 signal_types=[PdqSignal, VideoMD5Signal],
54 content_types=[PhotoContent, VideoContent],
55 exchange_types=[
56 FBThreatExchangeSignalExchangeAPI, # type: ignore
57 NCMECSignalExchangeAPI, # type: ignore
58 StopNCIISignalExchangeAPI,
59 ],
60)
61
62# Debugging stuff
63# SQLALCHEMY_ENGINE_LOG_LEVEL = logging.INFO