bitwarden/server
Tooling
Build system
- .NET 8 SDK — pinned in
global.json("sdk": { "version": "8.0.100", "rollForward": "latestFeature" }). bitwarden-server.sln— the canonical solution file containing every project.Directory.Build.props— a single set of MSBuild properties applied to every project. Sets language version, nullable defaults, treats warnings as errors, and stamps the AGPL/Bitwarden-License headers.- MSBuild SDKs declared in
global.json:Microsoft.Build.Traversal— used for the meta-projects that build subsets of the solution.Microsoft.Build.Sql— used bysrc/Sql/Sql.sqlproj, the SQL Server Database Project that declares the canonical schema.Bitwarden.Server.Sdk— Bitwarden's own MSBuild SDK that injects shared targets (e.g. consistentBitwardenpackage metadata, container properties).
Formatting / linting
dotnet formatis the only enforced formatter. The rules live in.editorconfigat the repo root (5,509 bytes — pretty opinionated; do not loosen without team buy-in).- A pre-commit hook is provided at
.git-hooks/pre-commit. Enable it withgit config --local core.hooksPath .git-hooks. - The
.git-blame-ignore-revsfile lists commits that contain pure formatting changes sogit blamecan ignore them.
SQL tooling
src/Sql/Sql.sqlproj— every table, view, stored procedure, and function. Builds viaMicrosoft.Build.Sql.util/Migrator/— a console app (dotnet run --project util/Migrator) that runsutil/Migrator/DbScripts/*.sqlin order against a SQL Server connection string. Records applied scripts indbo.Migration.util/MsSqlMigratorUtility/— a thin wrapper aroundMigratorpackaged for production use.util/{MySqlMigrations,PostgresMigrations,SqliteMigrations}/— EF Core migration projects. Usedotnet ef migrations add ...against the appropriate one.dev/migrate.ps1/dev/ef_migrate.ps1/dev/verify_migrations.ps1— local helpers that string the above together.
Containerization
- Each deployable service has its own
Dockerfile(multi-stage,mcr.microsoft.com/dotnet/sdk:8.0build →mcr.microsoft.com/dotnet/aspnet:8.0runtime). entrypoint.shis the standard ASP.NET Core entry script — it waits on dependencies, sets upappsettings, and execsdotnet <Service>.dll.- The
util/Nginx/directory ships nginx config used in the official self-host installer.
CI/CD workflows (.github/workflows/)
| Workflow | Purpose |
|---|---|
build.yml |
Restore, build, and test every project on PR + push to main. |
build_target.yml |
Reusable workflow invoked by build.yml for a single .NET target. |
test.yml |
Runs unit tests with coverage. |
test-database.yml |
Boots SQL Server, MySQL, Postgres, SQLite; runs migrations + DB integration tests. |
scan.yml |
Security scanning (Checkmarx, etc.) — gated by .checkmarx/ config. |
code-references.yml |
Cross-references feature-flag usage with the LaunchDarkly export. |
protect-files.yml |
Enforces that protected files (e.g. Directory.Build.props) require multiple owners' approval. |
enforce-labels.yml |
Asserts the PR has the right area / type labels. |
respond.yml, review-code.yml |
Claude-driven response and code-review automation (the AI SME team owns these). |
automatic-issue-responses.yml |
Bot-driven issue-comment automation for support templates. |
stale-bot.yml |
Closes stale community issues. |
release.yml |
BRE-owned: cuts a release from rc-* branches. |
publish.yml |
Builds and pushes Docker images to GHCR; updates the metadata branch. |
cleanup-rc-branch.yml |
Removes rc branches after release. |
repository-management.yml |
Repository-config drift detection. |
ephemeral-environment.yml |
Stands up an ephemeral environment per PR for QA. |
load-test.yml |
k6 load tests under perf/. |
_move_edd_db_scripts.yml |
DBOps-shared workflow to relocate moved migration scripts. |
Renovate is configured via .github/renovate.json5 (8KB of grouping rules). It's why almost half of the commit log is dependency bumps.
Local helper scripts
dev/setup_secrets.ps1— populates user-secrets for every project fromdev/secrets.json.example.dev/setup_azurite.ps1— initialises Azurite blob containers + queues used by the API and EventsProcessor.dev/seed.ps1— runsutil/Seeder/to insert demo data via the API + Rust SDK.dev/generate_openapi_files.ps1— regeneratesswagger/*.jsonfrom the running API (used to commit OpenAPI specs).dev/create_certificates_*.sh|ps1— generates the IdentityServer signing cert..run/— Rider / VS Code run configurations for each service.
Editor support
- VS Code / VS / Rider — all three are supported.
.editorconfig,.vscode/, and.run/provide the necessary configs. .devcontainer/— a Codespaces-friendly dev container spec (Docker-in-Docker enabled so the compose stack works inside the container).
AI-assisted development
The .claude/ directory is a recent addition (PR #7508, 2025-12) that ships a Claude Code "skills" configuration for working in this repo. It's owned by @bitwarden/team-ai-sme (CODEOWNERS).
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.