Skip to content

Commit

Permalink
Merge pull request #4 from marko1777/master
Browse files Browse the repository at this point in the history
update modules
  • Loading branch information
dpamnezia authored Feb 24, 2025
2 parents 9115dc2 + f6095cd commit f2ae56d
Show file tree
Hide file tree
Showing 38 changed files with 94 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
amneziawg-go
euphoria
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.24 as awg
FROM golang:1.24 as euphoria

RUN apt-get update && apt install libluajit-5.1-dev -y
COPY . /awg
WORKDIR /awg
COPY . /euphoria
WORKDIR /euphoria

RUN go mod download && go mod verify

Expand All @@ -17,4 +17,4 @@ RUN apk --no-cache add iproute2 iptables bash && \
chmod +x /usr/bin/awg /usr/bin/awg-quick && \
ln -s /usr/bin/awg /usr/bin/wg && \
ln -s /usr/bin/awg-quick /usr/bin/wg-quick
COPY --from=awg /usr/bin/amneziawg-go /usr/bin/amneziawg-go
COPY --from=euphoria /usr/bin/euphoria /usr/bin/euphoria
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ generate-version-and-build:
[ "$$(cat version.go 2>/dev/null)" != "$$ver" ] && \
echo "$$ver" > version.go && \
git update-index --assume-unchanged version.go || true
@$(MAKE) amneziawg-go
@$(MAKE) euphoria

amneziawg-go: $(wildcard *.go) $(wildcard */*.go)
euphoria: $(wildcard *.go) $(wildcard */*.go)
go build -tags luajit -ldflags="-w -s" -trimpath -v -o "$@"

install: amneziawg-go
@install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 "$<" "$(DESTDIR)$(BINDIR)/amneziawg-go"
install: euphoria
@install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 "$<" "$(DESTDIR)$(BINDIR)/euphoria"

test:
go test ./...

clean:
rm -f amneziawg-go
rm -f euphoria

.PHONY: all clean test install generate-version-and-build
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Go Implementation of AmneziaWG
# Go Implementation of Euphoria

AmneziaWG is a contemporary version of the WireGuard protocol. It's a fork of WireGuard-Go and offers protection against detection by Deep Packet Inspection (DPI) systems. At the same time, it retains the simplified architecture and high performance of the original.

Expand All @@ -11,17 +11,17 @@ As a result, AmneziaWG maintains high performance while adding an extra layer of
Simply run:

```
$ amneziawg-go wg0
$ euphoria wg0
```

This will create an interface and fork into the background. To remove the interface, use the usual `ip link del wg0`, or if your system does not support removing interfaces directly, you may instead remove the control socket via `rm -f /var/run/amneziawg/wg0.sock`, which will result in amneziawg-go shutting down.
This will create an interface and fork into the background. To remove the interface, use the usual `ip link del wg0`, or if your system does not support removing interfaces directly, you may instead remove the control socket via `rm -f /var/run/euphoria/wg0.sock`, which will result in euphoria shutting down.

To run amneziawg-go without forking to the background, pass `-f` or `--foreground`:
To run euphoria without forking to the background, pass `-f` or `--foreground`:

