Skip to content
This repository was archived by the owner on Oct 27, 2023. It is now read-only.

Commit 6b52234

Browse files
committed
Bump yggdrasil-go version to 0.3.16
1 parent bd81874 commit 6b52234

File tree

7 files changed

+145
-112
lines changed

7 files changed

+145
-112
lines changed

.circleci/config.yml

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 2.1
55
jobs:
66
lint:
77
docker:
8-
- image: circleci/golang:1.14.1
8+
- image: circleci/golang:1.16
99

1010
steps:
1111
- checkout
@@ -18,7 +18,7 @@ jobs:
1818
1919
build-linux:
2020
docker:
21-
- image: circleci/golang:1.14.1
21+
- image: circleci/golang:1.16
2222

2323
steps:
2424
- checkout
@@ -119,11 +119,11 @@ jobs:
119119
echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
120120
121121
- run:
122-
name: Install Go 1.14.1
122+
name: Install Go 1.16
123123
command: |
124124
cd /tmp
125-
curl -LO https://dl.google.com/go/go1.14.1.darwin-amd64.pkg
126-
sudo installer -pkg /tmp/go1.14.1.darwin-amd64.pkg -target /
125+
curl -LO https://dl.google.com/go/go1.16.darwin-amd64.pkg
126+
sudo installer -pkg /tmp/go1.16.darwin-amd64.pkg -target /
127127
128128
#- run:
129129
# name: Install Gomobile
@@ -157,9 +157,46 @@ jobs:
157157
paths:
158158
- upload
159159

160+
build-windows:
161+
docker:
162+
- image: circleci/golang:1.16
163+
164+
steps:
165+
- checkout
166+
167+
- run:
168+
name: Create artifact upload directory and set variables
169+
command: |
170+
mkdir /tmp/upload
171+
echo 'export CINAME=$(sh contrib/semver/name.sh)' >> $BASH_ENV
172+
echo 'export CIVERSION=$(sh contrib/semver/version.sh --bare)' >> $BASH_ENV
173+
git config --global user.email "$(git log --format='%ae' HEAD -1)";
174+
git config --global user.name "$(git log --format='%an' HEAD -1)";
175+
176+
- run:
177+
name: Install tools
178+
command: |
179+
sudo apt-get update
180+
sudo apt-get -y install msitools wixl
181+
182+
- run:
183+
name: Build for Windows
184+
command: |
185+
rm -f {yggdrasil,yggdrasilctl}
186+
GOOS=windows GOARCH=amd64 ./build && mv yggdrasil.exe /tmp/upload/$CINAME-$CIVERSION-windows-amd64.exe && mv yggdrasilctl.exe /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-windows-amd64.exe;
187+
GOOS=windows GOARCH=386 ./build && mv yggdrasil.exe /tmp/upload/$CINAME-$CIVERSION-windows-i386.exe && mv yggdrasilctl.exe /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-windows-i386.exe;
188+
bash contrib/msi/build-msi.sh x64
189+
bash contrib/msi/build-msi.sh x86
190+
mv *.msi /tmp/upload
191+
192+
- persist_to_workspace:
193+
root: /tmp
194+
paths:
195+
- upload
196+
160197
build-other:
161198
docker:
162-
- image: circleci/golang:1.14.1
199+
- image: circleci/golang:1.16
163200

164201
steps:
165202
- checkout
@@ -187,13 +224,6 @@ jobs:
187224
GOOS=freebsd GOARCH=amd64 ./build && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-freebsd-amd64 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-freebsd-amd64;
188225
GOOS=freebsd GOARCH=386 ./build && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-freebsd-i386 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-freebsd-i386;
189226
190-
- run:
191-
name: Build for Windows
192-
command: |
193-
rm -f {yggdrasil,yggdrasilctl}
194-
GOOS=windows GOARCH=amd64 ./build && mv yggdrasil.exe /tmp/upload/$CINAME-$CIVERSION-windows-amd64.exe && mv yggdrasilctl.exe /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-windows-amd64.exe;
195-
GOOS=windows GOARCH=386 ./build && mv yggdrasil.exe /tmp/upload/$CINAME-$CIVERSION-windows-i386.exe && mv yggdrasilctl.exe /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-windows-i386.exe;
196-
197227
- persist_to_workspace:
198228
root: /tmp
199229
paths:
@@ -215,8 +245,10 @@ workflows:
215245
build:
216246
jobs:
217247
- build-linux
248+
- build-windows
218249
- build-other
219250
- upload:
220251
requires:
221252
- build-linux
253+
- build-windows
222254
- build-other

