[Maintainability] Harden docker/fdb/start-fdb.sh for non-default networking, blob URLs and wording

Open
#173 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
73/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, docker
Domain
database, devops

Research direction

Start with docker/fdb/start-fdb.sh and docs/blob-granules.md, then check how the compose file supplies networking and FDB_BG_URL. Make the script handle or clearly reject the networking and blob path cases in the issue, and correct the warning wording. Done means each listed behavior is explicit and the requested shell, lint, compose config, and fresh startup checks pass.

Written by the indexing model from the issue text.

Description

priority:low type:chore

Description

docker/fdb/start-fdb.sh replaced the image's fdb.bash in #160 / PR #170. It works for the current compose file, but it is not a general replacement and has avoidable failure modes:

  • No public-IP validation. :15 uses public_ip=$(hostname -i | awk '{print $1}'). hostname -i can return an empty string or several addresses; awk then produces an empty or arbitrary public address and fdbserver fails with a confusing address error.
  • Custom blob URL is not handled. :19 always creates /var/fdb/blobs, while :31 passes ${FDB_BG_URL:-file:///var/fdb/blobs/}. A custom file:// directory outside the default is not created, and the script does not say whether custom paths are supported. (FDB may create the parent on write, but the contract should be explicit.)
  • Host networking is not honoured. :15 always uses hostname -i; the image's fdb.bash supported FDB_NETWORKING_MODE=host (public IP 127.0.0.1). The current compose file has no host networking, so this is safe today, but the script reads like a drop-in replacement.
  • "Silently ignored" is inaccurate. :7 and docs/blob-granules.md:31-32 say an uppercase --knob-BG_URL is "silently ignored". FDB 7.3.75 prints WARNING: Invalid knob option 'BG_URL' (and logs InvalidKnobName) before ignoring it; "ignored with a warning" is accurate.

Impact: confusing startup failures when the script is reused outside this compose file, and documentation that understates what FDB logs. Not a blocker for the current stack (single network, default blob path).

Where to start

  • Validate public_ip ([ -n "$public_ip" ]) and exit with a clear message; consider rejecting multiple addresses unless one is explicitly selected.
  • If FDB_BG_URL starts with file://, derive the directory and mkdir -p it; otherwise document that only /var/fdb/blobs is supported and fail early for unsupported URLs.
  • Document that the script is compose-specific and does not support FDB_NETWORKING_MODE=host, or add the host-networking branch.
  • Change "silently ignored" to "ignored with a warning" in the script comment and docs/blob-granules.md.

Definition of done

  • An empty hostname -i produces a clear error, not an fdbserver address error.
  • A custom FDB_BG_URL=file:///... path is either created or explicitly rejected/documented.
  • Host networking is either supported or documented as unsupported.
  • The "silently ignored" wording is corrected in the script and docs.
  • shellcheck 0.11.0, bin/lint.sh, docker compose config -q and a fresh docker compose up -d pass.
Dominant language
PHP
Stars
0
Forks
0
Avg merge
8h 20m
Merged PRs (30d)
23

Getting set up

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.

More from crazy-goat/fdb-php

All issues in crazy-goat/fdb-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.