Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,11 @@ jobs:
uses: actions/checkout@v6
with:
path: lattice-node-agent
- name: checkout lattice-sdk
uses: actions/checkout@v6
with:
repository: LatticeNet/lattice-sdk
path: lattice-sdk
- uses: actions/setup-go@v6
with:
go-version: '1.26.x'
check-latest: true
cache: false
- name: create workspace
run: go work init ./lattice-sdk ./lattice-node-agent
- name: gofmt
working-directory: lattice-node-agent
run: test -z "$(gofmt -l .)" || (gofmt -l . && exit 1)
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,20 @@ jobs:
uses: actions/checkout@v6
with:
path: lattice-node-agent
- name: checkout lattice-sdk
uses: actions/checkout@v6
with:
repository: LatticeNet/lattice-sdk
path: lattice-sdk
- uses: actions/setup-go@v6
with:
go-version: "1.26.x"
check-latest: true
cache: false
- name: create workspace
run: go work init ./lattice-sdk ./lattice-node-agent
- name: build binary
id: build
working-directory: lattice-node-agent
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
ARTIFACT: ${{ matrix.artifact }}
LATTICE_COMPAT_SERVER_MIN: v0.2.1
LATTICE_COMPAT_DASHBOARD_MIN: v0.2.1
LATTICE_COMPAT_SERVER_MIN: v0.2.2-alpha.2
LATTICE_COMPAT_DASHBOARD_MIN: v0.2.2-alpha.7
run: |
VERSION="${GITHUB_REF_NAME#v}"
LATTICE_COMPAT_CHANNEL=stable
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ missing checksum manifest aborts the install before the binary is written.
- `LATTICE_TERMINAL_TRANSPORT=poll|stream` selects the terminal transport.
- `LATTICE_SSH_ALERTS=1` reports accepted sshd logins.
- `LATTICE_SINGBOX_DISCOVER=1` and `LATTICE_SINGBOX_BIN=sb` enable sing-box
discovery.
discovery. `LATTICE_SINGBOX_META` overrides the design-15 sidecar path
(default `/etc/sing-box/lattice-metadata.json`), which annotates each line
with its control-plane `line_uuid` and declared downstream chain edge.
- `LATTICE_PROXY_USAGE_FILE`, `LATTICE_PROXY_USAGE_URL`, and
`LATTICE_PROXY_USAGE_XRAY_API` configure proxy usage reporting sources.

Expand Down
15 changes: 9 additions & 6 deletions cmd/lattice-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import (
"github.com/LatticeNet/lattice-sdk/model"
)

var version = "0.2.9"
var compatServerMin = "v0.2.1"
var compatDashboardMin = "v0.2.1"
var compatChannel = "stable"
var version = "0.3.3-alpha.1"
var compatServerMin = "v0.2.2-alpha.2"
var compatDashboardMin = "v0.2.2-alpha.7"
var compatChannel = "alpha"