appveyor.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

contrib/apparmor/usr.bin.yggdrasil

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
1-
# Last Modified: Tue Mar 10 16:38:14 2020
1+
# Last Modified: Fri Oct 30 11:33:31 2020
22
#include <tunables/global>
33

44
/usr/bin/yggdrasil {
55
#include <abstractions/base>
6+
#include <abstractions/nameservice>
67

78
capability net_admin,
89
capability net_raw,
910

10-
network inet stream,
11-
network inet dgram,
12-
network inet6 dgram,
13-
network inet6 stream,
14-
network netlink raw,
15-
16-
/lib/@{multiarch}/ld-*.so mr,
17-
/proc/sys/net/core/somaxconn r,
18-
owner /sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,
1911
/dev/net/tun rw,
12+
/proc/sys/net/core/somaxconn r,
13+
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,
2014

21-
/usr/bin/yggdrasil mr,
2215
/etc/yggdrasil.conf rw,
2316
/run/yggdrasil.sock rw,
24-
2517
}

contrib/deb/generate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ then
8383
echo "Backing up configuration file to /var/backups/yggdrasil.conf.`date +%Y%m%d`"
8484
cp /etc/yggdrasil.conf /var/backups/yggdrasil.conf.`date +%Y%m%d`
8585
echo "Normalising and updating /etc/yggdrasil.conf"
86-
/usr/bin/yggdrasil -useconffile /var/backups/yggdrasil.conf.`date +%Y%m%d` -normaliseconf > /etc/yggdrasil.conf
86+
/usr/bin/yggdrasil -useconf -normaliseconf < /var/backups/yggdrasil.conf.`date +%Y%m%d` > /etc/yggdrasil.conf
8787
chgrp yggdrasil /etc/yggdrasil.conf
8888
8989
if command -v systemctl >/dev/null; then
@@ -94,7 +94,7 @@ then
9494
else
9595
echo "Generating initial configuration file /etc/yggdrasil.conf"
9696
echo "Please familiarise yourself with this file before starting Yggdrasil"
97-
/usr/bin/yggdrasil -genconf > /etc/yggdrasil.conf
97+
sh -c 'umask 0027 && /usr/bin/yggdrasil -genconf > /etc/yggdrasil.conf'
9898
chgrp yggdrasil /etc/yggdrasil.conf
9999
fi
100100
EOF

contrib/msi/build-msi.sh

Lines changed: 27 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# This script generates an MSI file for Yggdrasil for a given architecture. It
4-
# needs to run on Windows within MSYS2 and Go 1.13 or later must be installed on
5-
# the system and within the PATH. This is ran currently by Appveyor (see
6-
# appveyor.yml in the repository root) for both x86 and x64.
4+
# needs to run on Linux or macOS with Go 1.16, wixl and msitools installed.
75
#
86
# Author: Neil Alexander <neilalexander@users.noreply.github.com>
97

108
# Get arch from command line if given
119
PKGARCH=$1
1210
if [ "${PKGARCH}" == "" ];
1311
then
14-
echo "tell me the architecture: x86 or x64"
12+
echo "tell me the architecture: x86, x64 or arm"
1513
exit 1
1614
fi
1715

@@ -28,28 +26,11 @@ then
2826
git checkout ${APPVEYOR_REPO_BRANCH}
2927
fi
3028

