Files

47 lines
2.8 KiB
Python

"""Every path / env var / constant shared by the radio web app and the pipeline scripts (same env names and defaults as before)."""
import os
# ---- recordings -------------------------------------------------------------------------------
REC_DIR = os.environ.get("SDR_REC_DIR", "/srv/sdr/recordings")
CHANNELS_FILE = os.environ.get("SDR_CHANNELS", "/etc/sdr-scanner/channels.json")
MAX_LIST = 1500
# per-frequency long hold exists only since the patched scanner started (2026-10-20 06:01:58)
HOLD_SINCE = "20261020060158"
# recordings moved to the home-server HDD by sdr-archive are streamed from there (read-only HTTP)
ARCHIVE_URL = os.environ.get("SDR_ARCHIVE_URL", "http://192.168.88.221:18091")
# ---- web server -------------------------------------------------------------------------------
PORT = int(os.environ.get("SDR_WEB_PORT", "8090"))
# Only clients on the home LAN may switch the speaker: directly (their own address) or through the home Caddy,
# which passes the real client address in X-Home-Client for LAN/VPN visitors and strips it for everyone else.
HOME_PROXY = os.environ.get("SDR_HOME_PROXY", "192.168.88.221")
LAN_PREFIX = os.environ.get("SDR_LAN_PREFIX", "192.168.88.")
MAX_SSE = 32
# ---- speaker (sdr-speaker.service plays new voice recordings while "on") -----------------------
# Speakers on the Pi's 3.5 mm jack. SDR_SPEAKER_STATE is new (test instances); the default is the old fixed path.
SPEAKER_STATE = os.environ.get("SDR_SPEAKER_STATE", "/var/lib/sdr-speaker/state.json")
# ---- scanner status ---------------------------------------------------------------------------
SCANNER_UNIT = "sdr-scanner.service"
# ---- share links ------------------------------------------------------------------------------
SHARES_FILE = os.environ.get("SDR_SHARES", "/var/lib/sdr-web/shares.json")
CONV_GAP_S = 30 # same as the page: transmissions on one frequency closer than this are one conversation
# ---- discovered sources -----------------------------------------------------------------------
DISC_DIR = os.environ.get("SDR_DISC_DIR", "/srv/sdr/discovery")
SOURCES_FILE = os.path.join(DISC_DIR, "sources.json")
PROMOTED_FILE = os.path.join(DISC_DIR, "promoted.json")
ADSB_FILE = os.path.join(DISC_DIR, "adsb_latest.json")
MAX_PROMOTED = 40
# squelch raises written by classify/guard.py, applied by scanner/gen_config.py on the next scanner start
AUTO_SNR_FILE = os.path.join(DISC_DIR, "auto_snr.json")
# ---- transcripts (sdr-transcribe: Whisper on the desktop) -------------------------------------
TR_DIR = os.environ.get("SDR_TR_DIR", "/srv/sdr/transcripts") # YYYY-MM-DD.json + status.json
# ---- per-day index files in REC_DIR/YYYY-MM-DD/ (see radio/recordings.py) ----------------------
CLS_INDEX = ".cls.json" # written by sdr-classify
ARCH_INDEX = ".archived.json" # written by sdr-archive before it deletes the local files