mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-10 13:49:39 +05:00
embed commit and repo in config codegen
This commit is contained in:
@@ -21,7 +21,7 @@ RUN soundcloakctl config codegen
|
||||
# this downloads JS modules (currently only hls.js) from jsdelivr and stores them locally for serving
|
||||
RUN soundcloakctl js download
|
||||
|
||||
RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -ldflags "-s -w -extldflags '-static' -X main.commit=`git rev-parse HEAD | head -c 7` -X main.repo=`git remote get-url origin`" -o ./app
|
||||
RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -ldflags "-s -w -extldflags '-static'" -o ./app
|
||||
RUN echo "soundcloak:x:5000:5000:Soundcloak user:/:/sbin/nologin" > /etc/minimal-passwd && \
|
||||
echo "soundcloak:x:5000:" > /etc/minimal-group
|
||||
|
||||
|
||||
2
build
2
build
@@ -1,3 +1,3 @@
|
||||
templ generate
|
||||
go generate ./lib/*
|
||||
go build -ldflags "-X main.commit=`git rev-parse HEAD | head -c 7` -X main.repo=`git remote get-url origin`" main.go
|
||||
go build main.go
|
||||
@@ -539,3 +539,6 @@ func init() {
|
||||
}
|
||||
|
||||
const Debug = false
|
||||
const Commit = "unknown"
|
||||
const Repo = "unknown"
|
||||
const CommitURL = "unknown"
|
||||
|
||||
8
main.go
8
main.go
@@ -25,10 +25,6 @@ import (
|
||||
"git.maid.zone/stuff/soundcloak/templates"
|
||||
)
|
||||
|
||||
// see build script/dockerfile
|
||||
var commit = "unknown"
|
||||
var repo = "unknown"
|
||||
|
||||
func main() {
|
||||
app := fiber.New(fiber.Config{
|
||||
Prefork: cfg.Prefork,
|
||||
@@ -346,8 +342,8 @@ func main() {
|
||||
|
||||
app.Get("/_/info", func(c *fiber.Ctx) error {
|
||||
return c.JSON(info{
|
||||
Commit: commit,
|
||||
Repo: repo,
|
||||
Commit: cfg.Commit,
|
||||
Repo: cfg.Repo,
|
||||
ProxyImages: cfg.ProxyImages,
|
||||
ProxyStreams: cfg.ProxyStreams,
|
||||
Restream: cfg.Restream,
|
||||
|
||||
Reference in New Issue
Block a user