Skip to content

Add human-readable size parsing and CLI/env configuration for cache settings (v0.2.0)#12

Merged
GrassBlock1 merged 8 commits intomasterfrom
copilot/add-configurable-settings
Feb 10, 2026
Merged

Add human-readable size parsing and CLI/env configuration for cache settings (v0.2.0)#12
GrassBlock1 merged 8 commits intomasterfrom
copilot/add-configurable-settings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 10, 2026

Extends configuration system to support human-readable byte sizes and adds CLI/environment variable overrides for cache-related settings.

Changes

Human-readable size formats

  • max_item_size and disk_cache_max_size now accept "10M", "1G", "10MiB", "1GiB" etc. alongside numeric bytes
  • Uses bytesize crate for parsing (supports both decimal MB/GB and binary MiB/GiB units)
  • Backward compatible with existing numeric byte configurations
[cache]
max_item_size = "10MiB"           # Binary: 10 * 1024²
disk_cache_max_size = "1GB"       # Decimal: 1 * 1000³
# OR numeric bytes (still works)
max_item_size = 10485760

CLI options

  • --forward-headers / --no-forward-headers
  • --disk-cache / --no-disk-cache
  • --disk-cache-path <PATH>
  • --disk-cache-max-size <SIZE> (accepts human-readable formats)

Environment variables

  • FORWARD_HEADERS_ENABLED (boolean)
  • DISK_CACHE_ENABLED (boolean)
  • DISK_CACHE_PATH (string)
  • DISK_CACHE_MAX_SIZE (supports human-readable formats)

Configuration precedence remains: env vars > CLI options > config file

Version

  • Bumped to v0.2.0
Original prompt
  • make max_item_size and disk_cache_max_size in config also recognize sizes like "10M", "1G", etc
  • make forward_headers_enabled, disk_cache and related setting configuarable from command line options and env variables
  • bump version to v0.2.0

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits February 10, 2026 03:41
…size

Co-authored-by: GrassBlock1 <46253950+GrassBlock1@users.noreply.github.com>
…he settings

Co-authored-by: GrassBlock1 <46253950+GrassBlock1@users.noreply.github.com>
Co-authored-by: GrassBlock1 <46253950+GrassBlock1@users.noreply.github.com>
Co-authored-by: GrassBlock1 <46253950+GrassBlock1@users.noreply.github.com>
Copilot AI changed the title [WIP] Add size recognition and configurability for settings Add human-readable size parsing and CLI/env configuration for cache settings (v0.2.0) Feb 10, 2026
Copilot AI requested a review from GrassBlock1 February 10, 2026 03:53
@GrassBlock1 GrassBlock1 marked this pull request as ready for review February 10, 2026 04:32
Copilot AI review requested due to automatic review settings February 10, 2026 04:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends Akkoproxy’s configuration system to accept human-readable byte sizes for cache limits and adds CLI/environment-variable overrides for cache-related settings, alongside a version bump to v0.2.0.

Changes:

  • Add bytesize-backed parsing so max_item_size and disk_cache_max_size can be configured as either raw bytes or human-readable strings.
  • Add CLI flags and environment variables to override forward_headers_enabled and disk cache settings with defined precedence.
  • Bump crate version to 0.2.0 and document changes in the changelog and example config.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main.rs Adds CLI flags, env var overrides, and size parsing helper for disk cache max size.
src/config.rs Adds custom serde deserializer to accept numeric or human-readable size strings; adds tests for parsing.
config.example.toml Updates examples/comments to show human-readable cache size formats.
Cargo.toml Bumps version and adds bytesize dependency.
Cargo.lock Updates lockfile for v0.2.0 and adds bytesize.
CHANGELOG.md Adds v0.2.0 release notes and updates comparison links.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

GrassBlock1 and others added 2 commits February 10, 2026 12:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@GrassBlock1 GrassBlock1 merged commit 579ab69 into master Feb 10, 2026
5 of 7 checks passed
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.

3 participants