```
$ amneziawg-go -f wg0
$ euphoria -f wg0
```
When an interface is running, you may use [`amneziawg-tools `](https://github.com/amnezia-vpn/amneziawg-tools) to configure it, as well as the usual `ip(8)` and `ifconfig(8)` commands.
When an interface is running, you may use [`euphoria-tools`](https://github.com/amnezia-vpn/euphoria-tools) to configure it, as well as the usual `ip(8)` and `ifconfig(8)` commands.

To run with more logging you may set the environment variable `LOG_LEVEL=debug`.

Expand All @@ -31,22 +31,17 @@ To run with more logging you may set the environment variable `LOG_LEVEL=debug`.

This will run on Linux; you should run amnezia-wg instead of using default linux kernel module.

### macOS

This runs on macOS using the utun driver. It does not yet support sticky sockets, and won't support fwmarks because of Darwin limitations. Since the utun driver cannot have arbitrary interface names, you must either use `utun[0-9]+` for an explicit interface name or `utun` to have the kernel select one for you. If you choose `utun` as the interface name, and the environment variable `WG_TUN_NAME_FILE` is defined, then the actual name of the interface chosen by the kernel is written to the file specified by that variable.
This runs on MacOS, you should use it from [amneziawg-apple](https://github.com/amnezia-vpn/amneziawg-apple)

### Windows

This runs on Windows, you should use it from [amneziawg-windows](https://github.com/amnezia-vpn/amneziawg-windows), which uses this as a module.
This runs on Windows, you should use it from [euphoria-windows](https://github.com/amnezia-vpn/euphoria-windows), which uses this as a module.


## Building

This requires an installation of the latest version of [Go](https://go.dev/).

```
$ git clone https://github.com/amnezia-vpn/amneziawg-go
$ cd amneziawg-go
$ git clone https://github.com/amnezia-vpn/euphoria
$ cd euphoria
$ make
```
2 changes: 1 addition & 1 deletion conn/bind_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"golang.org/x/sys/windows"

"github.com/amnezia-vpn/amneziawg-go/conn/winrio"
"github.com/amnezia-vpn/euphoria/conn/winrio"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion conn/bindtest/bindtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"net/netip"
"os"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/euphoria/conn"
)

type ChannelBind struct {
Expand Down
2 changes: 1 addition & 1 deletion device/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package device
import (
"errors"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/euphoria/conn"
)

type DummyDatagram struct {
Expand Down
12 changes: 6 additions & 6 deletions device/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"sync/atomic"
"time"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/amneziawg-go/device/internal/adapter"
"github.com/amnezia-vpn/amneziawg-go/ipc"
"github.com/amnezia-vpn/amneziawg-go/ratelimiter"
"github.com/amnezia-vpn/amneziawg-go/rwcancel"
"github.com/amnezia-vpn/amneziawg-go/tun"
"github.com/amnezia-vpn/euphoria/conn"
"github.com/amnezia-vpn/euphoria/device/internal/adapter"
"github.com/amnezia-vpn/euphoria/ipc"
"github.com/amnezia-vpn/euphoria/ratelimiter"
"github.com/amnezia-vpn/euphoria/rwcancel"
"github.com/amnezia-vpn/euphoria/tun"
"github.com/tevino/abool/v2"
)

Expand Down
8 changes: 4 additions & 4 deletions device/device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"testing"
"time"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/amneziawg-go/conn/bindtest"
"github.com/amnezia-vpn/amneziawg-go/tun"
"github.com/amnezia-vpn/amneziawg-go/tun/tuntest"
"github.com/amnezia-vpn/euphoria/conn"
"github.com/amnezia-vpn/euphoria/conn/bindtest"
"github.com/amnezia-vpn/euphoria/tun"
"github.com/amnezia-vpn/euphoria/tun/tuntest"
)

// uapiCfg returns a string that contains cfg formatted use with IpcSet.
Expand Down
4 changes: 2 additions & 2 deletions device/junk_creator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"testing"

"github.com/amnezia-vpn/amneziawg-go/conn/bindtest"
"github.com/amnezia-vpn/amneziawg-go/tun/tuntest"
"github.com/amnezia-vpn/euphoria/conn/bindtest"
"github.com/amnezia-vpn/euphoria/tun/tuntest"
)

func setUpJunkCreator(t *testing.T) (junkCreator, error) {
Expand Down
2 changes: 1 addition & 1 deletion device/keypair.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync/atomic"
"time"

"github.com/amnezia-vpn/amneziawg-go/replay"
"github.com/amnezia-vpn/euphoria/replay"
)

/* Due to limitations in Go and /x/crypto there is currently
Expand Down
2 changes: 1 addition & 1 deletion device/noise-protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/poly1305"

"github.com/amnezia-vpn/amneziawg-go/tai64n"
"github.com/amnezia-vpn/euphoria/tai64n"
)

type handshakeState int
Expand Down
4 changes: 2 additions & 2 deletions device/noise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"encoding/binary"
"testing"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/amneziawg-go/tun/tuntest"
"github.com/amnezia-vpn/euphoria/conn"
"github.com/amnezia-vpn/euphoria/tun/tuntest"
)

func TestCurveWrappers(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion device/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sync/atomic"
"time"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/euphoria/conn"
)

type Peer struct {
Expand Down
2 changes: 1 addition & 1 deletion device/queueconstants_android.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package device

import "github.com/amnezia-vpn/amneziawg-go/conn"
import "github.com/amnezia-vpn/euphoria/conn"

/* Reduce memory consumption for Android */

Expand Down
2 changes: 1 addition & 1 deletion device/queueconstants_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package device

import "github.com/amnezia-vpn/amneziawg-go/conn"
import "github.com/amnezia-vpn/euphoria/conn"

const (
QueueStagedSize = conn.IdealBatchSize
Expand Down
2 changes: 1 addition & 1 deletion device/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sync"
"time"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/euphoria/conn"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
Expand Down
4 changes: 2 additions & 2 deletions device/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"sync"
"time"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/amneziawg-go/tun"
"github.com/amnezia-vpn/euphoria/conn"
"github.com/amnezia-vpn/euphoria/tun"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
Expand Down
4 changes: 2 additions & 2 deletions device/sticky_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package device

import (
"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/amneziawg-go/rwcancel"
"github.com/amnezia-vpn/euphoria/conn"
"github.com/amnezia-vpn/euphoria/rwcancel"
)

func (device *Device) startRouteListener(bind conn.Bind) (*rwcancel.RWCancel, error) {
Expand Down
4 changes: 2 additions & 2 deletions device/sticky_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

"golang.org/x/sys/unix"

"github.com/amnezia-vpn/amneziawg-go/conn"
"github.com/amnezia-vpn/amneziawg-go/rwcancel"
"github.com/amnezia-vpn/euphoria/conn"
"github.com/amnezia-vpn/euphoria/rwcancel"
)

func (device *Device) startRouteListener(bind conn.Bind) (*rwcancel.RWCancel, error) {
Expand Down
2 changes: 1 addition & 1 deletion device/tun.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package device
import (
"fmt"

"github.com/amnezia-vpn/amneziawg-go/tun"
"github.com/amnezia-vpn/euphoria/tun"
)

const DefaultMTU = 1420
Expand Down
4 changes: 2 additions & 2 deletions device/uapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"sync"
"time"

"github.com/amnezia-vpn/amneziawg-go/device/internal/adapter"
"github.com/amnezia-vpn/amneziawg-go/ipc"
"github.com/amnezia-vpn/euphoria/device/internal/adapter"
"github.com/amnezia-vpn/euphoria/ipc"
)

type IPCError struct {
Expand Down
12 changes: 8 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
github.com/aarzilli/golua v0.0.0-20250217091409-248753f411c4 h1:gW5i3FQAMcbkNgo/A87gCKAbBMalAO8BlPIMo9Gk2Ow=
github.com/aarzilli/golua v0.0.0-20250217091409-248753f411c4/go.mod h1:hMjfaJVSqVnxenMlsxrq3Ni+vrm9Hs64tU4M7dhUoO4=
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/tevino/abool/v2 v2.1.0 h1:7w+Vf9f/5gmKT4m4qkayb33/92M+Um45F2BkHOR+L/c=
github.com/tevino/abool/v2 v2.1.0/go.mod h1:+Lmlqk6bHDWHqN1cbxqhwEAwMPXgc8I1SDEamtseuXY=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
gvisor.dev/gvisor v0.0.0-20250130013005-04f9204697c6 h1:6B7MdW3OEbJqOMr7cEYU9bkzvCjUBX/JlXk12xcANuQ=
Expand Down
2 changes: 1 addition & 1 deletion ipc/namedpipe/namedpipe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"
"time"

"github.com/amnezia-vpn/amneziawg-go/ipc/namedpipe"
"github.com/amnezia-vpn/euphoria/ipc/namedpipe"
"golang.org/x/sys/windows"
)

Expand Down
2 changes: 1 addition & 1 deletion ipc/uapi_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net"
"os"

"github.com/amnezia-vpn/amneziawg-go/rwcancel"
"github.com/amnezia-vpn/euphoria/rwcancel"
"golang.org/x/sys/unix"
)

Expand Down
2 changes: 1 addition & 1 deletion ipc/uapi_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (

// socketDirectory is variable because it is modified by a linker
// flag in wireguard-android.
var socketDirectory = "/var/run/amneziawg"
var socketDirectory = "/var/run/euphoria"

func sockPath(iface string) string {
return fmt.Sprintf("%s/%s.sock", socketDirectory, iface)
Expand Down
4 changes: 2 additions & 2 deletions ipc/uapi_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package ipc
import (
"net"

"github.com/amnezia-vpn/amneziawg-go/ipc/namedpipe"
"github.com/amnezia-vpn/euphoria/ipc/namedpipe"
"golang.org/x/sys/windows"
)

Expand Down Expand Up @@ -62,7 +62,7 @@ func init() {
func UAPIListen(name string) (net.Listener, error) {
listener, err := (&namedpipe.ListenConfig{
SecurityDescriptor: UAPISecurityDescriptor,
}).Listen(`\\.\pipe\ProtectedPrefix\Administrators\AmneziaWG\` + name)
}).Listen(`\\.\pipe\ProtectedPrefix\Administrators\Euphoria\` + name)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit f2ae56d

Please sign in to comment.