Skip to content
This repository was archived by the owner on Jan 31, 2021. It is now read-only.

Commit e7916f2

Browse files
committed
New features, fixes, updates
* Refactor into separate packages * New subcommand based CLI (deploy, ls, rm) * Add generation of Android strongSwan configuration file * Generate mobile config locally * Download all VPN configuration files and store in ~/.dosxvpn * Make OSX app prompt for auth at launch * Add VPN delete functionality to web app * Update README
1 parent 0d2d3fe commit e7916f2

File tree

728 files changed

+58560
-19177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

728 files changed

+58560
-19177
lines changed

Gopkg.lock

Lines changed: 35 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323

2424
[[constraint]]
2525
name = "github.com/digitalocean/godo"
26-
version = "1.0.0"
26+
version = "1.1.1"
27+
28+
[[constraint]]
29+
branch = "master"
30+
name = "github.com/spf13/cobra"
2731

2832
[[constraint]]
2933
branch = "master"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
all: osx
22

33
osx:
4-
GOOS=darwin GOARCH=amd64 go build -o ./build/osx/x86-64/dosxvpn ./cmd/dosxvpn
4+
GOOS=darwin GOARCH=amd64 go build -o ./build/osx/x86-64/dosxvpn .
55
cd platypus && ./build.sh
66
cd build/osx/x86-64 && zip -r ./dosxvpn.zip ./dosxvpn.app
77

README.md

