Commit Graph

2525 Commits

Author SHA1 Message Date
Neil Alexander
36b6399bb7 Enable Go 1.26 in CI 2026-02-19 16:12:02 +00:00
Neil Alexander
f3c4cdd89e Yggdrasil 0.5.13-RC.1 v0.5.13-RC.1 2026-01-19 16:36:32 +00:00
Andrei Tregubov
9184cd23e5 Fix outbound link-local connections on mobile (#1300) 2026-01-18 19:12:31 +00:00
Alex
20155a2081 Add windows build file (#1240)
bat file to build in windows

Co-authored-by: SadovovAlex <aasdvv@gmail.com>
2026-01-18 15:06:26 +00:00
Neil Alexander
9e781cc912 Fix lint error 2026-01-18 15:04:28 +00:00
Neil Alexander
aad8c9a9cb Update GHA dependencies 2026-01-18 15:02:52 +00:00
mirefly42
df48ac2ada Fix default config permissions (#1253)
Currently, all init scripts, except for systemd, will generate a config
file with default permissions, which is usually `rw-r--r--`.
This is bad, because the config contains a private key.

The systemd service does `chmod 640` after creating the config, which is
much better than just leaving it readable for everyone forever, but
there is still a slight chance that some malicious program might steal
the private key during the time window between key creation and chmod.

For this reason, in this pull request I use `umask 037`, so the config
won't have read permission for others in the first place.

Note that I have only tested openrc and systemd services.

Also, I'm not sure what to do with the contrib/msi/build-msi.sh script,
which creates a bat file that generates a config. I don't know anything
about file permissions on windows, however, it seems that the bat file
generates the config into a user's personal directory, so maybe it's
already somewhat fine.
2026-01-18 14:58:00 +00:00
Neil Alexander
fd46eab3b9 Linter update & fixes 2026-01-18 14:51:52 +00:00
Neil Alexander
24482b7dbe Run go fix, corrects mostly build tags 2026-01-18 14:47:18 +00:00
Neil Alexander
f7c6c9e1c5 Revert tablewriter update as breaking 2026-01-18 12:03:07 +00:00
Sergey Alirzaev
33831f606f core: removed unused addPeerTimer code
Resolves #1279
2026-01-18 11:57:27 +00:00
Revertron
962adc2994 Update yggdrasil.service.debian (#1290)
Can't start service without reading config.
Without explicit allow directive it can't read it.
2026-01-18 11:50:51 +00:00
Neil Alexander
84b1f4a96b Update dependencies 2026-01-18 11:48:43 +00:00
Neil Alexander
75e4c9287e Adjust how cost is used to behave more intuitively
Co-authored-by: Arceliar <Arceliar@users.noreply.github.com>
2026-01-18 11:42:00 +00:00
Neil Alexander
ae405adf7c Update to Arceliar/ironwood@e1358f7905 to reduce heap allocations 2025-11-24 09:29:15 +00:00
Neil Alexander
bde65aa239 Fix backpressure issue when TUN is disabled 2025-11-23 22:06:25 +00:00
Neil Alexander
b43e213c32 Don't re-attempt connections when detecting a connection to self
Closes #1286.
2025-11-11 23:18:56 +00:00
Neil Alexander
b920e17f24 Do not report error in getPeers before it has happened 2025-11-11 23:18:37 +00:00
Neil Alexander
a2272a0216 Tweak lint step to checkout first 2025-11-10 19:53:22 +00:00
Neil Alexander
aafe751545 Use go.mod-specified Go version for lint step 2025-11-10 19:52:00 +00:00
Neil Alexander
56044b822b Fix build issues from QUIC dependency update 2025-11-10 19:48:01 +00:00
Neil Alexander
1e48a4c4c9 Update to Go 1.24 minimum, update dependencies 2025-11-10 19:44:37 +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 Alexander
d0b5352db3 Tweak Docker tags 2025-10-04 10:55:45 +01:00
Dmitriy Pervin
284894fe40 Add multi-arch Docker build & GHCR publishing (#1278)
# Summary
This PR addresses failures to run Yggdrasil on ARM systems. The root
cause was the lack of ARM artifacts/images, which led to exec format
error and similar issues.

## What’s added:
- ```Dockerfile.multiarch``` — multi-stage Go build that correctly
propagates GOOS/GOARCH for linux/amd64, linux/arm64, linux/armhf and
linux/armel platform.
- ```entrypoint.sh``` - Introduced ENV **ALLOW_IPV6_FORWARDING**. When
set to a truthy value (e.g., true), the entrypoint executes: ```sysctl
-w net.ipv6.conf.all.forwarding=1```.
- GitHub Action for multi-arch builds and publishing to GHCR — triggered
via ```workflow_dispatch```, push to ```master``` and release via tags
(with docker semantic tags e.g. v0.5.12 → 0.5.12, 0.5, 0).

Example published images:

[https://github.com/Forne/yggdrasil-go/pkgs/container/yggdrasil-go](https://github.com/Forne/yggdrasil-go/pkgs/container/yggdrasil-go)

## Testing
 Ubuntu (24.04, amd64) — image runs correctly.
 macOS (Apple Silicon, arm64) — image runs correctly.
 MikroTik RouterOS (arm64) — image runs under the RouterOS container
package.
2025-10-04 10:51:43 +01:00
Neil Alexander
89a3718d59 Add Go 1.25 to CI pipeline 2025-08-16 11:49:37 +01:00
Klemens Nanni
6d195c6de3 OpenBSD: Pledge full filesystem read for Go's resolv.conf polling (#1275)
sys/kern/kern_pledge.c r1.329[0] removed the unveil bypass for "dns",
so "rpath" is needed for Go's DNS to stat(2) it.

Since current "/ rwc" and "cpath" with the new "rpath" amount to full
read access, there is no point in unveiling anymore.

0:
8d49ad01ac
2025-08-11 23:39:52 +01:00
Neil Alexander
429403aea5 Update CI workers for packaging pipeline 2025-06-22 23:00:44 +01:00
Neil Alexander
ffc0dc92e0 Reduce minimum maxbackoff to 5 seconds 2025-06-22 16:37:34 +01:00
Neil Alexander
81543e9cc0 Remove Go 1.22 from CI 2025-06-21 20:09:12 +01:00
Neil Alexander
9e5c25d4af Update to Go 1.23, update dependencies 2025-06-21 20:08:08 +01:00
Neil
390dba0471 Update readme 2025-06-02 22:02:02 +01:00
Sergey Alirzaev
47818a1a7c apparmor: add yggdrasilctl policy (#1235) 2025-04-15 17:17:52 +01:00
Sergey Alirzaev
6377d7f071 contrib/openrc: remove SIGHUP logic (#1236)
as it is long gone from the daemon code
and unexpectedly kills the daemon
2025-04-15 17:15:09 +01:00
Neil Alexander
5b8dbc8b1e Add summary helpers to mobile wrapper 2025-03-31 10:18:57 +01:00
patrini32
73705ff09d Typo fix (#1232) 2025-02-20 09:45:49 +00:00
Neil Alexander
3b18909f70 Update dependencies 2025-02-18 12:57:58 +00:00
Neil Alexander
58b727d1f0 Add Go 1.24 to CI 2025-02-18 12:52:21 +00:00
Klemens Nanni
782c0250d7 Use pledge(2) on OpenBSD (#1215)
Straight forward thanks to all privileged operations being done early
enough during startup.
2024-12-22 11:04:26 +00:00
Neil Alexander
213f72b840 Yggdrasil 0.5.12 v0.5.12 2024-12-18 22:34:30 +00:00
Neil Alexander
1fbcf3b3c2 Rename latency_ms to latency in getPeers response since it isn't even milliseconds anymore 2024-12-18 22:21:23 +00:00
Peter Gervai
22bc9c44e2 genkeys print the number of generated keys (#1217)
It is good to know how many resources have we carelessly wasted. :-)
2024-12-18 19:56:46 +00:00
Neil
9c73bacab9 Update to Go 1.22, quic-go/quic-go@v0.48.2 (#1218)
Our dependencies are now moving beyond Go 1.21 so need to update.

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2024-12-13 23:33:26 +00:00
Neil Alexander
04be129878 Update to Arceliar/ironwood@743fe2f 2024-12-13 23:12:36 +00:00
Neil Alexander
657f7e0db3 Fix empty user/group detection on chuser
This should fix #1216.
2024-12-13 16:55:25 +00:00
Neil
7adf5f18b7 Yggdrasil 0.5.11 (#1214)
Changelog updates.

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
v0.5.11
2024-12-12 19:26:54 +00:00
Neil Alexander
69451fe969 Specify TLS 1.2-TLS 1.3 supported range for client connections
Should fix #1208.
2024-12-12 19:07:55 +00:00
Klemens Nanni
2d587740c1 genkeys, yggdrasilctl: Use pledge(2) on OpenBSD (#1193)
Restrict system operations of CLI tools with
https://man.openbsd.org/pledge.2.

https://pkg.go.dev/suah.dev/protect abstracts the OS specific code, i.e.
is a NOOP on non-OpenBSD systems.

This PR is to gauge upstream interest in this direction; my OpenBSD port
of yggdrasil already pledges the daemon,
resulting in minimal runtime privileges, but there are still a few rough
edges:

https://github.com/jasperla/openbsd-wip/blob/master/net/yggdrasil/patches/patch-cmd_yggdrasil_main_go#L80

---------

Co-authored-by: Neil <git@neilalexander.dev>
2024-12-12 18:48:24 +00:00
Neil Alexander
b2b0396d48 Update dependencies 2024-12-12 18:42:53 +00:00
Klemens Nanni
83ec58afc7 Use unveil(2) on OpenBSD (#1194)
After #1175 removed ioctl(2) fallback code shelling out to ifconfig(8),
there is no code left (compiled on OpenBSD) that would fork(2) or
execve(2).

Drop the ability to run any executable file to double down on this, thus
reducing the attack surface of this this experimental, internet facing
daemon running as root.

pledge(2) is doable, but needs more polish.
unveil(2), however, is as simple as it gets.

On other systems, this code is a NOOP, but can still help to implement
similar safety belts.
2024-12-12 18:37:02 +00:00