Commit graph

39 commits

Author SHA1 Message Date
6eb8d1ed20
ci: opt into Node.js 24 for GitHub Actions 2026-03-24 12:48:57 -05:00
dependabot[bot]
c8fd223525
Bump docker/login-action from 3 to 4
Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 19:41:18 +00:00
dependabot[bot]
6e386767d0
Bump actions/download-artifact from 7 to 8
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-04 19:37:25 +00:00
289bc3d4f1
fix docker tags by replacing colons in timestamp version
Docker tags cannot contain colons. Use a separate tag-safe format
(colons replaced with hyphens) for Docker tags while keeping the
RFC 3339 timestamp as the version baked into the binary.
2026-02-11 11:48:05 -06:00
297cb8fc91
use UTC timestamp for version instead of git describe 2026-02-11 11:44:19 -06:00
a757bd7615
Optimize CI caching for Blacksmith runners, fix SNMP bulk walk on Mikrotik
- Dockerfile: add BuildKit cache mounts for Go module and build caches,
  pin both stages to Alpine 3.23
- CI: replace BUILDKIT_INLINE_CACHE with registry-based layer caching
  (mode=max) for branch and release builds
- .dockerignore: exclude test files, Rust legacy, nix, and other
  non-build artifacts from Docker context
- SNMP: lower MaxRepetitions from default 50 to 10 to prevent Mikrotik
  routers from timing out during bulk walks
2026-02-11 10:31:10 -06:00
Graham McIntire
86da744e68
Merge pull request #21 from towerops-app/dependabot/github_actions/actions/checkout-6
Bump actions/checkout from 4 to 6
2026-02-11 10:20:14 -06:00
dependabot[bot]
51210a5986
Bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-11 16:20:06 +00:00
Graham McIntire
720ccb40e2
Merge pull request #20 from towerops-app/dependabot/github_actions/actions/upload-artifact-6
Bump actions/upload-artifact from 4 to 6
2026-02-11 10:19:59 -06:00
Graham McIntire
62e31e3d05
Merge pull request #18 from towerops-app/dependabot/github_actions/golangci/golangci-lint-action-9
Bump golangci/golangci-lint-action from 7 to 9
2026-02-11 10:19:40 -06:00
Graham McIntire
91820976ae
Merge pull request #19 from towerops-app/dependabot/github_actions/actions/setup-go-6
Bump actions/setup-go from 5 to 6
2026-02-11 10:19:26 -06:00
dependabot[bot]
c360705fd4
Bump actions/upload-artifact from 4 to 6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-11 16:18:57 +00:00
dependabot[bot]
e8ae0769a5
Bump actions/setup-go from 5 to 6
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-11 16:18:53 +00:00
dependabot[bot]
a72ad8a130
Bump golangci/golangci-lint-action from 7 to 9
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 7 to 9.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v7...v9)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-11 16:18:49 +00:00
dependabot[bot]
5757bd4a13
Bump actions/download-artifact from 4 to 7
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-11 16:18:45 +00:00
58d1af4f84
refactor some code 2026-02-11 10:17:01 -06:00
769ac1f623
Full rewrite in golang 2026-02-11 10:04:30 -06:00
a9bf0b0f8b
Switch from Alpine (musl) to Debian slim (glibc) to fix SNMP SIGSEGV
musl libc has weak fork-safety guarantees in multi-threaded processes.
When Tokio's runtime is running and we fork() for SNMP operations, musl's
internal state can be inconsistent in the child, causing SIGSEGV on every
SNMP walk to Ubiquiti devices. glibc handles this via pthread_atfork.

- Dockerfile: Alpine → rust:1.93-bookworm build + debian:12-slim runtime
- CI: Remove ensure-netsnmp-base/manifest jobs, simplify build deps
- Delete Dockerfile.netsnmp and netsnmp-base.yml workflow
- Add NULL pointer guards in snmp_helper.c for fork-safety
- Add SNMP exception type handling (NoSuchObject/Instance/EndOfMibView)
- Add crash reproduction tests
2026-02-11 08:41:06 -06:00
0b0d326892
Add net-snmp base image as CI prerequisite
The ensure-netsnmp-base jobs check if the pre-built image exists in
GHCR before any Docker builds start. First run compiles from source
on native runners (~5 min), subsequent runs skip with a ~5s check.