31-
# Install prerequisites within MSYS2
32-
pacman -S --needed --noconfirm unzip git curl
33-
34-
# Download the wix tools!
35-
if [ ! -d wixbin ];
36-
then
37-
curl -LO https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
38-
if [ `md5sum wix311-binaries.zip | cut -f 1 -d " "` != "47a506f8ab6666ee3cc502fb07d0ee2a" ];
39-
then
40-
echo "wix package didn't match expected checksum"
41-
exit 1
42-
fi
43-
mkdir -p wixbin
44-
unzip -o wix311-binaries.zip -d wixbin || (
45-
echo "failed to unzip WiX"
46-
exit 1
47-
)
48-
fi
49-
5029
# Build Yggdrasil!
51-
[ "${PKGARCH}" == "x64" ] && GOOS=windows GOARCH=amd64 CGO_ENABLED=0 ./build
52-
[ "${PKGARCH}" == "x86" ] && GOOS=windows GOARCH=386 CGO_ENABLED=0 ./build
30+
[ "${PKGARCH}" == "x64" ] && GOOS=windows GOARCH=amd64 CGO_ENABLED=0 ./build -p -l "-aslr"
31+
[ "${PKGARCH}" == "x86" ] && GOOS=windows GOARCH=386 CGO_ENABLED=0 ./build -p -l "-aslr"
32+
[ "${PKGARCH}" == "arm" ] && GOOS=windows GOARCH=arm CGO_ENABLED=0 ./build -p -l "-aslr"
33+
#[ "${PKGARCH}" == "arm64" ] && GOOS=windows GOARCH=arm64 CGO_ENABLED=0 ./build
5334

5435
# Create the postinstall script
5536
cat > updateconfig.bat << EOF
@@ -58,7 +39,9 @@ if not exist %ALLUSERSPROFILE%\\Yggdrasil (
5839
)
5940
if not exist %ALLUSERSPROFILE%\\Yggdrasil\\yggdrasil.conf (
6041
if exist yggdrasil.exe (
61-
yggdrasil.exe -genconf > %ALLUSERSPROFILE%\\Yggdrasil\\yggdrasil.conf
42+
if not exist %ALLUSERSPROFILE%\\Yggdrasil\\yggdrasil.conf (
43+
yggdrasil.exe -genconf > %ALLUSERSPROFILE%\\Yggdrasil\\yggdrasil.conf
44+
)
6245
)
6346
)
6447
EOF
@@ -72,12 +55,16 @@ PKGVERSIONMS=$(echo $PKGVERSION | tr - .)
7255
PKGGUID="54a3294e-a441-4322-aefb-3bb40dd022bb" PKGINSTFOLDER="ProgramFilesFolder"
7356

7457
# Download the Wintun driver
58+
curl -o wintun.zip https://www.wintun.net/builds/wintun-0.10.2.zip
59+
unzip wintun.zip
7560
if [ $PKGARCH = "x64" ]; then
76-
PKGMSMNAME=wintun-x64.msm
77-
curl -o ${PKGMSMNAME} https://www.wintun.net/builds/wintun-amd64-0.7.msm || (echo "couldn't get wintun"; exit 1)
61+
PKGWINTUNDLL=wintun/bin/amd64/wintun.dll
7862
elif [ $PKGARCH = "x86" ]; then
79-
PKGMSMNAME=wintun-x86.msm
80-
curl -o ${PKGMSMNAME} https://www.wintun.net/builds/wintun-x86-0.7.msm || (echo "couldn't get wintun"; exit 1)
63+
PKGWINTUNDLL=wintun/bin/x86/wintun.dll
64+
elif [ $PKGARCH = "arm" ]; then
65+
PKGWINTUNDLL=wintun/bin/arm/wintun.dll
66+
#elif [ $PKGARCH = "arm64" ]; then
67+
# PKGWINTUNDLL=wintun/bin/arm64/wintun.dll
8168
else
8269
echo "wasn't sure which architecture to get wintun for"
8370
exit 1
@@ -100,6 +87,7 @@ cat > wix.xml << EOF
10087
Language="1033"
10188
Codepage="1252"
10289
Version="${PKGVERSIONMS}"
90+
Platform="${PKGARCH}"
10391
Manufacturer="github.com/yggdrasil-network">
10492
10593
<Package
@@ -136,6 +124,12 @@ cat > wix.xml << EOF
136124
Source="yggdrasil.exe"
137125
KeyPath="yes" />
138126
127+
<File
128+
Id="Wintun"
129+
Name="wintun.dll"
130+
DiskId="1"
131+
Source="${PKGWINTUNDLL}" />
132+
139133
<ServiceInstall
140134
Id="ServiceInstaller"
141135
Account="LocalSystem"
@@ -176,12 +170,6 @@ cat > wix.xml << EOF
176170
</Component>
177171
</Directory>
178172
</Directory>
179-
180-
<Merge
181-
Id="Wintun"
182-
Language="0"
183-
DiskId="1"
184-
SourceFile="${PKGMSMNAME}" />
185173
</Directory>
186174
187175
<Feature Id="YggdrasilFeature" Title="Yggdrasil" Level="1">
@@ -190,13 +178,6 @@ cat > wix.xml << EOF
190178
<ComponentRef Id="ConfigScript" />
191179
</Feature>
192180
193-
<Feature Id="WintunFeature" Title="Wintun" Level="1">
194-
<Condition Level="0">
195-
UPGRADINGPRODUCTCODE
196-
</Condition>
197-
<MergeRef Id="Wintun" />
198-
</Feature>
199-
200181
<CustomAction
201182
Id="UpdateGenerateConfig"
202183
Directory="YggdrasilInstallFolder"
@@ -208,17 +189,12 @@ cat > wix.xml << EOF
208189
<InstallExecuteSequence>
209190
<Custom
210191
Action="UpdateGenerateConfig"
211-
Before="StartServices">
212-
NOT Installed AND NOT REMOVE
213-
</Custom>
192+
Before="StartServices" />
214193
</InstallExecuteSequence>
215194
216195
</Product>
217196
</Wix>
218197
EOF
219198

