Skip to content

Commit 9e03260

Browse files
committed
🐚 producer/sshclient: new package
1 parent 89a8ee6 commit 9e03260

6 files changed

Lines changed: 526 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Multiple IP address sources
1212
- `"asusrouter"`: Obtain WAN IPv4 address from ASUS router.
1313
- `"ipapi"`: Obtain public IPv4 and IPv6 addresses from IP address APIs.
14+
- `"ssh"`: Obtain IPv4 and IPv6 addresses from a remote host via SSH.
1415
- Monitor network interface IPv4 and IPv6 addresses
1516
- `"netlink"`: Use Linux's Netlink interface.
1617
- `"bsdroute"`: Use the routing socket (`route(4)`) on macOS, DragonFly BSD, FreeBSD, NetBSD, and OpenBSD.

docs/config.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,34 @@
3131
"poll_interval": "5m"
3232
}
3333
},
34+
{
35+
"name": "ssh router",
36+
"type": "ssh",
37+
"ssh": {
38+
"command4": "nvram get wan0_ipaddr",
39+
"command6": "nvram get ipv6_rtr_addr",
40+
"network": "tcp",
41+
"address": "router.local:22",
42+
"key_exchanges": [],
43+
"ciphers": [],
44+
"macs": [],
45+
"user": "admin",
46+
"keys": [
47+
{
48+
"private_key_path": ".ssh/id_ed25519",
49+
"private_key_passphrase": "",
50+
"certificate_path": ""
51+
}
52+
],
53+
"identity_agent": "none",
54+
"host_public_key_path": "",
55+
"known_hosts_paths": [],
56+
"host_key_algorithms": [
57+
"ssh-ed25519"
58+
],
59+
"poll_interval": "5m"
60+
}
61+
},
3462
{
3563
"name": "enp3s0",
3664
"type": "iface",

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ go 1.26.0
44

55
require (
66
github.com/lmittmann/tint v1.2.0
7+
golang.org/x/crypto v0.54.0
78
golang.org/x/sys v0.47.0
89
)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
github.com/lmittmann/tint v1.2.0 h1:AogHRHy8HUJUnNJBHJlYa+fR4YY8mko2cnCp67xn9JY=
22
github.com/lmittmann/tint v1.2.0/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
3+
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
4+
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
35
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
46
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
7+
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
8+
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=

0 commit comments

Comments
 (0)