Skip to content

Commit

Permalink
quick canal fix
Browse files Browse the repository at this point in the history
  • Loading branch information
idk committed Feb 24, 2020
1 parent d014451 commit d036411
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
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
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
4 changes: 4 additions & 0 deletions cmd/anonvpn/noui.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,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
Binary file modified nsis/go-anonvpn-installer.exe
Binary file not shown.

0 comments on commit d036411

Please sign in to comment.