Skip to content

Commit d1dad39

Browse files
committed
build(release): expose and verify protocol v4
1 parent 3dd54ee commit d1dad39

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/actions/build/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,10 @@ runs:
106106
echo "::error::built binary reported no version at all"
107107
exit 1
108108
fi
109+
110+
protocol="$($tmp/ormos --protocol-version)"
111+
echo "protocol $protocol"
112+
if [ "$protocol" != "4" ]; then
113+
echo "::error::built binary advertises protocol '$protocol', expected the v4 release contract"
114+
exit 1
115+
fi

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ jobs:
149149
cat > dist/notes.md <<NOTES
150150
ormos $TAG
151151
152+
Advertised tunnel protocol: v4 (with backend compatibility for
153+
released v0-v3 agents during the documented migration window).
154+
152155
\`\`\`sh
153156
go install github.com/nicodes/ormos@$TAG
154157
\`\`\`

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ compatibility window; adding v4 does not itself change those versions' behavior.
218218
go test -race ./...
219219
go vet ./...
220220
go run . --version
221+
go run . --protocol-version
221222
```
222223

223224
The repository is intentionally limited to the public agent and shared

internal/system/run.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,13 @@ import (
5050
"os"
5151
"os/signal"
5252
"syscall"
53+
54+
"github.com/nicodes/ormos/relay"
5355
)
5456

5557
// Main accepts `ormos`, `ormos --config PATH`, `ormos --help` and
56-
// `ormos --version`, and nothing else — no `-h` shorthand, no subcommands.
58+
// `ormos --version`, `ormos --protocol-version`, and nothing else — no `-h`
59+
// shorthand, no subcommands.
5760
// Parsed by hand rather than with the flag package, which would accept
5861
// single-dash spellings and add its own -h.
5962
//
@@ -69,6 +72,9 @@ func Main(args []string, version string) {
6972
case len(args) == 1 && args[0] == "--version":
7073
fmt.Println(version)
7174
return
75+
case len(args) == 1 && args[0] == "--protocol-version":
76+
fmt.Println(relay.StreamFenceVersion)
77+
return
7278
case len(args) == 2 && args[0] == "--config" && args[1] != "":
7379
configFileOverride = args[1]
7480
case args[0] == "--config":
@@ -90,6 +96,7 @@ usage:
9096
ormos --config PATH run with a different config file
9197
ormos --help show this
9298
ormos --version print the version
99+
ormos --protocol-version print the advertised tunnel protocol version
93100
94101
Just run ormos. If this machine isn't registered yet (or its credentials were
95102
revoked by forgetting it in the UI), it shows a short pairing code — approve it

0 commit comments

Comments
 (0)