chore: take the version from VERSION.txt only (0.0.3)
VERSION.txt is embedded into the server and the agent, so a plain go build reports the real version and build.sh no longer injects it.
This commit is contained in:
1 parent
93673d3570
commit
7cb9da8569
5 files changed
+26
-11
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
0.0.2
|
||||
0.0.3
|
||||
@@ -5,10 +5,9 @@ set -eu
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
VERSION="${VERSION:-$(cat VERSION.txt 2>/dev/null || echo 0.0.0)}"
|
||||
PKG="github.com/x-grk/longpolling-remote-access"
|
||||
LDFLAGS="-s -w -X $PKG/internal/server.Version=$VERSION -X $PKG/internal/agent.Version=$VERSION"
|
||||
echo ">> version $VERSION"
|
||||
# The version comes from VERSION.txt, which is embedded into every binary.
|
||||
LDFLAGS="-s -w"
|
||||
echo ">> version $(cat VERSION.txt)"
|
||||
|
||||
mkdir -p dist bin
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
lpra "github.com/x-grk/longpolling-remote-access"
|
||||
"github.com/x-grk/longpolling-remote-access/internal/proto"
|
||||
)
|
||||
|
||||
// Version is the agent build version, injected at compile time via -ldflags
|
||||
// (-X .../internal/agent.Version=...).
|
||||
var Version = "dev"
|
||||
// Version is the agent build version (see VERSION.txt).
|
||||
var Version = lpra.Version
|
||||
|
||||
// Config is the agent's runtime configuration (from env / config.env).
|
||||
type Config struct {
|
||||
|
||||
@@ -3,6 +3,8 @@ package server
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
|
||||
lpra "github.com/x-grk/longpolling-remote-access"
|
||||
)
|
||||
|
||||
// Config keys stored in the config table.
|
||||
@@ -18,9 +20,9 @@ const (
|
||||
// the rendered install.sh and can be changed from the settings page.
|
||||
const DefaultHostAddress = "https://REDACTED:8445"
|
||||
|
||||
// Version is the server build version, injected at compile time via -ldflags
|
||||
// (-X .../internal/server.Version=...). It is the newest version agents update to.
|
||||
var Version = "dev"
|
||||
// Version is the server build version (see VERSION.txt). It is the newest
|
||||
// version agents update to.
|
||||
var Version = lpra.Version
|
||||
|
||||
// ensureDefaults seeds the host address and a random enroll secret on first boot.
|
||||
func (db *DB) ensureDefaults() error {
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// Package lpra holds what the server and the agent share at build time.
|
||||
package lpra
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"strings"
|
||||
)
|
||||
|
||||
//go:embed VERSION.txt
|
||||
var versionFile string
|
||||
|
||||
// Version is the release version of every binary in this module. VERSION.txt
|
||||
// is the only place it is defined.
|
||||
var Version = strings.TrimSpace(versionFile)
|
||||
Reference in new issue
Block a user