# PANOSETI gRPC Environment Configuration (.env_example)
#
# Copy this file to `.env` in your working directory (or wherever you run
# pseti-grpc from) to customize server/CLI behavior without exporting
# variables in your shell profile.
#
# The `pseti-grpc` CLI (and `python -m panoseti_grpc`) automatically loads
# `.env` from the current working directory at startup -- see
# panoseti_grpc.util.env_loader.load_pseti_grpc_env(). To point at a
# specific file instead:
#   PSETI_GRPC_ENV_FILE=/path/to/my-site.env pseti-grpc server --profile gateway
#
# Values are plain `KEY=value` (no `export`) -- this file is parsed directly
# by python-dotenv, not sourced by a shell, so `export` is neither needed
# nor harmful either way. All values must be uncommented (remove the
# leading `#`) to take effect.

# ==============================================================================
# gRPC Host / Port
# ==============================================================================
#
# PSETI_GRPC_PORT is the single-node port knob for regular use: set it once
# and BOTH sides pick it up automatically --
#   - `pseti-grpc server` binds to it (PanosetiServerConfig.port's
#     default_factory) when no --port/--port-env is given.
#   - every `pseti-grpc` client command (stat, reflect, telemetry, daq-data,
#     daq-control, ...) connects to it by default (cli.py's global --port
#     option), so `pseti-grpc stat` "just works" against a server started
#     with this same .env, no --port needed on either side.
#
# This is unrelated to HEADNODE_GRPC_PORT/DAQNODE_GRPC_PORT (see panoseti's
# own .env.example) -- those are role-scoped vars for fleet deployments
# where a head node and a DAQ node may be co-located and need different
# ports; --port-env still exists for that case, and --port for a one-off
# explicit override. Both are deployment/debug-only and hidden from
# `pseti-grpc server -h` -- regular use should rely on PSETI_GRPC_PORT.
#
# Default: 50051
# PSETI_GRPC_PORT=50051

# PSETI_GRPC_HOST is the client-side counterpart: the hostname/IP every
# `pseti-grpc` command (stat, reflect, telemetry, daq-data, daq-control,
# ...) connects to by default (cli.py's global --host option), so you don't
# need --host on every invocation when probing a remote server. Servers
# don't read this -- `pseti-grpc server` always binds every interface
# (0.0.0.0), there's no equivalent "which host to bind" knob.
#
# This is unrelated to HEADNODE_IP as read by the telemetry logging
# pipeline (telemetry/client.py, telemetry/logger.py -- where a DAQ node's
# `get_logger(..., grpc_enabled=True)` ships logs to the headnode) -- that
# remains its own, separate env var for that fleet-wide production path.
#
# Default: localhost
# PSETI_GRPC_HOST=localhost

# ==============================================================================
# DaqData Gateway Configuration
# ==============================================================================
#
# Read by DaqDataGatewayServicer.startup() (only relevant when running
# `pseti-grpc server --profile gateway` or `--profile headnode`, i.e.
# `daq_data.role = "gateway"` in the server config) as a fallback for the
# [daq_data.gateway] daq_config_path / network_config_path fields in
# server_gateway.toml / server_headnode.toml. Precedence: the TOML config
# value always wins when set; these env vars are only consulted when the
# corresponding TOML field is left empty ("").
#
# This lets a fleet-wide value be provided once here instead of
# hand-editing server_gateway.toml/server_headnode.toml on every node.

# Path to the daq_config.json that lists all edge DAQ nodes the gateway
# should fan in.
# No default -- if neither this nor the TOML field is set, the gateway logs
# a warning and starts with zero edge nodes contacted.
# PSETI_GRPC_DAQ_CONFIG=/path/to/panoseti-software/control/configs/daq_config.json

# Path to network_config.json for port-forwarding overrides (optional --
# only needed when an edge node is reached through a forwarded gateway IP
# rather than directly).
# No default -- if neither this nor the TOML field is set, the gateway
# proceeds without any port-forwarding overrides (a warning is logged, but
# this is not fatal).
# PSETI_GRPC_NETWORK_CONFIG=/path/to/panoseti-software/control/configs/network_config.json
