Skip to content

Start the server without --config - #211

Merged
ccomb merged 3 commits into
mainfrom
config-optional
Jul 15, 2026
Merged

Start the server without --config#211
ccomb merged 3 commits into
mainfrom
config-optional

Conversation

@ccomb

@ccomb ccomb commented Jul 14, 2026

Copy link
Copy Markdown
Owner

A throwaway or upload-driven server previously required a config file on disk even when everything about it was default — launchers wrote an empty TOML file just to satisfy the flag. volca server (and the existing stop) now run on the built-in defaults when --config is absent: no databases, everything loadable over the API.

Both paths funnel through the new Config.loadConfigOrDefault, so the defaults are validated and honour VOLCA_DATA_DIR exactly like a parsed file, and an explicit --config path that does not exist still fails loudly — a typo must never silently become "all defaults". Other commands keep requiring the flag: without a config they have neither databases nor a server address to act on.

ccomb added 3 commits July 14, 2026 23:23
A throwaway or upload-driven server previously required a config file on
disk even when everything about it was default — launchers wrote an
empty TOML just to satisfy the flag. `volca server` (and the existing
`stop`) now run on the built-in defaults when --config is absent:
no databases, everything loadable over the API.

Both paths funnel through the new Config.loadConfigOrDefault, so the
defaults are validated and honour VOLCA_DATA_DIR exactly like a parsed
file, and an explicit --config path that does not exist still fails
loudly (a typo must never silently become "all defaults"). Other
commands keep requiring the flag: without a config they have neither
databases nor a server address to act on.
Starting on built-in defaults logs an explicit Info line, and each
--load name that matches no configured database gets a Warning: the
override silently loaded nothing for it — guaranteed on the defaults,
which configure no databases. Diagnosing a --config accidentally dropped
from a launcher no longer requires inferring it from the database count.
The default branch duplicated the VOLCA_DATA_DIR + validateConfig steps,
so the docstring's 'both paths' promise rested on parallel maintenance.
loadConfig is now the Just case of the shared pipeline, making the
promise true by construction. Also notes in the README that --config is
optional for server and stop.
@ccomb

ccomb commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

Suite de revue — correctifs poussés :

  • Démarrage sans --config observable : ligne Info explicite (« running on built-in defaults »), et chaque nom de --load qui ne correspond à aucune base configurée émet un Warning — sur les défauts (zéro base), l'override chargeait silencieusement rien. Vérifié en réel : volca server --load foo sans config affiche bien les deux lignes.
  • Pipeline unique : loadConfig devient le cas Just de loadConfigOrDefault ; la promesse « les deux chemins honorent VOLCA_DATA_DIR et valident » est vraie par construction au lieu de reposer sur une maintenance parallèle.
  • Haddock de runServerWithConfig ajusté, README : --config noté optionnel pour server et stop.

@ccomb
ccomb merged commit c2067c5 into main Jul 15, 2026
9 checks passed
@ccomb
ccomb deleted the config-optional branch July 15, 2026 02:33
ccomb added a commit that referenced this pull request Jul 15, 2026
`Server(config=None)` spawns the engine with no `--config` at all:
built-in defaults, no databases — what a converter or upload-driven
script wants. Needs an engine >= v0.9.3, which learned to run
config-less (#211).

Two silent failure modes die with it. A config *path* that does not
exist now fails loudly at `start()` instead of the engine dying behind
the scenes — the docstring used to claim "missing file is tolerated"
while the spawned engine refused it. And an engine that exits before
serving (the likeliest config-less cause: an engine too old) fails
immediately with its exit code and a version hint, instead of hanging
until the readiness timeout.

Verified end-to-end against a locally built v0.9.3: `Server(config=None,
port="auto")` boots, answers `/version` with wire 3, and lists the
uploads it rediscovers from the shared data dir. 233 tests green (4
new).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant