Neil Alexander
fd46eab3b9
Linter update & fixes
2026-01-18 14:51:52 +00:00
Neil Alexander
306c4c624b
Add sort= option to getPeers (uptime, cost or default if not specified)
...
Signed-off-by: Neil Alexander <neilalexander@users.noreply.github.com >
2025-11-09 23:39:22 +00:00
Neil
9398cae230
Expose download/upload rate per peer ( #1206 )
2024-11-19 08:42:27 +00:00
Klemens Nanni
834680045a
Create admin socket synchronously before privdrop ( #1201 )
...
Creating UNIX sockets the listen() goroutine that races against the main
one dropping to an unprivileged user may cause startup failure when
privdrop happens before privileged filesystem access.
Setup or fail in New() and only do listen(2) in listen() to avoid this.
```
# yggdrasil -autoconf -user nobody
2024/11/03 21:15:27 Build name: yggdrasil-go
2024/11/03 21:15:27 Build version: 0.5.9
...
2024/11/03 21:15:27 Admin socket failed to listen: listen unix /var/run/yggdrasil.sock: bind: permission denied
```
Rerun, now the order is flipped:
```
# yggdrasil -autoconf -user nobody
2024/11/03 21:15:34 Build name: yggdrasil-go
2024/11/03 21:15:34 Build version: 0.5.9
[...]
2024/11/03 21:15:34 UNIX admin socket listening on /var/run/yggdrasil.sock
[...]
```
Fixes #927 .
2024-11-11 19:27:02 +00:00
Klemens Nanni
a6429390da
Use UNIX socket patch from url struct ( #1186 )
...
No need to extract it again when the url package provides it for us:
```
$ jq -n '{"AdminListen":"unix:///tmp/ygg.sock"}' | ./yggdrasil -useconf | grep 'admin socket'
2024/10/08 22:41:11 UNIX admin socket listening on /tmp/ygg.sock
```
Follow-up on #1176
2024-10-17 13:22:46 +01:00
Klemens Nanni
874083da79
Replace repeated subscripts with single TrimPrefix ( #1176 )
...
This stood out to me while reading the code: [7:] is skipping "unix://",
so why not do that?
Doing so reveals a bug in the last line changed, where chmod(2) failure
would print just the prefix, not everything but it... easy to miss, but
now this kind of bug can no longer happen.
2024-09-30 14:25:04 +01:00
Neil Alexander
04c0acf71b
Various clean-ups
2024-07-20 12:31:58 +01:00
Neil Alexander
7afa23be4c
Link refactoring, admin socket changes
2023-05-19 19:09:05 +01:00
Arceliar
669e61af9a
update to bugfixed ironwood, fix broken core test, add getPaths handler to admin socket
2023-05-13 16:15:04 -05:00
Arceliar
5e95246c26
update to ironwood v0.0.0-20230513191034-495699d87ae4 with API changes
2023-05-13 14:44:38 -05:00
Arceliar
e99c870d51
update admin functions and fix core tests
2023-03-26 16:49:40 -05:00
Neil Alexander
cfa293d189
Fix bug in admin socket where requests fail unless "arguments":{} is specified in the JSON
2022-10-26 22:29:19 +01:00
Neil Alexander
69632bacb5
Tidy up
2022-10-02 13:20:39 +01:00
ehmry
7db934488e
Reimplement AddPeer and RemovePeer for admin socket ( #951 )
...
* Reimplement AddPeer and RemovePeer for admin socket
Fix #950
* Disconnect the peer on `removePeer`
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com >
2022-10-02 12:35:43 +01:00
Neil Alexander
c922eba2d8
Fix sending arguments to the admin socket in yggdrasilctl
2022-09-24 21:28:09 +01:00
Neil Alexander
b67c313f44
Admin socket and yggdrasilctl improvements
...
This refactors the request parsing, as well as improving the output for some request types. It also tweaks `yggdrasilctl` output, which should help with #947 .
2022-09-24 12:22:38 +01:00
Neil Alexander
5ef61faeff
Link refactor ( #941 )
...
* Link refactoring
* More refactoring
* More tweaking
* Cleaner shutdowns, UNIX socket support, more tweaks
* Actorise links, remove mutex
* SOCKS support
2022-09-17 20:07:00 +01:00
Neil Alexander
b1f61fb0a8
Refactor admin socket setup (isolated config)
2022-09-03 11:54:46 +01:00
Neil Alexander
c6fe81b5d2
Admin socket and yggdrasilctl refactoring ( #939 )
2022-09-03 10:50:43 +01:00
Karandashov Daniil
486ffebedd
Delete unused param ( #935 )
2022-08-29 20:40:19 +01:00
Neil Alexander
90f9be38c5
Fix lint errors
2022-04-17 17:56:54 +01:00
Alex Kotov
538ee13669
Add type core.AddHandlerFunc
2021-09-01 06:16:57 +05:00
Arceliar
8f91f0c050
fix nodeinfo and debug admin functions, this is ugly / a hack, but it works i guess...
2021-06-13 05:43:03 -05:00
Neil Alexander
166336a418
Remove config.NodeState (hot reconfig is no longer supported)
2021-06-02 14:19:32 +01:00
Arceliar
1db7437b80
more cleanup and fix a busyloop when the admin socket is shut down
2021-05-29 21:37:13 -05:00
Arceliar
018f35d9a2
rename src/yggdrasil to src/core
2021-05-23 14:42:26 -05:00
Arceliar
8d09e68e80
admin socket getpaths
2021-05-16 16:16:58 -05:00
Neil Alexander
31c1c9b586
Fix admin socket list
2021-05-16 20:53:40 +01:00
Neil Alexander
416eadbcff
Use uint64 for MTU for forward-compatibility
2021-05-16 20:00:45 +01:00
Neil Alexander
2d01386d6e
Refactor admin socket, export request/response structs, remove types package
2021-05-16 19:51:09 +01:00
Arceliar
7e10025ef0
get minimal admin socket working (introspection only, no ability to add peers etc)
2021-05-15 15:16:35 -05:00
Neil Alexander
57ea61b338
Remove reconfiguration on SIGHUP - it didn't work reliably anyway
2021-05-10 22:47:28 +01:00
Arceliar
0cff56fcc1
(broken state) WIP on tuntap
2021-05-08 10:39:07 -05:00
Arceliar
ace7b43b6d
(broken state) WIP address migration
2021-05-08 07:25:53 -05:00
Ryan Westlund
d6d2d9c19a
Accept some golint suggestions ( #690 )
...
* Fixed some linter issues
* Simplified isBetter method
* Accept some linter suggestions
* Fix typo
Co-authored-by: klesomik <klesomiks@gmail.com >
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com >
2020-09-27 14:42:46 +01:00
George
48f008a8e2
Implement Core.RemovePeer method ( #699 ) ( #709 )
...
Co-authored-by: George <zhoreeq@users.noreply.github.com >
2020-07-06 14:14:34 +01:00
Neil Alexander
337626a32c
Act multicast updates for safety
2019-10-23 11:12:51 +01:00
Neil Alexander
a072e063d8
Define module.Module interface, update admin/tuntap/multicast modules to comply with it, fix #581
2019-10-23 10:44:58 +01:00
Slex
589ad638ea
Implement feature from https://github.com/yggdrasil-network/yggdrasil-go/issues/488
2019-08-11 00:31:22 +03:00
Neil Alexander
2ee00fcc09
Return box_pub_key as hex string in JSON (replaces #481 )
2019-08-05 10:21:40 +01:00
Neil Alexander
3a2ae9d902
Update API to represent coords as []uint64
2019-08-05 10:17:19 +01:00
Neil Alexander
37533f157d
Make some API changes (currently broken)
2019-08-05 00:30:12 +01:00
Neil Alexander
24f4754f2b
Export NodeInfoPayload type, rename some API functions
2019-07-28 11:30:24 +01:00
Neil Alexander
de1005e4fa
Various API changes and simplifications to fix mobile builds
2019-07-27 15:00:09 +01:00
Neil Alexander
8669091a08
Don't send IP back twice with getPeers
2019-07-22 19:45:48 +01:00
Neil Alexander
ea9d5db16d
Make admin socket output a bit friendlier ( fixes #385 )
2019-07-07 19:41:53 +01:00
Neil Alexander
78eb40cbad
Record session uptime (purely for the admin socket)
2019-05-29 12:59:36 +01:00
Neil Alexander
5b8d8a9341
Reimplement getNodeInfo, dhtPing, get/add/removeAllowedEncryptionPublicKey, add/removePeer
2019-05-20 19:51:44 +01:00
Neil Alexander
e9e2d7bc6f
Remove debug println
2019-05-19 22:03:20 +01:00
Neil Alexander
d575b83ec1
Refactor admin socket somewhat, allow modules to set up their own handlers
2019-05-19 22:02:04 +01:00