Skip to content

Commit

Permalink
Merge branch 'main' into ps/ruby-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Avery authored Feb 21, 2024
2 parents 567a159 + ff94313 commit 59816df
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 87 deletions.
137 changes: 69 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/bitwarden-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
rust-version = "1.71"

[dependencies]
clap = { version = "4.5.0", features = ["derive"] }
clap = { version = "4.5.1", features = ["derive"] }
color-eyre = "0.6"
inquire = "0.6.2"
supports-color = "3.0.0"
12 changes: 6 additions & 6 deletions crates/bitwarden-napi/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/bw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Bitwarden Password Manager CLI
keywords = ["bitwarden", "password-manager", "cli"]

[dependencies]
clap = { version = "4.5.0", features = ["derive", "env"] }
clap = { version = "4.5.1", features = ["derive", "env"] }
color-eyre = "0.6"
env_logger = "0.11.1"
inquire = "0.6.2"
Expand Down
1 change: 1 addition & 0 deletions crates/bws/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Changed

- Switched TLS backend to `rustls`, removing the dependency on `OpenSSL`.
- Add a `BWS_CONFIG_FILE` environment variable to specify the location of the config file (#571)

## [0.4.0] - 2023-12-21

Expand Down
2 changes: 1 addition & 1 deletion crates/bws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ chrono = { version = "0.4.34", features = [
"clock",
"std",
], default-features = false }
clap = { version = "4.5.0", features = ["derive", "env", "string"] }
clap = { version = "4.5.1", features = ["derive", "env", "string"] }
clap_complete = "4.5.0"
color-eyre = "0.6"
comfy-table = "^7.1.0"
Expand Down
9 changes: 8 additions & 1 deletion crates/bws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,12 @@ WORKDIR /usr/local/bin
COPY --from=build /app/target/release/bws .
COPY --from=build /etc/ssl/certs /etc/ssl/certs

ENTRYPOINT ["bws"]
# Create a non-root user
RUN useradd -ms /bin/bash app

# Switch to the non-root user
USER app

WORKDIR /home/app

ENTRYPOINT ["bws"]
18 changes: 18 additions & 0 deletions crates/bws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,21 @@ echo 'source <(/path/to/bws completions bash)' >> ~/.bashrc

For more detailed documentation, please refer to the
[Secrets Manager CLI help article](https://bitwarden.com/help/secrets-manager-cli/).

## Docker

We also provide a docker image preloaded with the `bws` cli.

```bash
# From the root of the repository
docker build -f crates/bws/Dockerfile -t bitwarden/bws .

docker run --rm -it bitwarden/bws --help
```

To use a configuration file, utilize docker
[bind mounting](https://docs.docker.com/storage/bind-mounts/) to expose it to the container:

```bash
docker run --rm -it -v "$HOME"/.bws:/home/app/.bws bitwarden/bws --help
```
2 changes: 2 additions & 0 deletions crates/bws/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct Cli {
short = 'f',
long,
global = true,
env = CONFIG_FILE_KEY_VAR_NAME,
help = format!("[default: ~/{}/{}] Config file to use", config::DIRECTORY, config::FILENAME)
)]
config_file: Option<PathBuf>,
Expand Down Expand Up @@ -228,6 +229,7 @@ async fn main() -> Result<()> {
}

const ACCESS_TOKEN_KEY_VAR_NAME: &str = "BWS_ACCESS_TOKEN";
const CONFIG_FILE_KEY_VAR_NAME: &str = "BWS_CONFIG_FILE";
const PROFILE_KEY_VAR_NAME: &str = "BWS_PROFILE";
const SERVER_URL_KEY_VAR_NAME: &str = "BWS_SERVER_URL";

Expand Down
6 changes: 3 additions & 3 deletions languages/js/sdk-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 59816df

Please sign in to comment.