Merge branch 'main' into v2.0

This commit is contained in:
Michael Quigley
2025-10-01 16:17:53 -04:00
11 changed files with 113 additions and 18 deletions
+50
View File
@@ -75,6 +75,56 @@ jobs:
path: ${{ steps.solve_go_bin.outputs.go_bin }}/zrok
if-no-files-found: error
windows-build:
name: Build Windows AMD64 CLI
runs-on: ubuntu-24.04
steps:
- run: sudo apt update
- run: sudo apt-get install gcc-mingw-w64-x86-64
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: true
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm install
working-directory: ui
- run: npm run build
working-directory: ui
env:
CI: "true"
- run: npm install
working-directory: agent/agentUi
- run: npm run build
working-directory: agent/agentUi
env:
CI: "true"
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: build --snapshot --clean --config .goreleaser-windows.yml
- uses: actions/upload-artifact@v4
with:
name: windows-amd64
path: ./dist/**/zrok.exe
if-no-files-found: error
pytest:
name: Test the Python SDK
runs-on: ubuntu-24.04
+14
View File
@@ -26,6 +26,20 @@ CHANGE: Updated `github.com/openziti/sdk-golang` to `v1.2.4`.
CHANGE: All logging migrated from `githhub.com/michaelquigley/pfxlog` and `github.com/sirupsen/logrus` to `github.com/michaelquigley/df/dl` and `log/slog`. Use environment variable `DL_USE_JSON=true` to force JSON output. Use `DL_USE_COLOR` to force colorized output. (https://github.com/openziti/zrok/issues/1078)
## v1.1.8
CI: pull requests now trigger a native-architecture Windows build
## v1.1.7
FIX: Missing import for windows-specific build.
## v1.1.6
FEATURE: The `agent.Agent` now can optionally enforce that agent remoting starts successfully when creating a new instance. The `agent.Config` struct has a new `RequireRemoting` boolean to control this behavior. (https://github.com/openziti/zrok/issues/1085)
CHANGE: Additional diagnostic logging in the zrok Agent; details around sub-process executions, etc. (https://github.com/openziti/zrok/issues/1084)
## v1.1.5
CHANGE: Upgraded go toolchain to `v1.24.6`. (https://github.com/openziti/zrok/issues/1072)
+1 -1
View File
@@ -1,7 +1,7 @@
# Code of Conduct
All open source projects managed by NetFoundry share a common [code of
conduct](https://netfoundry.github.io/policies/CODE_OF_CONDUCT.html) which all contributors are expected to follow.
conduct](https://netfoundry.io/docs/openziti/policies/CODE_OF_CONDUCT/) which all contributors are expected to follow.
Please be sure you read, understand and adhere to the thoughts expressed therein.
Individuals acting in any way that is considered in violation of the Code of Conduct will receive corrective actions
+1 -1
View File
@@ -1,7 +1,7 @@
# Contributing
NetFoundry welcomes all and any contributions. All open source projects managed by NetFoundry share a common
[guide for contributions](https://netfoundry.github.io/policies/CONTRIBUTING.html).
[guide for contributions](https://netfoundry.io/docs/openziti/policies/CONTRIBUTING/).
If you are eager to contribute to a NetFoundry-managed open source project please read and act accordingly.
+9 -9
View File
@@ -31,7 +31,7 @@ $ zrok share private localhost:3000
## What You Can Share
### 🌐 Web Services
### Web Services
Instantly make local web apps accessible over the internet:
```bash
@@ -39,7 +39,7 @@ $ zrok share public localhost:8080
```
![zrok share public](docs/images/zrok_share_public.png)
### 📁 Files & Directories
### Files & Directories
Turn any folder into a shareable network drive:
```bash
@@ -48,7 +48,7 @@ $ zrok share public --backend-mode drive ~/Repos/zrok
![zrok share public -b drive](docs/images/zrok_share_public_drive.png)
![mounted zrok drive](docs/images/zrok_share_public_drive_explorer.png)
### 🔒 Private Resources
### Private Resources
Share TCP/UDP services securely with other zrok users—no public internet exposure.
## Key Features
@@ -84,7 +84,7 @@ shr, err := sdk.CreateShare(root, &sdk.ShareRequest{
listener, err := sdk.NewListener(shr.Token, root)
```
📖 [Read the SDK guide](https://blog.openziti.io/the-zrok-sdk) for complete examples.
[Read the SDK guide](https://blog.openziti.io/the-zrok-sdk) for complete examples.
## Self-Hosting
@@ -94,14 +94,14 @@ Run your own `zrok` service—from Raspberry Pi to enterprise scale:
- Scales from small personal instances to large public services
- Built on the same codebase as the public `zrok.io` service
📋 [Self-Hosting Guide](https://docs.zrok.io/docs/guides/self-hosting/self_hosting_guide/)
[Self-Hosting Guide](https://docs.zrok.io/docs/guides/self-hosting/self_hosting_guide/)
## Resources
- 📚 **[Documentation](https://docs.zrok.io/)**
- 🎥 **[Office Hours Videos](https://www.youtube.com/watch?v=Edqv7yRmXb0&list=PLMUj_5fklasLuM6XiCNqwAFBuZD1t2lO2)**
- 🔨 **[Building from Source](./BUILD.md)**
- 🤝 **[Contributing](./CONTRIBUTING.md)**
- **[Documentation](https://docs.zrok.io/)**
- **[Office Hours Videos](https://www.youtube.com/watch?v=Edqv7yRmXb0&list=PLMUj_5fklasLuM6XiCNqwAFBuZD1t2lO2)**
- **[Building from Source](./BUILD.md)**
- **[Contributing](./CONTRIBUTING.md)**
---
+21 -2
View File
@@ -78,7 +78,14 @@ func (a *Agent) Run() error {
if a.cfg.ConsoleEnabled {
go a.gateway()
}
go a.remoteAgent()
failure := make(chan error, 1)
go a.remoteAgent(failure)
go func() {
err := <-failure
if a.cfg.RequireRemoting {
panic(errors.Errorf("remote agent requires remoting: %v", err))
}
}()
a.persistRegistry = false
if err := a.ReloadRegistry(); err != nil {
@@ -286,16 +293,22 @@ func (a *Agent) SaveRegistry() error {
return nil
}
func (a *Agent) remoteAgent() {
func (a *Agent) remoteAgent(failure chan error) {
enrollmentPath, err := a.root.AgentEnrollment()
if err != nil {
dl.Errorf("unable to get agent enrollment path: %v", err)
if failure != nil {
failure <- err
}
return
}
enrollment, err := LoadEnrollment(enrollmentPath)
if err != nil {
dl.Warnf("unable to load agent enrollment: %v", err)
if failure != nil {
failure <- err
}
return
}
@@ -304,6 +317,9 @@ func (a *Agent) remoteAgent() {
l, err := sdk.NewListener(enrollment.Token, a.root)
if err != nil {
dl.Errorf("error listening for remote agent: %v", err)
if failure != nil {
failure <- err
}
return
}
@@ -311,6 +327,9 @@ func (a *Agent) remoteAgent() {
agentGrpc.RegisterAgentServer(srv, &agentGrpcImpl{agent: a})
if err := srv.Serve(l); err != nil {
dl.Errorf("error serving: %v", err)
if failure != nil {
failure <- err
}
return
}
}
+2
View File
@@ -7,6 +7,7 @@ type AgentConfig struct {
ConsoleStartPort uint16 `json:"console_start_port"`
ConsoleEndPort uint16 `json:"console_end_port"`
ConsoleEnabled bool `json:"console_enabled"`
RequireRemoting bool `json:"require_remoting"`
MaxRetries int `json:"max_retries,omitempty"`
RetryInitialDelay time.Duration `json:"retry_initial_delay,omitempty"`
RetryMaxDelay time.Duration `json:"retry_max_delay,omitempty"`
@@ -19,6 +20,7 @@ func DefaultConfig() *AgentConfig {
ConsoleStartPort: 8080,
ConsoleEndPort: 8181,
ConsoleEnabled: true,
RequireRemoting: false,
MaxRetries: -1, // unlimited
RetryInitialDelay: 30 * time.Second,
RetryMaxDelay: 8 * time.Minute,
+5
View File
@@ -4,7 +4,10 @@ package proctree
import (
"os/exec"
"strings"
"sync"
"github.com/sirupsen/logrus"
)
func Init(_ string) error {
@@ -12,6 +15,8 @@ func Init(_ string) error {
}
func StartChild(tail TailFunction, args ...string) (*Child, error) {
logrus.Infof("executing '%v'", strings.Join(args, " "))
cmd := exec.Command(args[0], args[1:]...)
cld := &Child{
+7 -2
View File
@@ -3,10 +3,13 @@
package proctree
import (
"github.com/kolesnikovae/go-winjob"
"golang.org/x/sys/windows"
"os/exec"
"strings"
"sync"
"github.com/kolesnikovae/go-winjob"
"github.com/sirupsen/logrus"
"golang.org/x/sys/windows"
)
var job *winjob.JobObject
@@ -23,6 +26,8 @@ func Init(name string) error {
}
func StartChild(tail TailFunction, args ...string) (*Child, error) {
logrus.Infof("executing '%v'", strings.Join(args, " "))
cmd := exec.Command(args[0], args[1:]...)
cmd.SysProcAttr = &windows.SysProcAttr{CreationFlags: windows.CREATE_SUSPENDED}
+1 -1
View File
@@ -204,7 +204,7 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
+2 -2
View File
@@ -825,8 +825,8 @@ github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQ
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=