Skip to content

Commit

Permalink
add windows packaging scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
idk committed Feb 17, 2020
1 parent 5e19af0 commit e48d1e8
Show file tree
Hide file tree
Showing 17 changed files with 459 additions and 33 deletions.
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
clients.config
codecov.yml
cvpnserver.ini
davpn.ico
geti2p.mk
geti2p.nsi
geti2p.url
go-anonvpn.pub
go.sum
gui-preview_000.png
gui-preview.png
i2pd-china.conf
i2pd.conf
i2pd.conf.bak
i2pupdate.zip
installer-china.nsi
installer.nsi
LICENSES.txt
README.0.md
README.md
README.pdf
RELEASE.md
rtrade-testserver.ini
wintun32.msi
wintun.msi
Makefile
cmd/anonvpn/anonvpn

Expand Down
20 changes: 6 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ modtidy:
go mod tidy

tap:
wget -O wintap.exe https://build.openvpn.net/downloads/releases/latest/tap-windows-latest-stable.exe
wget -O nsis/wintap.exe https://build.openvpn.net/downloads/releases/latest/tap-windows-latest-stable.exe

tun:
wget -O wintun.msi https://github.com/meshsocket/WintunInstaller/releases/download/0.6/wintun-amd64-0.6.msi
wget -O wintun32.msi https://github.com/meshsocket/WintunInstaller/releases/download/0.6/wintun-x86-0.6.msi
wget -O nsis/wintun.msi https://github.com/meshsocket/WintunInstaller/releases/download/0.6/wintun-amd64-0.6.msi
wget -O nsis/wintun32.msi https://github.com/meshsocket/WintunInstaller/releases/download/0.6/wintun-x86-0.6.msi

tuntap: tun tap

Expand Down Expand Up @@ -90,19 +90,11 @@ zip:
winlicense:
cat client/LICENSE.md server/LICENSE.md | unix2dos | tee LICENSES.txt

nsis:geti2p winstall china-winstall
nsis:geti2p winstall
winstall: winlicense tuntap
makensis installer.nsi
makensis nsis/installer.nsi

china: reseed
cp i2pd.conf i2pd.conf.bak
cp i2pd-china.conf i2pd.conf

china-winstall: china winlicense tuntap
makensis installer-china.nsi
cp i2pd.conf.bak i2pd.conf

-include geti2p.mk
-include nsis/geti2p.mk

fmt: go-fmt

