BaGet

DevOps manual

Build, release, deploy, run and monitor BaGet Extension. Details are in the linked pages.

1. Build and test

Task Command
Build dotnet build BaGet.sln -p:GeneratePackageOnBuild=false
Test dotnet test BaGet.sln -p:GeneratePackageOnBuild=false
Publish the host dotnet publish src/BaGet -c Release -o artifacts -p:GeneratePackageOnBuild=false
Local wrapper build.ps1 (clean, restore, build; -Run, -Publish)

2. CI and release (.github/workflows)

Workflow Trigger Does
main.yml (Build) push / pull request on main, manual Build and test on Ubuntu
docs.yml (Docs) push on main mkdocs build --strict, deploys to GitHub Pages
release.yml (Release) manual; inputs releaseVersion, packageSource verify (tests), then in parallel: BaGet zip artifact, NuGet packages pushed with --skip-duplicate, Docker image to Docker Hub
Secret / variable Used for
NUGET_API_KEY Pushing packages to the package source
DOCKER_USERNAME, DOCKER_PASSWORD Docker Hub login
DOCKER_IMAGE (variable) Image name; default <DOCKER_USERNAME>/baget

Pages must use the “GitHub Actions” source for the docs site.

3. Deploy

Target Page
Docker (image from Dockerfile: aspnet:10.0, port 80, dotnet BaGet.dll) Docker
IIS IIS proxy
Azure, AWS, Google Cloud, Alibaba Cloud Azure, AWS, Google Cloud, Aliyun
Several nodes High availability

Configuration is layered: appsettings.json, appsettings.Overrides.json (written by the Settings page; path SettingsOverridesPath), environment variables (Section__Key), command line. Keep SettingsOverridesPath and log files on a persistent volume. Full reference: Configuration.

4. Run

5. Monitor

Signal How
Liveness GET /health/live (200 while the process answers)
Readiness GET /health/ready (200 or 503 by database and storage; Redis only reported); point the load balancer here
Logs Serilog: console, logs/baget-.log (daily, 14 kept), Windows event log (Warning+); levels live on the Settings page. No query strings or headers are logged
Traces, metrics, logs OpenTelemetry export to an OTLP endpoint (Telemetry:*), live on the Settings page, with a status table and a connection test: Telemetry
Cluster /admin/cluster: nodes, leases, gate, health
Background jobs /admin/operations, /admin/retention, /admin/replication

6. Operate

Task How
Read-only during maintenance In-memory gate; writes answer 503 + Retry-After: 60, reads work: Configuration
Move to another database Settings page, “Copy all data”: verified copy, gate closed until restart: Moving to another database
Clean up old versions Retention, with dry run and holds
Mirror to another server Replication
Scan for vulnerabilities Vulnerability scanning
Automate administration Administration REST API with an admin:api key
Account recovery dotnet BaGet.dll account reset-password <user>, account promote|demote|approve <user>

7. Back up and upgrade

8. High availability checklist

Shared SQL Server, PostgreSQL or MySQL; shared object storage (not the file system); Redis; Ha:Enabled=true with Ha:ConnectionString; the same Ha:KeyPrefix on every node; Ha:KeyCertificatePath set so data protection keys are encrypted. A node that breaks a rule does not start (High availability).