feat: unified data dir ATP_DATA_DIR — config/db/logs under one dir (v0.6.6) - #99
Merged
Merged
Conversation
…e dir (v0.6.6) Rant 2026-08-19T20:53:23: put config, db and logs in one directory so docker compose mounts a single volume. - main.rs: --data-dir / env ATP_DATA_DIR (default ./data); creates the dir + logs/ on start; config path = <data-dir>/config.toml (auto-copied from config.example.toml on first start; --config still honored); db path always <data-dir>/aitokenpool.db (config db_path ignored) - config: clap 'env' feature enabled for ATP_DATA_DIR - Dockerfile: ATP_DATA_DIR=/data, CMD --data-dir /data, image ships /config/config.example.toml for first-start copy - docker-compose: single volume ./atp-data:/data (config/db/logs inside) - .gitignore/.dockerignore: atp-data/ + config/config.toml - README: unified dir layout, docker mount example, legacy migration note - verified: first start creates config.toml+db+logs; second start reuses both (no admin rebuild, config hash unchanged); healthz 200
8 tasks done
argszero
added a commit
that referenced
this pull request
Sep 26, 2026
…clares (#303) `docker-compose.yml` and `Dockerfile` each copy two facts out of `Cargo.toml` — the release version (`image: aitokenpool:<v>`, the copy-pasteable `docker build -t aitokenpool:<v> .`, the `(v<v>)` header) and the minimum Rust version (`FROM rust:<v>-slim`). Cross-format files cannot import, so a copy is unavoidable; the problem is that nothing asserted it. The copy was written in a51b3ba (#99, v0.6.6) and never touched again, so by now it was 22 releases stale: the `docker compose up -d --build` that README recommends tagged the image `aitokenpool:0.6.6` while the binary inside it reports 0.7.28 (the `/healthz` version comes from `env!("CARGO_PKG_VERSION")`). Fix the five stale literals, and give the copies an executor in the existing `src/deploy_gate.rs`: expectations are derived from `Cargo.toml` (no snapshots), every `aitokenpool:<v>` tag and `(v<v>)` remark must equal the declared version, and every `FROM rust:<v>` must be at least the declared `rust-version` (building with a newer toolchain is legitimate — the guarded direction is "the declaration was raised and the Dockerfile did not follow"). Moving tags such as `latest` are not version claims and are skipped, and the scanner is scoped to the `[package]` section so the `version = "0.7"` entries of the dependency tables cannot stand in for it. Measured on this tree: before, the rule reports exactly the five stale sites (compose :1/:19, Dockerfile :1/:3/:6); lowering the builder image to rust:1.85 and bumping the manifest to 0.7.29 each turn it red. `cargo test` 396 -> 399. Consequence, deliberate: a release PR now also has to update these two files, and the gate fails loudly if it does not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All configuration, database and log files now live under a single directory so Docker compose mounts one volume (host rant 2026-08-19T20:53:23, project: aitokenpool).
Layout:
Changes:
--data-dir/ATP_DATA_DIR(clapenvfeature); dirs auto-created;config.tomlauto-copied from the repo example on first start (or minimal config if example absent); explicit--configstill honored; db path always<data-dir>/aitokenpool.dbENV ATP_DATA_DIR=/data,CMD ["aitokenpool", "--data-dir", "/data"], image ships/config/config.example.tomlfor first-start copy./atp-data:/data(config + db + logs inside)atp-data/,config/config.tomldata/migration noteRelated Issue
Rant: 2026-08-19T20:53:23.652528+08:00 (统一数据目录 — 配置/数据库/日志放同一目录,方便 Docker 挂载)
Tests
cargo test— 116/116 passcargo fmt --check+cargo clippy --all-targets -- -D warningsclean