Add config_local.py override pattern for sensitive settings
config.py now imports config_local.py at the bottom if present (gitignored). Sensitive defaults (real archive passwords, personal tdl namespace) removed from config.py and documented in config_local.py.example instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -20,6 +20,7 @@ data/logs/
|
||||
|
||||
# Env
|
||||
.env
|
||||
config_local.py
|
||||
|
||||
# Python
|
||||
__pycache__/
|
||||
|
||||
41
config.py
41
config.py
@@ -41,23 +41,7 @@ _DEFAULT_KEYWORDS: list[str] = [
|
||||
|
||||
# Use usernames (without @) or numeric channel IDs (-100xxxxxxxxxx)
|
||||
_DEFAULT_CHANNELS: list[str | int] = [
|
||||
#-1002230225603,
|
||||
#"cloudxlog",
|
||||
##-1001967030016, # daisycloud
|
||||
##"berserklogs", # berserklogs
|
||||
##"BorwitaFreeLogs", # borwita
|
||||
#-1002748707556, # darkcloud
|
||||
#-1001684073398, # BHF Cloud
|
||||
#-1003163621939, # Wich Love from R
|
||||
#-1003611713618, # Khazan Cloud
|
||||
#-1003328682684, # LogsPlanet
|
||||
#-1003204260194, # JDP
|
||||
#-1002828367761, # HesoyamCloud
|
||||
#-1003513974925, # Slurm Logs
|
||||
#-1003599300787, # Arhont Corp
|
||||
#-1002582513379, # OnlyLogs
|
||||
#-1002788333372, # Ickis Cloud
|
||||
-1002643355608, # Cloud URL
|
||||
#"channelName",
|
||||
#-1001234567890, # private channel by ID
|
||||
]
|
||||
|
||||
@@ -122,15 +106,13 @@ MAX_FILE_SIZE = 4 * 1024 * 1024 * 1024 # 4 GB (Telegram Premium max)
|
||||
|
||||
# ─── Archive passwords to try ────────────────────────────────────────────────
|
||||
ARCHIVE_PASSWORDS: list[bytes] = [
|
||||
b"1234",
|
||||
b"0000",
|
||||
b"infected",
|
||||
b"telegram",
|
||||
b"password",
|
||||
b"12345",
|
||||
b"",
|
||||
b"Borwita",
|
||||
b"@WichLoveFromR",
|
||||
b"infected",
|
||||
b"password",
|
||||
b"1234",
|
||||
b"12345",
|
||||
b"0000",
|
||||
b"telegram",
|
||||
]
|
||||
|
||||
# ─── Backfill settings ───────────────────────────────────────────────────────
|
||||
@@ -141,7 +123,7 @@ BACKFILL_LIMIT = 500
|
||||
# Namespace tdl was logged into. Run `tdl login` with no -n flag → namespace
|
||||
# is "default". Run `tdl login -n foo` → namespace is "foo".
|
||||
# Set to None to omit -n entirely (tdl will use "default" anyway).
|
||||
TDL_NAMESPACE: str | None = "ulpmon"
|
||||
TDL_NAMESPACE: str | None = "monitor_session"
|
||||
|
||||
# Parallel chunk workers per file (-t / --threads global flag)
|
||||
TDL_THREADS = 8
|
||||
@@ -156,3 +138,10 @@ TDL_AMOUNT = 4
|
||||
# Whether to use a Telegram takeout session for downloads (lower flood limits).
|
||||
# Takeout sessions are rate-limited differently - good for bulk backfill.
|
||||
TDL_TAKEOUT = True
|
||||
|
||||
# ─── Local overrides (gitignored) ────────────────────────────────────────────
|
||||
# Create config_local.py to override any value above without touching this file.
|
||||
try:
|
||||
from config_local import * # noqa: F401, F403
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
26
config_local.py.example
Normal file
26
config_local.py.example
Normal file
@@ -0,0 +1,26 @@
|
||||
# config_local.py - machine-specific overrides (copy to config_local.py, never commit)
|
||||
# Any name defined here replaces the value in config.py at import time.
|
||||
|
||||
# Extra archive passwords specific to your targets
|
||||
ARCHIVE_PASSWORDS: list[bytes] = [
|
||||
b"",
|
||||
b"infected",
|
||||
b"password",
|
||||
b"1234",
|
||||
# add your own below
|
||||
]
|
||||
|
||||
# tdl namespace you logged into (tdl login -n <name>)
|
||||
TDL_NAMESPACE: str | None = "monitor_session"
|
||||
|
||||
# Default keyword patterns (overridden by runtime_config.json when present)
|
||||
_DEFAULT_KEYWORDS: list[str] = [
|
||||
r"yourdomain\.com",
|
||||
r"@yourdomain\.com",
|
||||
]
|
||||
|
||||
# Default channels (overridden by runtime_config.json when present)
|
||||
_DEFAULT_CHANNELS: list[str | int] = [
|
||||
# "channelname",
|
||||
# -1001234567890,
|
||||
]
|
||||
Reference in New Issue
Block a user