ccfos / ccfos/huatuo

Docker image default config fails strict TOML decoding

Open Beginner friendly
#830 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.1k
Forks
139
Avg merge
3d 16h
Merged PRs (30d)
18

Description

What happened?

The release-image build rewrites the bundled huatuo-bamai.conf with this unanchored expression:

sed -i -e 's/# Address.*/Address=""/g' ...

Besides the intended commented Elasticsearch address, it matches the # Address, Username, and Password ... documentation line inside [Storage]. The resulting image configuration contains Storage.Address = "".

StorageConfig has no Address field, and internal/config.Load uses strict TOML decoding. Default container startup therefore fails before the agent starts:

app run: load config: loading config: undecoded keys: ["Storage.Address"]

Reproduction

sed -e 's/# Address.*/Address=""/g' huatuo-bamai.conf | sed -n '85,112p'

The output places Address="" directly under [Storage]. Loading that configuration with the project's strict TOML decoder returns:

undecoded keys: ["Storage.Address"]

Expected behavior

The image build should only uncomment the address in [Storage.Elasticsearch]; its shipped default configuration must pass strict TOML decoding.

Proposed fix

Anchor the substitution to the commented assignment line and add a regression test for the generated configuration.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the release-image build substitution and the bundled huatuo-bamai.conf, then review internal/config.Load to understand the strict TOML check. Anchor the replacement to the intended Elasticsearch assignment, add a regression test for the generated configuration, and verify the shipped default passes strict decoding.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.