Add tests and formatting, update README while we are here

This commit is contained in:
Micaiah Martin
2026-06-12 12:31:08 -06:00
parent 21a8336b67
commit 4ae62c3bdf
4 changed files with 36 additions and 6 deletions

View File

@@ -6,11 +6,13 @@ on:
push:
paths:
- "POC/bwsh/**"
- "POC/bwsh.Test/**"
- ".github/workflows/build-bwsh.yml"
pull_request:
types: [opened, synchronize]
paths:
- "POC/bwsh/**"
- "POC/bwsh.Test/**"
- ".github/workflows/build-bwsh.yml"
workflow_dispatch: {}
@@ -21,8 +23,35 @@ concurrency:
permissions: {}
jobs:
test:
name: Lint and test
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up .NET
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
with:
dotnet-version: "10.0.x"
- name: Check formatting
run: |
dotnet format POC/bwsh/Bwsh.csproj --verify-no-changes
dotnet format POC/bwsh.Test/Bwsh.Test.csproj --verify-no-changes
- name: Run unit tests
working-directory: POC/bwsh.Test
run: dotnet test --configuration Release
build:
name: Build (${{ matrix.rid }})
needs: test
runs-on: ${{ matrix.runner }}
timeout-minutes: 15
permissions:

View File

@@ -1,6 +1,5 @@
using System.CommandLine;
using Bit.SelfHost.Deployments;
using Bit.SelfHost.Engine;
using Spectre.Console;
namespace Bit.SelfHost.Commands;

View File

@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
namespace Bit.SelfHost.Engine;

View File

@@ -1,8 +1,9 @@
# bwsh — Bitwarden self-host CLI
A single .NET tool that installs and manages a Bitwarden self-host deployment — replacing the
`bitwarden.sh` + `run.sh` + Setup-container stack. It generates all config in-process and drives
Docker directly. Supports both **standard** and **lite** deployments.
`bitwarden.sh` + `run.sh` + Setup-container stack. It generates config in-process and brings the
stack up: **standard** drives the Docker Engine API directly, while **lite** runs the repo's
`bitwarden-lite/docker-compose.yml` via `docker compose`.
![bwsh status](docs/images/status.gif)
@@ -11,7 +12,7 @@ Docker directly. Supports both **standard** and **lite** deployments.
## Prerequisites
- **.NET 10 SDK** — https://dotnet.microsoft.com/download
- **Docker** running
- **Docker** running (lite deployments also need the `docker compose` CLI plugin)
- An installation **ID + key** from https://bitwarden.com/host
## Install
@@ -104,7 +105,8 @@ ssl:
`install`/`apply` then provisions the cert with certbot. Renew with `dotnet run -- renewcert` (cron it for
auto-renewal).
Ports default to 80/443; override with `http-port`/`https-port` in the manifest. Opt out of HTTPS with
Ports default to 80/443. On standard, override with `http-port`/`https-port` in the manifest; lite
serves on 80/443 from the upstream compose and ignores those fields. Opt out of HTTPS with
`ssl: { enable: false }`.
## Shell completion