Files
minstrel/internal/buildinfo/buildinfo.go
T
bvandeusenandClaude Opus 5.5 1aea3e9a1b
release / go (push) Successful in 2m1s
release / web (push) Successful in 1m18s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 4m4s
release / Build signed APK (push) Successful in 4m33s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Publish the release image to GHCR (dispatch only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped
chore: take workbench pointers and real library data out of the public tree
A sweep of the export (git archive) against the release leak standard:

- Internal ids in comments: a split "(rule 157)", two "RULE 131" headers
  and a "Preference 172" the id search missed because it was
  case-sensitive.
- Comments that quoted or credited the operator (shuffle caps, mix
  rotation, player bar layout, ID3v1 table).
- Real artists still in the suspect-source fixtures (and the Beck example
  in its comment): replaced with invented ones in the same file shapes.
- "26,171 tracks", a count from a real library, in the plural examples:
  now 12,345.
- Comments pointing at CI files the export leaves out (release.yml, the
  ci-go image, the Gitea keystore secret, an M8 milestone, .dockerignore
  history); client/README describes the release image, not the lanes.
- renovate.json is export-ignore: it targets the workbench's dev branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 06:56:35 -05:00

48 lines
1.8 KiB
Go

// Package buildinfo says which build is running and since when. It is the
// one place the version lives, so /healthz, the Subsonic envelope and the
// admin Overview cannot disagree about it.
package buildinfo
import "time"
// Version is the build's own version name — YYYY.MM.DD.HHMM, derived from
// the commit it was built from by ci/version.sh. Defaults to "dev" for local
// builds; overridden at link time via:
//
// -ldflags="-X 'github.com/Fabled-Sword/minstrel/internal/buildinfo.Version=2026.09.10.1449'"
//
// The release build passes it through the MINSTREL_VERSION build-arg →
// Dockerfile ldflag.
//
// Image tags carry no version, so this is the only thing that says which
// build is running.
var Version = "dev"
// Channel is which line this build came off — "stable" or "dev", or "local"
// for a plain `docker build`.
//
// A sibling field, never a suffix inside Version. The same
// commit built on both lanes reports the same version and differs only here;
// folding the two together is what makes a version string stop being
// comparable.
var Channel = "local"
// Started is when this process started, for the admin Overview's uptime.
var Started = time.Now()
// ProjectURL is where Minstrel's source lives. Outside services that ask a
// client to say how to reach its maker are pointed here.
const ProjectURL = "https://github.com/Fabled-Sword/minstrel"
// UserAgent is how Minstrel names itself to outside services (MusicBrainz,
// the Cover Art Archive, AcoustID), which ask for the app's name, its
// version and a contact, so a release can be told from a dev build in
// their logs. contact is the operator's address when one is configured;
// without one the project's URL stands in.
func UserAgent(contact string) string {
if contact == "" {
contact = ProjectURL
}
return "Minstrel/" + Version + " ( " + contact + " )"
}