Skip to content

Add --default-time-range CLI option#369

Open
kimjune01 wants to merge 1 commit into
jasonish:mainfrom
kimjune01:fix/issue-237-default-time-range
Open

Add --default-time-range CLI option#369
kimjune01 wants to merge 1 commit into
jasonish:mainfrom
kimjune01:fix/issue-237-default-time-range

Conversation

@kimjune01
Copy link
Copy Markdown

For oneshot or training environments, it's useful to set a default time range (like "all") without modifying config files. This adds a --default-time-range command-line option for the server command.

What Changed

  • Add --default-time-range argument to server command
  • Read defaults.time-range from config and apply to context
  • Validation is delegated to existing parse_duration function which handles values like '24h', '7d', 'all'

This allows operators to override the default time range at startup without config file changes.

Fixes #237

Implements jasonish#237: Allow default time range to be set on the command line.

This is particularly useful for oneshot or training environments where
setting the default to "all" avoids manual time range selection.

Changes:
- Added --default-time-range CLI argument to server command
- Wired the argument through to ServerContext.defaults.time_range
- The value is exposed via /api/config endpoint to the frontend
- Accepts any valid time range format (e.g., "24h", "7d", "all")

Example usage:
  evebox server --default-time-range all
  evebox server --default-time-range 7d

Testing:
- Verified CLI help includes the new option
- Verified default is null when not specified
- Verified custom values ("all", "7d") are correctly set
- Verified /api/config endpoint returns the configured default
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.

Allow default time range to be set on the command line

1 participant