feat: implement Remote WinBox worker, API, frontend integration, OpenBao persistence, and supporting docs
This commit is contained in:
@@ -18,14 +18,14 @@ import (
|
||||
"github.com/bsm/redislock"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/bus"
|
||||
"github.com/mikrotik-portal/poller/internal/config"
|
||||
"github.com/mikrotik-portal/poller/internal/observability"
|
||||
"github.com/mikrotik-portal/poller/internal/poller"
|
||||
"github.com/mikrotik-portal/poller/internal/sshrelay"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/tunnel"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/bus"
|
||||
"github.com/staack/the-other-dude/poller/internal/config"
|
||||
"github.com/staack/the-other-dude/poller/internal/observability"
|
||||
"github.com/staack/the-other-dude/poller/internal/poller"
|
||||
"github.com/staack/the-other-dude/poller/internal/sshrelay"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/tunnel"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module github.com/mikrotik-portal/poller
|
||||
module github.com/staack/the-other-dude/poller
|
||||
|
||||
go 1.25.0
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
)
|
||||
|
||||
// ErrLockNotObtained is returned when a backup lock cannot be acquired
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
natsserver "github.com/nats-io/nats-server/v2/server"
|
||||
"github.com/nats-io/nats.go"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
)
|
||||
|
||||
// mockDeviceStore implements a minimal device store for testing.
|
||||
|
||||
@@ -18,9 +18,9 @@ import (
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/device"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/device"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// CertDeployResponder handles NATS request-reply for certificate deployment.
|
||||
|
||||
@@ -16,9 +16,9 @@ import (
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/device"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/device"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// CmdResponder handles NATS request-reply for device commands.
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// CredentialSubscriber listens for credential change events and invalidates
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/nats-io/nats.go"
|
||||
"github.com/nats-io/nats.go/jetstream"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/device"
|
||||
"github.com/staack/the-other-dude/poller/internal/device"
|
||||
)
|
||||
|
||||
// DeviceStatusEvent is the payload published to NATS JetStream when a device
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/bus"
|
||||
"github.com/mikrotik-portal/poller/internal/testutil"
|
||||
"github.com/staack/the-other-dude/poller/internal/bus"
|
||||
"github.com/staack/the-other-dude/poller/internal/testutil"
|
||||
)
|
||||
|
||||
func TestPublisher_PublishStatus_Integration(t *testing.T) {
|
||||
|
||||
@@ -13,9 +13,9 @@ import (
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/tunnel"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/tunnel"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// TunnelOpenRequest is the JSON payload for a tunnel.open NATS request.
|
||||
|
||||
@@ -13,11 +13,11 @@ import (
|
||||
"github.com/bsm/redislock"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/bus"
|
||||
"github.com/mikrotik-portal/poller/internal/device"
|
||||
"github.com/mikrotik-portal/poller/internal/observability"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/bus"
|
||||
"github.com/staack/the-other-dude/poller/internal/device"
|
||||
"github.com/staack/the-other-dude/poller/internal/observability"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// backupDeviceState tracks per-device backup state.
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/device"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/device"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
)
|
||||
|
||||
// mockSSHHostKeyUpdater implements SSHHostKeyUpdater for testing.
|
||||
|
||||
@@ -13,9 +13,9 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/bus"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/testutil"
|
||||
"github.com/staack/the-other-dude/poller/internal/bus"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/testutil"
|
||||
)
|
||||
|
||||
// TestPollPublishConsumeCycle_Integration verifies the complete pipeline:
|
||||
|
||||
@@ -3,7 +3,7 @@ package poller
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
)
|
||||
|
||||
// DeviceFetcher is the subset of store.DeviceStore that the Scheduler needs.
|
||||
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
|
||||
"github.com/bsm/redislock"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/bus"
|
||||
"github.com/mikrotik-portal/poller/internal/observability"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/bus"
|
||||
"github.com/staack/the-other-dude/poller/internal/observability"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// deviceState tracks per-device circuit breaker and lifecycle state.
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// mockDeviceFetcher implements DeviceFetcher for testing.
|
||||
|
||||
@@ -12,11 +12,11 @@ import (
|
||||
"github.com/bsm/redislock"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/bus"
|
||||
"github.com/mikrotik-portal/poller/internal/device"
|
||||
"github.com/mikrotik-portal/poller/internal/observability"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/bus"
|
||||
"github.com/staack/the-other-dude/poller/internal/device"
|
||||
"github.com/staack/the-other-dude/poller/internal/observability"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// ErrDeviceOffline is returned by PollDevice when a device cannot be reached.
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/mikrotik-portal/poller/internal/bus"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/bus"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"golang.org/x/crypto/ssh"
|
||||
"nhooyr.io/websocket"
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/testutil"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/testutil"
|
||||
)
|
||||
|
||||
func TestDeviceStore_FetchDevices_Integration(t *testing.T) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"github.com/testcontainers/testcontainers-go/modules/redis"
|
||||
"github.com/testcontainers/testcontainers-go/wait"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
)
|
||||
|
||||
// devicesSchema is the minimal DDL needed for integration tests against the
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/mikrotik-portal/poller/internal/store"
|
||||
"github.com/mikrotik-portal/poller/internal/vault"
|
||||
"github.com/staack/the-other-dude/poller/internal/store"
|
||||
"github.com/staack/the-other-dude/poller/internal/vault"
|
||||
)
|
||||
|
||||
// OpenTunnelResponse is returned by Manager.OpenTunnel.
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
|
||||
"github.com/mikrotik-portal/poller/internal/device"
|
||||
"github.com/staack/the-other-dude/poller/internal/device"
|
||||
)
|
||||
|
||||
// CachedCreds holds decrypted device credentials.
|
||||
|
||||
Reference in New Issue
Block a user