build-branch and build-release now depend on ensure-netsnmp-manifest.
2026-02-11 08:01:23 -06:00
2386f0d5a5
Upgrade net-snmp to 5.9.5.2 to fix SIGSEGV in SNMP walks
Alpine 3.23 ships net-snmp 5.9.4 which has segfault bugs in varbind
construction and buffer overflows in octet string handling. Version
5.9.5.2 fixes these issues.

Adds a pre-built base image (Dockerfile.netsnmp) compiled from source
so the net-snmp build doesn't run on every agent deploy. The base
image is built separately via the netsnmp-base workflow and referenced
in the main Dockerfile.
2026-02-10 17:58:43 -06:00
0db587338e
Use Blacksmith runner for amd64 release build
Switches from ubuntu-latest (2 vCPU) to blacksmith-4vcpu-ubuntu-2404
to match the arm64 build runner and speed up Rust compilation.
2026-02-10 16:52:59 -06:00
6bb33d1f8a
Update CI Rust toolchain to 1.93 to match Docker build 2026-02-10 15:30:15 -06:00
c3e411a565 Fix AMD64 FFI crash by using native AMD64 runners
The AMD64 builds were crashing due to cross-compilation. Blacksmith runners
are ARM64, so when building linux/amd64 on them, Docker uses QEMU emulation
which breaks the C FFI code in native/snmp_helper.c.

Solution:
- AMD64 builds now use GitHub's ubuntu-latest runners (native x86_64)
- ARM64 builds continue using Blacksmith ARM64 runners (native)
- Both architectures now build natively, eliminating FFI segfaults
2026-02-10 15:07:53 -06:00
28571b0243
Add webhook notification step to release workflow
After publishing a GitHub Release, notify towerops.net to trigger
mass agent updates via the new webhook endpoint.
2026-02-10 13:40:49 -06:00
b0f3b57671
Add restart and self-update handlers, publish standalone binaries
Handle server-initiated restart (exit for Docker restart) and
self-update (download binary, verify SHA256, replace via exec)
commands received over the WebSocket channel. Report architecture
in heartbeat so the server can select the correct binary.

- Add restart and update handlers in websocket_client.rs
- Add self_update() with download, checksum verification, and exec
- Add arch field to AgentHeartbeat protobuf
- Add reqwest and sha2 dependencies
- chown binary in Dockerfile for non-root self-update
- Extract standalone binaries from Docker images in CI
- Create GitHub Releases with binary assets on version tags
2026-02-10 13:06:23 -06:00
0cb673d9c4
Mirror release images to Docker Hub for legacy agent updates
Agents deployed with the old Docker Hub image (gmcintire/towerops-agent)
auto-update via Watchtower. This pushes release builds to both GHCR and
Docker Hub so those agents continue receiving updates.
2026-02-10 11:28:27 -06:00
ded4aba536
Add stickydisk caching for cargo git deps and Rust toolchain
- Cache ~/.cargo/git for git-sourced dependencies
- Cache ~/.rustup to avoid re-downloading toolchain each run
- Move format check before cargo check (fail fast on formatting)
2026-02-10 08:55:47 -06:00
62f0e1572a
Add libsnmp-dev to CI test dependencies
The test job needs net-snmp headers to compile the native snmp_helper.c
2026-02-10 08:21:38 -06:00
5ecada7646
cache improvements in ci 2026-02-02 13:44:40 -06:00
667045c34b
use blacksmith for amd64 build too 2026-02-02 13:39:51 -06:00
blacksmith-sh[bot]
720b56544b
Migrate workflows to Blacksmith 2026-02-02 19:34:56 +00:00
2bf47951cd
fix: use correct GitHub ARM runner label (ubuntu-24.04-arm) 2026-02-02 12:50:28 -06:00
998c4c4471
fail fast in ci 2026-02-02 12:45:43 -06:00
fbf2435165
build arm/amd in parallel natively 2026-02-02 12:29:35 -06:00
fa42254cfb
ci cache improvements 2026-02-01 08:28:56 -06:00
72ea5d56f0
improve ci speed 2026-01-31 17:21:09 -06:00
4254f47ea5
github release fix 2026-01-31 17:01:09 -06:00
be054323a6
more caching in github ci 2026-01-31 16:53:25 -06:00
5636b00f33
add github ci 2026-01-31 16:48:28 -06:00