type agentCompatibility struct {
ServerMin string `json:"server_min"`
Expand Down Expand Up @@ -138,6 +138,7 @@ type agentConfig struct {
ProxyUsageXrayPattern string
SingBoxDiscover bool
SingBoxBin string
SingBoxMeta string
LogStateDir string
}

Expand Down Expand Up @@ -225,6 +226,7 @@ func main() {
flag.StringVar(&cfg.ProxyUsageXrayPattern, "proxy-usage-xray-pattern", os.Getenv("LATTICE_PROXY_USAGE_XRAY_PATTERN"), "optional stat-name filter for -proxy-usage-xray-api (default \"user>>>\")")
flag.BoolVar(&cfg.SingBoxDiscover, "singbox-discover", os.Getenv("LATTICE_SINGBOX_DISCOVER") == "1", "report on-box sing-box nodes each interval by running read-only `sb --json list` (adoption bridge; read-only, no node mutation)")
flag.StringVar(&cfg.SingBoxBin, "singbox-bin", env("LATTICE_SINGBOX_BIN", "sb"), "sb management binary for -singbox-discover (default \"sb\" resolved on PATH)")
flag.StringVar(&cfg.SingBoxMeta, "singbox-meta", env("LATTICE_SINGBOX_META", ""), "design-15 sing-box sidecar metadata path for -singbox-discover (default /etc/sing-box/lattice-metadata.json)")
flag.StringVar(&cfg.LogStateDir, "log-state-dir", os.Getenv("LATTICE_LOG_STATE_DIR"), "directory for log-tail checkpoints (empty disables checkpoint persistence; sources still tail from end)")
flag.BoolVar(&printVersion, "version", false, "print lattice-agent version and exit")
flag.BoolVar(&printCompat, "compat-json", false, "print embedded server/dashboard compatibility metadata and exit")
Expand Down Expand Up @@ -887,8 +889,9 @@ func reportSingBoxInventory(cfg agentConfig) error {
return nil
}
inv, derr := singboxdiscover.Discover(context.Background(), singboxdiscover.Source{
Binary: cfg.SingBoxBin,
Addr: cfg.PublicIP,
Binary: cfg.SingBoxBin,
Addr: cfg.PublicIP,
MetaPath: cfg.SingBoxMeta,
}, cfg.NodeID)
// Always post what we have (ok list OR error status); the post error, if any,
// is combined with any discovery error for the caller's log.
Expand Down
12 changes: 6 additions & 6 deletions cmd/lattice-agent/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func (f roundTripFunc) RoundTrip(r *http.Request) (*http.Response, error) {
}

func TestVersionMatchesCurrentRelease(t *testing.T) {
if version != "0.2.9" {
t.Fatalf("version = %q, want 0.2.9", version)
if version != "0.3.3-alpha.1" {
t.Fatalf("version = %q, want 0.3.3-alpha.1", version)
}
}

Expand All @@ -34,11 +34,11 @@ func TestCompatibilityPayloadIsEmbedded(t *testing.T) {
if got.ServerMin == "" || got.DashboardMin == "" || got.Channel == "" {
t.Fatalf("compatibility metadata must be embedded: %+v", got)
}
if got.Channel != "stable" {
t.Fatalf("compatibility channel = %q, want stable", got.Channel)
if got.Channel != "alpha" {
t.Fatalf("compatibility channel = %q, want alpha", got.Channel)
}
if got.ServerMin != "v0.2.1" || got.DashboardMin != "v0.2.1" {
t.Fatalf("compatibility floor = %+v, want coordinated v0.2.1", got)
if got.ServerMin != "v0.2.2-alpha.2" || got.DashboardMin != "v0.2.2-alpha.7" {
t.Fatalf("compatibility floor = %+v, want coordinated design-15 alpha", got)
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/LatticeNet/lattice-node-agent

go 1.26

require github.com/LatticeNet/lattice-sdk v0.2.17
require github.com/LatticeNet/lattice-sdk v0.2.18-0.20260722123932-4a318f246d23

require github.com/creack/pty v1.1.24

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/LatticeNet/lattice-sdk v0.2.17 h1:BlzswmKrRxGLZtACwEPd+KyE4GT8HqZQHAAeNRLj6AM=
github.com/LatticeNet/lattice-sdk v0.2.17/go.mod h1:7ENUQ4EoS/TSW/eNomCGfZGliUPJZ46uAvp7dVcEXoE=
github.com/LatticeNet/lattice-sdk v0.2.18-0.20260722123932-4a318f246d23 h1:2qpbnG8jO9lOlVRpp4OCeami34HUyV7VGmp3vj4IRQI=
github.com/LatticeNet/lattice-sdk v0.2.18-0.20260722123932-4a318f246d23/go.mod h1:7ENUQ4EoS/TSW/eNomCGfZGliUPJZ46uAvp7dVcEXoE=
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
Expand Down
Loading