Expand Down
4 changes: 2 additions & 2 deletions client/vpn-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ func (f *SAMClientVPN) SAMSetupSock(netAddr net.Addr) net.PacketConn {
// DestinationAddr does the full lookup of the client destination and returns
// the corresponding sam3.I2PAddr as a net.Addr
func (f *SAMClientVPN) DestinationAddr() (net.Addr, error) {
//log.Println("Looking up gateway destination Base64 for", f.Config().ClientDest)
log.Println("Looking up gateway destination Base64 for", f.Config().ClientDest)
addr, err := f.samConn.Lookup(f.Config().ClientDest)
if err != nil {
return nil, err
}
//log.Println("Gateway VPN Tunnel Address", addr.String())
log.Println("Gateway VPN Tunnel Address", addr.String())
return &addr, nil
}

Expand Down
73 changes: 73 additions & 0 deletions nsis/clients.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# NOTE: This I2P config file must use UTF-8 encoding
#
# If you have a 'split' directory installation, with configuration
# files in ~/.i2p (Linux), %APPDATA%\I2P (Windows),
# or /Users/(user)/Library/Application Support/i2p (Mac), be sure to
# edit the file in the configuration directory, NOT the install directory.
# When running as a Linux daemon, the configuration directory is /var/lib/i2p
# and the install directory is /usr/share/i2p .
# When running as a Windows service, the configuration directory is \ProgramData\i2p
# and the install directory is \Program Files\i2p .
#

# fire up the web console
## There are several choices, here are some examples:
## non-SSL, bind to local IPv4 only
#clientApp.0.args=7657 127.0.0.1 ./webapps/
## non-SSL, bind to local IPv6 only
#clientApp.0.args=7657 ::1 ./webapps/
## non-SSL, bind to all IPv4 addresses
#clientApp.0.args=7657 0.0.0.0 ./webapps/
## non-SSL, bind to all IPv6 addresses
#clientApp.0.args=7657 :: ./webapps/
## For SSL only, change clientApp.4.args below to https://
## SSL only
#clientApp.0.args=-s 7657 ::1,127.0.0.1 ./webapps/
## non-SSL and SSL
#clientApp.0.args=7657 ::1,127.0.0.1 -s 7667 ::1,127.0.0.1 ./webapps/
## non-SSL only, both IPv6 and IPv4 local interfaces
clientApp.0.args=7657 ::1,127.0.0.1 ./webapps/
clientApp.0.main=net.i2p.router.web.RouterConsoleRunner
clientApp.0.name=I2P Router Console
clientApp.0.onBoot=true
clientApp.0.startOnLoad=true

# SAM bridge
clientApp.1.main=net.i2p.sam.SAMBridge
clientApp.1.name=SAM application bridge
clientApp.1.args=sam.keys 127.0.0.1 7656 i2cp.tcp.host=127.0.0.1 i2cp.tcp.port=7654
clientApp.1.startOnLoad=true

# poke the i2ptunnels defined in i2ptunnel.config
clientApp.2.main=net.i2p.i2ptunnel.TunnelControllerGroup
clientApp.2.name=Application tunnels
clientApp.2.args=i2ptunnel.config
clientApp.2.delay=-1
clientApp.2.startOnLoad=true

# run our own eepsite with a seperate jetty instance
clientApp.3.main=net.i2p.jetty.JettyStart
clientApp.3.name=I2P webserver (eepsite)
## To use the rewrite handler, edit jetty-rewrite.xml and use:
#clientApp.3.args="/path/to/jetty.xml" "/path/to/jetty-rewrite.xml"
## To use local SSL, edit jetty-ssl.xml and use:
#clientApp.3.args="/path/to/jetty.xml" "/path/to/jetty-ssl.xml"
## To use local or remote JMX, edit jetty-jmx.xml and use:
#clientApp.3.args="/path/to/jetty.xml" "/path/to/jetty-jmx.xml"
clientApp.3.args="eepsite/jetty.xml"
clientApp.3.delay=30
clientApp.3.startOnLoad=true

# load a browser pointing at the web console whenever we start up
clientApp.4.main=net.i2p.apps.systray.UrlLauncher
clientApp.4.name=Open Router Console in web browser at startup
clientApp.4.args=http://127.0.0.1:7657/
clientApp.4.delay=3
clientApp.4.startOnLoad=true

# BOB bridge
clientApp.5.args=
clientApp.5.delay=10
clientApp.5.main=net.i2p.BOB.BOB
clientApp.5.name=BOB application bridge
clientApp.5.startOnLoad=false
43 changes: 43 additions & 0 deletions nsis/geti2p.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
geti2p: i2pinstaller.exe i2pdinstaller.exe

i2pinstaller.exe: url
wget -c `cat nsis/geti2p.url` -O nsis/i2pinstaller.exe

url:
echo -n 'https://launchpad.net' | tee .geti2p.url
curl -s https://launchpad.net/i2p/trunk/+rdf | \
grep specifiedAt | \
head -n 3 | \
tail -n 1 | \
sed 's| <lp:specifiedAt rdf:resource="||g' | \
sed 's|+rdf"/>||g' | tee -a .geti2p.url
echo -n '+download/i2pinstall_' | tee -a .geti2p.url
curl -s https://launchpad.net/i2p/trunk/+rdf | \
grep specifiedAt | \
head -n 3 | \
tail -n 1 | \
sed 's| <lp:specifiedAt rdf:resource="/i2p/trunk/||g' | \
sed 's|/+rdf"/>||g' | tee -a .geti2p.url
echo '_windows.exe' | tee -a .geti2p.url
cat .geti2p.url | tr -d '\n' | tee nsis/geti2p.url
rm -f .geti2p.url

LATEST_I2PD=$(shell gothub info -u purplei2p -r i2pd -j | grep tag_name | sed 's|tag_name||g' | tr -d ':, '| head -n 1 )

LATEST_ZERO=$(shell gothub info -u i2p-zero -r i2p-zero -j | grep tag_name | sed 's|tag_name||g' | tr -d ':, '| head -n 1 )

zero: i2pzero.zip

i2pzero.zip:
wget -c https://github.com/i2p-zero/i2p-zero/releases/download/$(LATEST_ZERO)/i2p-zero-win-gui.$(LATEST_ZERO).zip -O nsis/i2pzero.zip
rm -rf nsis/zero
unzip nsis/i2pzero.zip -d nsis/zero
mv nsis/zero/i2p-zero-win*/* nsis/zero/
rm -r nsis/zero/i2p-zero-win*/

i2pd: i2pdinstaller.exe

i2pdinstaller.exe:
wget -c https://raw.githubusercontent.com/PurpleI2P/i2pd/master/contrib/i2pd.conf -O i2pd.conf
wget -c https://github.com/PurpleI2P/i2pd/releases/download/$(LATEST_I2PD)/setup_i2pd_v$(LATEST_I2PD).exe -O nsis/i2pdinstaller.exe

36 changes: 36 additions & 0 deletions nsis/geti2p.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Section "GetI2P"
SetOutPath $INSTDIR
IfFileExists "$PROGRAMFILES\i2p\i2p.exe" endGetI2P checkI2PD
Goto beginChooseRouterType
checkI2PD:
IfFileExists "$PROGRAMFILES\i2pd\i2pd.exe" endGetI2P beginChooseRouterType
beginChooseRouterType:
MessageBox MB_YESNO "Your system does not appear to have i2p installed. An i2p router is required to use this software.$\n$\n For new users, we recommend the bundled i2p-zero router based on the Java I2P router. Would you like to install it?" IDYES beginGetI2P IDNO beginGetI2PD
beginGetI2P:
MessageBox MB_YESNO "Your system does not appear to have i2p installed.$\n$\nDo you wish to install it now?" IDNO beginGetI2PD
File "i2pinstaller.exe"
ExecWait "$INSTDIR\i2pinstaller.exe"
SetOutPath "$PROGRAMFILES\i2p"
File "clients.config"
SetOutPath "C:\\ProgramData\i2p"
File "clients.config"
SetOutPath "$AppData\I2P"
File "clients.config"
Goto endGetI2P
; File /r zero
beginGetI2PD:
MessageBox MB_YESNO "Your system does not appear to have i2pd installed.$\n$\nDo you wish to install it now?" IDNO endGetI2P
File "i2pdinstaller.exe"
ExecWait "$INSTDIR\i2pdinstaller.exe"
SetOutPath "$PROGRAMFILES\i2pd"
File "i2pd.conf"
SetOutPath "$PROGRAMFILES64\i2pd"
File "i2pd.conf"
SetOutPath "C:\\ProgramData\i2pd"
File "i2pd.conf"
SetOutPath "$AppData\i2pd\"
File "i2pd.conf"
endGetI2P:
SectionEnd

1 change: 1 addition & 0 deletions nsis/geti2p.url
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://launchpad.net/i2p/trunk/0.9.44/+download/i2pinstall_0.9.44_windows.exe
Binary file added nsis/go-anonvpn-installer.exe
Binary file not shown.
Loading

0 comments on commit e48d1e8

Please sign in to comment.