Lines changed: 71 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,88 @@
1-
One click personal VPN server on [DigitalOcean](https://digitalocean.com) with automated OSX setup and DNS adblocking. The deployed VPN server includes automated updates of both the OS and software, so you don't need to worry about managing a server.
1+
<h1 align="center">dosxvpn</h1>
22

3-
![](/static/overview.gif?raw=true)
3+
<h4 align="center">Easily deploy your own personal VPN server with DNS adblocking running on <a href="https://digitalocean.com)" target="_blank">DigitalOcean</a>.</h4>
44

5-
## Features
6-
* Personal IPSec VPN ([strongSwan](https://www.strongswan.org/)) deployed on DigitalOcean.
7-
* Adblocking DNS ([Pi-hole](https://pi-hole.net/)) setup by default.
8-
* Web based deployment with automated OSX VPN setup.
9-
* No additional software required - uses native OSX VPN.
10-
* Automated OS and software updates.
11-
* Downloadable mobileconfig file for sharing access to this VPN with other computers and devices.
5+
---
126

13-
## Usage
14-
1. Download the latest pre-built binary from the [GitHub Releases](https://github.com/dan-v/dosxvpn/releases) page. This is a packaged OSX app.
15-
2. Open the app and run through the web based installation wizard to setup the VPN.
16-
3. Visit http://pi.hole/admin/ (password=dosxvpn) in your browser to modify DNS adblocking settings.
7+
![](/static/images/overview.gif?raw=true)
178

18-
## How it works
19-
A web server is started on application launch and directs you to your web browser. It uses client OAuth authentication to request access to your DigitalOcean account (this permission is revoked after deployment). Once authenticated, a 512MB droplet is deployed running CoreOS that is configured to auto update on new releases. The OS is configured to launch a container ([dosxvpn/strongswan](https://hub.docker.com/r/dosxvpn/strongswan/)) on boot running [strongSwan](https://www.strongswan.org/).
9+
## Key Features
10+
* Personal IPsec-based VPN ([strongSwan](https://strongswan.org/)).
11+
* Ad blocking DNS setup by default ([Pi-hole](https://pi-hole.net/)).
12+
* Generates profiles for sharing VPN with OSX/iPhone and Android.
13+
* No additional software required for OSX/iPhone - uses native VPN client.
14+
* Simple Web or CLI installation methods.
15+
* Automated OS and VPN software updates.
16+
17+
## Web Installer (OSX)
18+
1. Download the latest pre-built app from the [GitHub Releases](https://github.com/dan-v/dosxvpn/releases) page.
19+
2. Open the app and run through the web based installation wizard to setup a new VPN.
20+
21+
## CLI Usage (OSX)
22+
1. Download the latest pre-built cli from the [GitHub Releases](https://github.com/dan-v/dosxvpn/releases) page.
23+
2. Make the binary executable
24+
```sh
25+
chmod +x dosxvpn
26+
```
27+
3. Create an API token (https://cloud.digitalocean.com/settings/api/tokens) and export it
28+
```sh
29+
export DIGITALOCEAN_ACCESS_TOKEN=<token>
30+
```
31+
4. See help for all options
32+
```sh
33+
./dosxvpn -h
34+
```
35+
36+
### CLI Examples
37+
* Deploy a new VPN and configure for immediate use
38+
```sh
39+
./dosxvpn deploy --region sfo2 --auto-configure
40+
```
41+
* List dosxvpn VPN instances
42+
```sh
43+
./dosxvpn ls
44+
```
45+
* Remove dosxvpn VPN instance
46+
```sh
47+
./dosxvpn rm --name <name>
48+
```
2049

2150
## FAQ
2251
1. <b>Should I use dosxvpn?</b> That's up to you. Use at your own risk.
23-
2. <b>Are you going to support other VPS providers?</b> Possibly.
24-
3. <b>Will this make me completely anonymous?</b> No, absolutely not. All of your traffic is going through a VPS which could be traced back to your account. You can also be tracked still with [browser fingerprinting](https://panopticlick.eff.org/), etc. Your [IP address may still leak](https://ipleak.net/) due to WebRTC, Flash, etc.
25-
4. <b>How much does this cost?</b> This spins up a 512MB DigitalOcean droplet that costs $5 a month.
26-
5. <b>How do I uninstall this thing?</b> Go to System Preferences->Network, click on dosxvpn-* and click the '-' button in the bottom left to delete the VPN. Don't forget to also remove the droplet that is deployed in your DigitalOcean account.
52+
2. <b>Why is this better than using public VPN provider XYZ?</b> While most VPN providers will provide a secure connection to their endpoints, you may not be interested in putting blind faith in their claims that they will not log or track your activity online.
53+
3. <b>How is this different than [algo](https://github.com/trailofbits/algo)?</b> 1) Installallation - is simple and has no additional system dependencies. 2) Updates: dosxvpn handles updates of both the OS and VPN. This means any critical security updates or bug fixes will automatically be applied for you.
54+
4. <b>How much does this cost?</b> This launches a 512MB DigitalOcean droplet that costs $5/month currently.
55+
5. <b>What is the bandwidth limit?</b> The 512MB DigitalOcean droplet has a 1TB bandwidth limit. This does not appear to be strictly enforced.
56+
6. <b>Where does dosxvpn store VPN configuration files?</b> You can find all deployed VPN configuration files in your ~/.dosxvpn directory.
57+
7. <b>Are you going to support other VPS providers?</b> Not right now.
58+
8. <b>Will this make me completely anonymous?</b> No, absolutely not. All of your traffic is going through a VPS which could be traced back to your account. You can also be tracked still with [browser fingerprinting](https://panopticlick.eff.org/), etc. Your [IP address may still leak](https://ipleak.net/) due to WebRTC, Flash, etc.
59+
9. <b>How do I uninstall this thing on OSX?</b> You can uninstall through the Web interface, which will also remove the running droplet in your DigitalOcean account. Alternatively go to System Preferences->Network, click on dosxvpn-* and click the '-' button in the bottom left to delete the VPN. Don't forget to also remove the droplet that is deployed in your DigitalOcean account.
2760

28-
# Powered by
29-
* [Golang](https://golang.org/)
30-
* [jbowens/dochaincore](https://github.com/jbowens/dochaincore) - Deployment code was borrowed from this project
31-
* [vimagick/strongswan](https://github.com/vimagick/dockerfiles/tree/master/strongswan) - Using forked version of this docker image for VPN
32-
* [platypus](http://www.sveinbjorn.org/platypus) - Used to generate OSX app
61+
# Powered By
62+
* [strongSwan](https://strongswan.org/) - IPsec-based VPN software
63+
* [CoreOS](https://coreos.com/) - used for running containers and automatic OS updates capabilities
64+
* [Pi-hole](https://pi-hole.net/) - used for DNS adblocking
65+
* [Platypus](http://www.sveinbjorn.org/platypus) - used to build the native OSX app
66+
* [godo](https://github.com/digitalocean/godo) - DigitalOcean Go API client
3367

34-
### Building yourself
35-
1. Fetch the project with `go get`:
68+
# Acknowledgements
69+
* [trailofbits/algo](https://github.com/trailofbits/algo) - strongSwan configuration is borrowed from this project
70+
* [jbowens/dochaincore](https://github.com/jbowens/dochaincore) - Deployment code is borrowed from this project
71+
* [vimagick/strongswan](https://github.com/vimagick/dockerfiles/tree/master/strongswan) - Using a forked version of this docker image for VPN server
3672

73+
# Building Source
74+
1. Install dependency [platypus cli](http://www.sveinbjorn.org/platypus)
75+
```sh
76+
brew install platypus
77+
```
78+
79+
2. Fetch the project with `go get`:
3780
```sh
3881
go get github.com/dan-v/dosxvpn
3982
cd $GOPATH/src/github.com/dan-v/dosxvpn
4083
```
4184

42-
2. Run make to build (will need to install [platypus cli](http://www.sveinbjorn.org/platypus)). CLI and OSX app can then be found under build/osx/x86-64.
43-
85+
2. Run make to build
4486
```sh
4587
make
46-
```
88+
```

cmd/deploy.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package cmd
2+
3+
import (
4+
"log"
5+
6+
"github.com/dan-v/dosxvpn/deploy"
7+
"github.com/spf13/cobra"
8+
)
9+
10+
var region string
11+
var autoConfigure bool
12+
13+
var deployCmd = &cobra.Command{
14+
Use: "deploy",
15+
Short: "Deploy dosxvpn VPN server",
16+
Args: func(cmd *cobra.Command, args []string) error {
17+
if region == "" {
18+
return errorMissingRegion
19+
}
20+
if !digitalOceanTokenEnvSet() {
21+
return errorMissingToken
22+
}
23+
return nil
24+
},
25+
Run: func(cmd *cobra.Command, args []string) {
26+
deployment, err := deploy.New(getCliToken(), region, autoConfigure)
27+
if err != nil {
28+
log.Fatal("Deployment failed:", err)
29+
}
30+
err = deployment.Run()
31+
if err != nil {
32+
log.Fatal("Deployment failed:", err)
33+
}
34+
},
35+
}
36+
37+
func init() {
38+
RootCmd.AddCommand(deployCmd)
39+
40+
deployCmd.Flags().StringVar(&region, "region", "", "Region to deploy droplet (e.g. ams2,ams3,nyc1,nyc2,nyc3,sfo1,sfo2).")
41+
deployCmd.Flags().BoolVar(&autoConfigure, "auto-configure", false, "Auto configure VPN (only for OSX).")
42+
}

cmd/dosxvpn/main.go

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

cmd/errors.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package cmd
2+
3+
import "errors"
4+
5+
var (
6+
errorMissingToken = errors.New("need to have environment variable DIGITALOCEAN_ACCESS_TOKEN set")
7+
errorMissingRegion = errors.New("need to specify region")
8+
errorMissingName = errors.New("need to specify name")
9+
)

0 commit comments

Comments
 (0)