220199
# Generate the MSI
221-
CANDLEFLAGS="-nologo"
222-
LIGHTFLAGS="-nologo -spdb -sice:ICE71 -sice:ICE61"
223-
wixbin/candle $CANDLEFLAGS -out ${PKGNAME}-${PKGVERSION}-${PKGARCH}.wixobj -arch ${PKGARCH} wix.xml && \
224-
wixbin/light $LIGHTFLAGS -ext WixUtilExtension.dll -out ${PKGNAME}-${PKGVERSION}-${PKGARCH}.msi ${PKGNAME}-${PKGVERSION}-${PKGARCH}.wixobj
200+
wixl -v wix.xml -a ${PKGARCH} -o ${PKGNAME}-${PKGVERSION}-${PKGARCH}.msi

go.mod

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
module github.com/popura-network/Popura
22

3-
go 1.13
3+
go 1.16
44

55
require (
6-
github.com/cheggaaa/pb/v3 v3.0.4
7-
github.com/fatih/color v1.9.0 // indirect
6+
github.com/cheggaaa/pb/v3 v3.0.6
87
github.com/gologme/log v1.2.0
98
github.com/hashicorp/go-syslog v1.0.0
10-
github.com/hjson/hjson-go v3.0.2-0.20200316202735-d5d0e8b0617d+incompatible
11-
github.com/kardianos/minwinsvc v0.0.0-20151122163309-cad6b2b879b0
12-
github.com/mattn/go-colorable v0.1.6 // indirect
13-
github.com/mattn/go-runewidth v0.0.9 // indirect
9+
github.com/hjson/hjson-go v3.1.0+incompatible
10+
github.com/kardianos/minwinsvc v1.0.0
1411
github.com/mdlayher/ndp v0.0.0-20200602162440-17ab9e3e5567
15-
github.com/miekg/dns v1.1.29 // indirect
16-
github.com/mitchellh/mapstructure v1.3.0
12+
github.com/miekg/dns v1.1.41 // indirect
13+
github.com/mitchellh/mapstructure v1.4.1
1714
github.com/vishvananda/netlink v1.1.0
18-
github.com/vishvananda/netns v0.0.0-20200520041808-52d707b772fe // indirect
19-
github.com/yggdrasil-network/yggdrasil-go v0.3.15
15+
github.com/yggdrasil-network/yggdrasil-go v0.3.16
2016
github.com/zhoreeq/meshname v0.1.0
21-
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 // indirect
22-
golang.org/x/net v0.0.0-20200602114024-627f9648deb9
23-
golang.org/x/text v0.3.3-0.20191230102452-929e72ca90de
17+
golang.org/x/crypto v0.0.0-20210317152858-513c2a44f670 // indirect
18+
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4
19+
golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d // indirect
20+
golang.org/x/text v0.3.6-0.20210220033129-8f690f22cf1c
2421
)

0 commit comments

Comments
 (0)