Skip to content

Commit

Permalink
Merge pull request #23 from RTradeLtd/nsis
Browse files Browse the repository at this point in the history
add windows packaging scripts
  • Loading branch information
eyedeekay committed Feb 26, 2020
2 parents 5e19af0 + 60ad004 commit 937330d
Show file tree
Hide file tree
Showing 25 changed files with 729 additions and 60 deletions.
16 changes: 5 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
clients.config
*.tgz
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

cmd/anonvpn/anonvpn.exe
cmd/anonvpn/anonvpn-32.exe
cmd/anonvpn/anonvpn-gui

cmd/anonvpn/anonvpn-nostatic
cmd/anonvpn/anonvpn.apk
cmd/anonvpn/anonvpn-osx
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 windows windows32 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
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,19 @@
libanonvpn ([home](/))
======================

Lead Maintainer: [eyedeekay](https://github.com/eyedeekay)

Library for providing and connecting to VPN's over the I2P network.
Daemon, web client, and terminal client. This is an automatically
configuring, automatically deploying, automatically multihopping
pseudonymous VPN.


Installation
-------------

For now, the recommended way to install is with ```go get```

go get -u -d -tags cli github.com/RTradeLtd/libanonvpn/cmd/anonvpn

Development
-----------

- To install the dependencies needed to build this locally run
`make dependencies` which will install:
- `libgtk-3-dev`
- `libwebkit2gtk-4.0-dev`
- `build-essential`
- `gomobile` which can be installed with `go get golang.org/x/mobile/cmd/gomobile`
- You will also need a valid installation of 'go 1.12.x'

Example Usage
-------------
Expand All @@ -52,6 +41,8 @@ Usage of ./cmd/anonvpn/anonvpn:
Type of access list to use, can be "whitelist" "blacklist" or "none". (default "none")
-addr string
(client) IP address of virtual network interface (default "10.79.0.2")
-canal
Run the canal subcommand to configure firewall rules(Experimental).
-chromeuser string
user to run Chrome as, usually your desktop user (default "idk")
-client
Expand Down Expand Up @@ -132,6 +123,8 @@ Usage of ./cmd/anonvpn/anonvpn:
Skip I2CP Port check for standalone router
-start
Start a tunnel with the passed parameters(Otherwise, they will be treated as default values). (default true)
-string string
Gateway to forward requests recieved by the server with canal(Experimental) (default "192.168.0.1")
-username string
username for web admin panel (default "go-anonvpn")
-webface
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
27 changes: 16 additions & 11 deletions cmd/anonvpn/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"fmt"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -47,17 +48,6 @@ func lbMain(ctx context.Context) {
log.Fatal("Install or start i2p")
}
}
if *canal {
if *client {
if err := fwscript.Setup(*tunName); err != nil {
log.Fatal("Client firewall configuration error", err)
}
} else {
if err := fwscript.ServerSetup(*tunName, *gateName); err != nil {
log.Fatal("Server firewall configuration error", err)
}
}
}

config := &i2ptunconf.Conf{Config: goini.New()}
if *iniFile != "none" && *iniFile != "" {
Expand Down Expand Up @@ -310,3 +300,18 @@ func ChownR(path string, uid, gid int) error {
return err
})
}

func Canal() error {
if *canal {
if *client {
if err := fwscript.Setup(*tunName); err != nil {
return fmt.Errorf("Client firewall configuration error", err)
}
} else {
if err := fwscript.ServerSetup(*tunName, *gateName); err != nil {
return fmt.Errorf("Server firewall configuration error", err)
}
}
}
return nil
}
4 changes: 3 additions & 1 deletion cmd/anonvpn/nostatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func (s *App) Serve() bool {
log.Println("Starting service tunnel", element.ID())
go element.Serve()
}

if err := Canal(); err != nil {
return false
}
if s.UseWebUI() == true {
go s.clientMux.ListenAndServe()
if view, err = LaunchUI(s); err != nil {
Expand Down
5 changes: 5 additions & 0 deletions cmd/anonvpn/noui.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

func RunUI() {

}

func (s *App) Serve() bool {
Expand All @@ -20,6 +21,10 @@ func (s *App) Serve() bool {
go element.Serve()
}

if err := Canal(); err != nil {
return false
}

return Exit()
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/anonvpn/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ func (s *App) Serve() bool {
log.Println("Starting service tunnel", element.ID())
go element.Serve()
}

if err := Canal(); err != nil {
return false
}
if s.UseWebUI() == true {
go s.clientMux.ListenAndServe()
if view, err = LaunchUI(s); err != nil {
Expand Down
2 changes: 2 additions & 0 deletions etc/anonvpn/canal.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /usr/bin/env sh

Loading

0 comments on commit 937330d

Please sign in to comment.