feat(serverd): read settings from an openads.ini via --config#88
Conversation
Ex-Advantage users expect to keep server settings in a config file
(ADS shipped ads.cfg) rather than a long command line baked into a
service binPath. Add a dependency-free INI parser and a --config
<path> flag.
Recognised keys map 1:1 to the existing CLI options: host, port,
backlog, http_port, data, http_user (repeatable user:password).
Precedence is defaults < config file < command line, so an explicit
flag always wins over the file. Both the interactive path and the
Windows service path resolve args through the same loader.
- tools/serverd/config_ini.{h,cpp}: parse_ini / load_ini_file. Pure
C++17 (std::fstream/istringstream), works identically on
Windows/Linux/macOS. Tolerates CRLF, #/; comments and an optional
[server] header; rejects unknown keys and out-of-range ports with a
line-numbered message.
- tools/serverd/main.cpp: --config plumbing (apply_ini +
load_config_and_args), help text.
- tests/unit/serverd_config_ini_test.cpp: 11 cases / 42 assertions
covering every key, the has_* flags, aliases, comments, CRLF and the
error paths.
- openads.ini.sample: documented template.
Suite 795/795, 0 regression. Smoke: --config drives the bind and a
later --port overrides the file.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a minimal INI configuration parser for the OpenADS server daemon, allowing settings to be loaded from an openads.ini file via a new --config command-line flag. It includes a sample configuration file, comprehensive unit tests for the parser, and integrates the parser into the main server daemon executable so that command-line arguments override the INI file settings. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
What & why
Ex-Advantage users expect to keep server settings in a config file (ADS shipped
ads.cfg) rather than a long command line baked into a service binPath. This adds a dependency-free INI parser and a--config <path>flag toopenads_serverd.Recognised keys map 1:1 to the existing CLI options:
host,port,backlog,http_port,data,http_user(repeatableuser:password).Precedence is
defaults < config file < command line— an explicit flag always wins over the file. Both the interactive path and the Windows service path resolve args through the same loader, so a service registered with--config openads.inireloads its settings from the file on every start.This is the foundation for a
--setupwizard (separate PR, stacked) that writes such a file.Design notes
tools/serverd/config_ini.{h,cpp}:parse_ini/load_ini_file. Pure C++17 (std::ifstream/istringstream) — works identically on Windows/Linux/macOS, no new dependency. Tolerates CRLF,#/;comments and an optional[server]header; rejects unknown keys and out-of-range ports with a line-numbered message.tools/serverd/main.cpp:--configplumbing (apply_ini+load_config_and_args) + help text.openads.ini.sample: documented template.Validation
tests/unit/serverd_config_ini_test.cpp: 11 cases / 42 assertions covering every key, thehas_*precedence flags, dash/underscore aliases, comments, CRLF and all error paths.-WerrorON).--config openads.inidrives the bind; a later--port Non the same line overrides the file;--http-portfrom the file starts Studio.Coordination
Touches
tools/serverd/only (notace_exports.cpp/ the wire). Opening as a PR for @FiveTechSoft / Antonio to review and merge.