Skip to content

chore(workers): platform-aware default paths#439

Merged
intendednull merged 1 commit into
claude/adoring-euler-DvNnkfrom
auto-fix/issue-324-config-paths
Apr 27, 2026
Merged

chore(workers): platform-aware default paths#439
intendednull merged 1 commit into
claude/adoring-euler-DvNnkfrom
auto-fix/issue-324-config-paths

Conversation

@intendednull
Copy link
Copy Markdown
Owner

Why

Hardcoded /etc/willow/*.key + /var/lib/willow/storage.db in clap default_value flags. Linux-only. Bad on macOS/Windows dev. TD-06.

What

  • Add default_replay_key() in crates/replay/src/main.rs. Use dirs::config_dir(). Fallback /etc/willow/replay.key.
  • Add default_storage_key() + default_storage_db() in crates/storage/src/main.rs. Use dirs::config_dir() for key, dirs::data_dir() for db. Fallback to historical Linux paths.
  • Wire via default_value_t = helper().display().to_string(). Behaviour unchanged when flag passed (Docker images set own paths).
  • Unit tests assert tail = willow/<file>, parent dir name = willow, path absolute.

Scope guard

  • Touch only clap default_value = "/..." sites.
  • No typed-config crate (TD-11 follow-up).
  • /tmp/test-worker.key struct-field default left alone (TD-13).
  • Docker compose unchanged. Dockerfiles set paths via flags.

Verify

rg "default_value\s*=\s*\"/" crates --type rust   # zero matches
cargo test -p willow-replay -p willow-storage     # 3 new helper tests pass
cargo fmt --check && cargo clippy --workspace --all-targets -- -D warnings
cargo check --target wasm32-unknown-unknown ...   # wasm clean

Refs #324


Generated by Claude Code

Replace hardcoded `/etc/willow/*.key` and `/var/lib/willow/storage.db`
clap defaults in replay + storage bins with dirs::config_dir() /
dirs::data_dir() lookups, falling back to historical Linux paths
when no XDG dir resolves. Behaviour unchanged when --identity-path
or --db-path passed (e.g. Docker images).

Refs #324
@intendednull intendednull merged commit 16c7a12 into claude/adoring-euler-DvNnk Apr 27, 2026
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.

2 participants