Docs accuracy: HERO_DB_PORT is not an OS env var, and "any Redis client" compatibility is overstated #44
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_db#44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two factual documentation errors found while auditing hero_db v0.6.0 (
main@aacaad1). Both are doc-only fixes — the code behaviour is intentional.1.
HERO_DB_PORTis documented as an OS environment variable, but it is never read from the environmentThe RESP2 TCP port is sourced only from the hero_proc secret store (context
core, keyHERO_DB_PORT), falling back to 6378 — by design, per the "no env vars, config via hero_proc" convention. The code is correct; the docs mislabel it:crates/hero_db_server/src/main.rs:117— printed under theENV VARShelp section:HERO_DB_PORT RESP2 TCP port (default: 6378)README.md:283— listed in the env-var tablePURPOSE.md:35— "configurable viaHERO_DB_PORT"Source of truth:
resolve_resp_port()reads from hero_proc (main.rs:166) and is explicitly commented "never from an OS env var" (main.rs:205); a repo-wide search finds noenv::var("HERO_DB_PORT").README.md:183even contradicts the table by correctly calling it "the HERO_DB_PORT hero_proc secret".Effect of the bug: a user who runs
HERO_DB_PORT=6400 hero_db_serverexpecting Redis to move ports sees no change — it silently stays on 6378.Fix: move
HERO_DB_PORTout of theENV VARShelp section and the README env-var table; document it as a hero_proc secret (hero_proc secret set HERO_DB_PORT --context core), matchingREADME.md:183.Same
ENV VARShelp block: two more mislabeled entriesThe identical problem affects two sibling entries in
crates/hero_db_server/src/main.rs(theprint_helpENV VARSsection), neither of which is read from the environment:HERO_DB_DATA_DIR(main.rs:116) — help says "Data storage directory", butconfig_from_envderives the data dir frompath_var()(i.e.PATH_VAR), not this var (main.rs:128).HERO_DB_SERVER_SOCKET(main.rs:119) — help says "Override rpc.sock path", but the socket isresolve_socket_path("hero_db/rpc.sock")unconditionally (main.rs:127).(
PATH_SOCKETis fine — read insideherolib_core.)HERO_DB_ENCRYPTION_KEYin the same block is also never read, but that is a security bug, not just a doc fix — tracked separately in #46.2. "Works with redis-cli and any Redis client library" overstates compatibility
README.md:33— "Redis Protocol Compatible - Works with redis-cli and any Redis client library"README.md:258— "AUTH # standard Redis AUTH (works with any Redis client)"These are contradicted by the compatibility audit:
HELLOis unimplemented, which breaksredis-py >= 8.0on reconnect (#41).AUTHis unimplemented (#42) — so the:258claim is specifically wrong.KEYS/DBSIZE/EXISTS/SCAN) is incorrect across types (#39), there is noWRONGTYPEsafety (#40), and ~25 standard commands are missing (#42).redis-cliand simple string/hash/list/set usage do work, but "any Redis client library" is not currently true.Fix: soften to something like "Speaks RESP2 and works with
redis-cliand standard clients for a curated subset of Redis commands (strings, hashes, lists, sets, streams, TTL) — see issues #39–#43 for current compatibility gaps."Doc-accuracy follow-up to the Redis-compatibility audit (issues #39–#43). Claims verified against source at the line refs above. Note: an earlier suspicion that
hero_db_exampleswas empty was false — it shipsexamples/basic_usage.rs,examples/health.rs,tests/integration.rs— and is deliberately not included here.