From c8e8e80735286fa0f858275fd2a1ca03c92c1dab Mon Sep 17 00:00:00 2001 From: Raphael Maenle Date: Tue, 9 Jun 2026 19:00:45 +0200 Subject: [PATCH] secs_server: relative-path defaults so the binary runs outside docker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously --config / --state-table / --pj-state-table / --cj-state-table defaulted to /app/data/..., which only resolves inside the docker image. A host build run from the repo root errored out unless every flag was passed explicitly. Switch to data/equipment.yaml (and siblings) relative to CWD — docker still works because WORKDIR=/app puts /app/data/... at the same relative location, and host builds run from the repo root resolve to /data/.... Existing callers that pass explicit paths (the proof commands, tshark_validate.sh, secs4j_validate.sh, docker compose) are unaffected. Verified --validate-config under docker still finds all four YAMLs and the tshark proof still passes (69 frames, 0 malformed). Co-Authored-By: Claude Opus 4.7 --- apps/secs_server.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/secs_server.cpp b/apps/secs_server.cpp index 8a9c791..cea7c80 100644 --- a/apps/secs_server.cpp +++ b/apps/secs_server.cpp @@ -54,12 +54,16 @@ void refresh(gem::EquipmentDataModel& m, const gem::ControlStateMachine& sm) { int main(int argc, char** argv) { const auto port = static_cast(std::stoi(arg(argc, argv, "--port", "5000"))); - const auto equipment_yaml = arg(argc, argv, "--config", "/app/data/equipment.yaml"); - const auto state_yaml = arg(argc, argv, "--state-table", "/app/data/control_state.yaml"); + // Defaults are relative to the current working directory so the + // binary works both inside the docker image (WORKDIR=/app) and on a + // host build run from the repo root. Pass explicit --config etc. + // when running from anywhere else. + const auto equipment_yaml = arg(argc, argv, "--config", "data/equipment.yaml"); + const auto state_yaml = arg(argc, argv, "--state-table", "data/control_state.yaml"); const auto pj_state_yaml = arg(argc, argv, "--pj-state-table", - "/app/data/process_job_state.yaml"); + "data/process_job_state.yaml"); const auto cj_state_yaml = arg(argc, argv, "--cj-state-table", - "/app/data/control_job_state.yaml"); + "data/control_job_state.yaml"); const auto spool_dir = arg(argc, argv, "--spool-dir", ""); const bool validate_only = has_flag(argc, argv, "--validate-config");