Skip to content

Commit f9bfb13

Browse files
AmneziaWG 1.5 support (#10)
1 parent fe2920a commit f9bfb13

File tree

12 files changed

+337
-58
lines changed

12 files changed

+337
-58
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setting up Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: "1.23"
20+
go-version: "1.24"
2121
- name: Building Windows amd64 Version
2222
run: |
2323
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o WireProxy_amd64.exe -v ./cmd/wireproxy
@@ -37,7 +37,7 @@ jobs:
3737
- name: Setting up Go
3838
uses: actions/setup-go@v5
3939
with:
40-
go-version: "1.23"
40+
go-version: "1.24"
4141
- name: Building Windows arm64 Version
4242
run: |
4343
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o WireProxy_arm64.exe -v ./cmd/wireproxy
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setting up Go
5858
uses: actions/setup-go@v5
5959
with:
60-
go-version: "1.23"
60+
go-version: "1.24"
6161
- name: Building Linux amd64 Version
6262
run: |
6363
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o WireProxy_amd64 -v ./cmd/wireproxy
@@ -77,7 +77,7 @@ jobs:
7777
- name: Setting up Go
7878
uses: actions/setup-go@v5
7979
with:
80-
go-version: "1.23"
80+
go-version: "1.24"
8181
- name: Building Linux arm64 Version
8282
run: |
8383
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o WireProxy_arm64 -v ./cmd/wireproxy
@@ -97,7 +97,7 @@ jobs:
9797
- name: Setting up Go
9898
uses: actions/setup-go@v5
9999
with:
100-
go-version: "1.23"
100+
go-version: "1.24"
101101
- name: Building Linux s390x Version
102102
run: |
103103
CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -o WireProxy_s390x -v ./cmd/wireproxy
@@ -117,7 +117,7 @@ jobs:
117117
- name: Setting up Go
118118
uses: actions/setup-go@v5
119119
with:
120-
go-version: "1.23"
120+
go-version: "1.24"
121121
- name: Building Darwin amd64 Version
122122
run: |
123123
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o WireProxy_amd64 -v ./cmd/wireproxy
@@ -137,7 +137,7 @@ jobs:
137137
- name: Setting up Go
138138
uses: actions/setup-go@v5
139139
with:
140-
go-version: "1.23"
140+
go-version: "1.24"
141141
- name: Building Darwin arm64 Version
142142
run: |
143143
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o WireProxy_arm64 -v ./cmd/wireproxy

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.23'
20+
go-version: '1.24'
2121
- uses: actions/checkout@v4
2222
- name: golangci-lint
2323
uses: golangci/golangci-lint-action@v4

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setting up Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: "1.23"
20+
go-version: "1.24"
2121
- name: Install dependencies
2222
run: sudo apt install wireguard curl
2323
- name: Building wireproxy

.github/workflows/wireproxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Set up GoReleaser
3131
uses: actions/setup-go@v5
3232
with:
33-
go-version: "1.23"
33+
go-version: "1.24"
3434

3535
- name: Run GoReleaser
3636
uses: goreleaser/goreleaser-action@v5

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Start by building the application.
2-
FROM docker.io/golang:1.23 as build
2+
FROM docker.io/golang:1.24 as build
33

44
WORKDIR /usr/src/wireproxy
55
COPY . .

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,4 @@ If nothing is set for `CheckAlive`, an empty JSON object with 200 will be the re
253253
The peer which the ICMP ping packet is routed to depends on the `AllowedIPs` set for each peers.
254254

255255
# Stargazers over time
256-
[![Stargazers over time](https://starchart.cc/octeep/wireproxy.svg)](https://starchart.cc/octeep/wireproxy)
256+
[![Stargazers over time](https://starchart.cc/artem-russkikh/wireproxy-awg.svg)](https://starchart.cc/artem-russkikh/wireproxy-awg)

cmd/wireproxy/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var default_config_paths = []string {
2828
os.Getenv("HOME")+"/.config/wireproxy.conf",
2929
}
3030

31-
var version = "1.0.11-dev"
31+
var version = "1.0.12-dev"
3232

3333
func panicIfError(err error) {
3434
if err != nil {

config.go

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ type ASecConfigType struct {
3131
responsePacketMagicHeader uint32 // h2
3232
underloadPacketMagicHeader uint32 // h3
3333
transportPacketMagicHeader uint32 // h4
34+
i1 *string
35+
i2 *string
36+
i3 *string
37+
i4 *string
38+
i5 *string
39+
j1 *string
40+
j2 *string
41+
j3 *string
42+
itime *int
3443
}
3544

3645
// DeviceConfig contains the information to initiate a wireguard connection
@@ -188,15 +197,15 @@ func parseCIDRNetIP(section *ini.Section, keyName string) ([]netip.Addr, error)
188197
if len(str) == 0 {
189198
continue
190199
}
191-
200+
192201
if addr, err := netip.ParseAddr(str); err == nil {
193202
ips = append(ips, addr)
194203
} else {
195204
prefix, err := netip.ParsePrefix(str)
196205
if err != nil {
197206
return nil, err
198207
}
199-
208+
200209
addr := prefix.Addr()
201210
ips = append(ips, addr)
202211
}
@@ -420,6 +429,81 @@ func ParseASecConfig(section *ini.Section) (*ASecConfigType, error) {
420429
aSecConfig.transportPacketMagicHeader = uint32(value)
421430
}
422431

432+
if sectionKey, err := section.GetKey("I1"); err == nil {
433+
value := sectionKey.String()
434+
if aSecConfig == nil {
435+
aSecConfig = &ASecConfigType{}
436+
}
437+
aSecConfig.i1 = &value
438+
}
439+
440+
if sectionKey, err := section.GetKey("I2"); err == nil {
441+
value := sectionKey.String()
442+
if aSecConfig == nil {
443+
aSecConfig = &ASecConfigType{}
444+
}
445+
aSecConfig.i2 = &value
446+
}
447+
448+
if sectionKey, err := section.GetKey("I3"); err == nil {
449+
value := sectionKey.String()
450+
if aSecConfig == nil {
451+
aSecConfig = &ASecConfigType{}
452+
}
453+
aSecConfig.i3 = &value
454+
}
455+
456+
if sectionKey, err := section.GetKey("I4"); err == nil {
457+
value := sectionKey.String()
458+
if aSecConfig == nil {
459+
aSecConfig = &ASecConfigType{}
460+
}
461+
aSecConfig.i4 = &value
462+
}
463+
464+
if sectionKey, err := section.GetKey("I5"); err == nil {
465+
value := sectionKey.String()
466+
if aSecConfig == nil {
467+
aSecConfig = &ASecConfigType{}
468+
}
469+
aSecConfig.i5 = &value
470+
}
471+
472+
if sectionKey, err := section.GetKey("J1"); err == nil {
473+
value := sectionKey.String()
474+
if aSecConfig == nil {
475+
aSecConfig = &ASecConfigType{}
476+
}
477+
aSecConfig.j1 = &value
478+
}
479+
480+
if sectionKey, err := section.GetKey("J2"); err == nil {
481+
value := sectionKey.String()
482+
if aSecConfig == nil {
483+
aSecConfig = &ASecConfigType{}
484+
}
485+
aSecConfig.j2 = &value
486+
}
487+
488+
if sectionKey, err := section.GetKey("J3"); err == nil {
489+
value := sectionKey.String()
490+
if aSecConfig == nil {
491+
aSecConfig = &ASecConfigType{}
492+
}
493+
aSecConfig.j3 = &value
494+
}
495+
496+
if sectionKey, err := section.GetKey("ITime"); err == nil {
497+
value, err := sectionKey.Int()
498+
if err != nil {
499+
return nil, err
500+
}
501+
if aSecConfig == nil {
502+
aSecConfig = &ASecConfigType{}
503+
}
504+
aSecConfig.itime = &value
505+
}
506+
423507
if err := ValidateASecConfig(aSecConfig); err != nil {
424508
return nil, err
425509
}

0 commit comments

Comments
 (0)