Skip to content

Conversation

@coderdan
Copy link
Contributor

Adds optional command line args to proxy for specifying the database, host and username.
If not provided, env and config is used as now.
If running in docker this has no effect but is very useful if running the binary directly.

Acknowledgment

By submitting this pull request, I confirm that CipherStash can use, modify, copy, and redistribute this contribution, under the terms of CipherStash's choice.

Copilot AI review requested due to automatic review settings September 29, 2025 08:57
Copy link
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

This PR adds optional command line arguments for database connection parameters (host, name, and username) to the CipherStash proxy. These CLI arguments provide an alternative to environment variables and configuration files for specifying database connection details when running the proxy binary directly.

  • Adds new CLI arguments: --db-host, --db-name, and --db-user
  • Refactors the TandemConfig::build method to accept an Args struct instead of just a file path
  • Updates all test cases to use the new build_path convenience method

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/cipherstash-proxy/src/cli/mod.rs Adds three new optional CLI arguments for database connection parameters
packages/cipherstash-proxy/src/config/tandem.rs Refactors config building to accept Args struct and handle CLI overrides; adds build_path convenience method
packages/cipherstash-proxy/src/config/database.rs Adds default username function with serde annotation
packages/cipherstash-proxy/src/proxy/mod.rs Updates test to use new build_path method
packages/cipherstash-proxy/src/config/log.rs Updates all tests to use new build_path method
packages/cipherstash-proxy-integration/src/migrate/mod.rs Updates Args struct initialization with new CLI fields

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@freshtonic freshtonic left a comment

Choose a reason for hiding this comment

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

A change with a clear benefit and it's fairly simple too. Nice one @coderdan.

Copy link
Contributor

@auxesis auxesis left a comment

Choose a reason for hiding this comment

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

Love this, thanks for the PR @coderdan — big usability improvement.

Could you add something to docs/reference/index.md explaining how to start Proxy with these new command line options?

Looking forward to taking this for a spin. ❤️

@coderdan coderdan merged commit 5279c1b into main Sep 30, 2025
2 checks passed
@coderdan coderdan deleted the feat/cli-args branch September 30, 2025 11:20
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.

4 participants