datarhei-dragonfork-core/app/version.go
Zac Gaetano 671f64ca56
Some checks failed
tests / build (push) Failing after 2s
tests / build (pull_request) Failing after 2s
feat(branding): Dragon Fork identity for v0.1.0-dragonfork release
M5 / final M2-stack work. The fork now identifies itself unambiguously
in logs, the API, and the README without changing the Go module path
(internal imports stay at github.com/datarhei/core/v16 — see NOTES.md
for the rationale).

Identity surfaces:

- app/version.go gains Variant ('dragonfork') and Fork ('Datarhei —
  Dragon Fork') as vars (overridable via -ldflags for downstream
  re-packagers).
- api.About + the /api endpoint expose 'variant' and 'fork' fields;
  Swagger docs regenerated.
- Startup banner logs 'variant' + 'fork' alongside the existing
  application + version fields, so a TrueNAS sysadmin tail-following
  /var/log can tell at a glance which fork is running.

Documentation:

- README.md rewritten with a Dragon Fork header and Quick start; the
  upstream feature surface is summarised in 'From upstream Datarhei'
  with a clear additivity statement. Sample process JSON, multi-input
  pipeline guidance, link to the design + testing docs.
- NOTICE: Apache 2.0 §4(d) attribution to upstream datarhei Core,
  Pion, Echo, FFmpeg.
- CREDITS: enumerated dependency list with licenses.
- CHANGELOG.md prepended with a 'Datarhei — Dragon Fork' section
  starting at v0.1.0-dragonfork; upstream's '# Core' history preserved
  below.

Module path stays github.com/datarhei/core/v16 by design — the fork is
distinguished by repo location and branch history, not import path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 12:22:25 +00:00

62 lines
1.6 KiB
Go

package app
import (
"fmt"
"runtime"
)
// Name of the app
const Name = "datarhei-core"
// Variant distinguishes a Dragon Fork build from upstream Datarhei
// Core in the startup banner and in the /api/v3/about endpoint
// payload. Empty would imply an upstream build; we override the
// linker default with the fork identity.
//
// Kept as a var (not const) so a downstream packager can override it
// at build time via -ldflags="-X github.com/datarhei/core/v16/app.Variant=…"
// without forking the source.
var Variant = "dragonfork"
// Fork carries the human-readable fork name surfaced in logs.
var Fork = "Datarhei — Dragon Fork"
type versionInfo struct {
Major int
Minor int
Patch int
}
func (v versionInfo) String() string {
return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
}
func (v versionInfo) MajorString() string {
return fmt.Sprintf("%d.0.0", v.Major)
}
func (v versionInfo) MinorString() string {
return fmt.Sprintf("%d.%d.0", v.Major, v.Minor)
}
// Version of the app
var Version = versionInfo{
Major: 16,
Minor: 16,
Patch: 0,
}
// Commit is the git commit the app is build from. It should be filled in during compilation
var Commit = ""
// Branch is the git branch the app is build from. It should be filled in during compilation
var Branch = ""
// Build is the timestamp of when the app has been build. It should be filled in during compilation
var Build = ""
// Arch is the OS and CPU architecture this app is build for.
var Arch = runtime.GOOS + "/" + runtime.GOARCH
// Compiler is the golang version this app has been build with.
var Compiler = runtime.Version()