Skip to content

flapi pack bundles a config without validating it, so a bad config only fails at startup #162

Closed

Description

@jrosskopf

What

flapi pack --in DIR --out BIN (src/main.cpp, the pack subcommand) returns before a ConfigManager ever loads the main config. It refuses secret files (*.env, *.pem, ...) but never checks that flapi.yaml is a configuration flAPI would accept. So it reports Packed ... for a bundle whose config cannot start:

The resulting single binary is then copied to a host and fails at startup — which is exactly the workflow packing exists to make safe (scp flapi-prod host).

Found by a Codex review of #161. It is not specific to server:: every config error behaves this way.

Suggested fix

Have pack load the input directory's main config through ConfigManager (the same path as --validate-config) before writing the bundle, and refuse — with that error — if it fails. Add a test that an invalid config produces no output file.

Note on a related limitation

The same review noted yaml-cpp does not expand YAML merge keys (<<: *defaults), so a key supplied through a merge is invisible to every lookup, http-port and server alike. Worth deciding whether main configs support merge keys or reject them explicitly; that belongs with #160 (unrecognised top-level keys).

Activity

  1. added a commit that references this issue on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions