Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 63f9ffe
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu Jun 3 09:40:48 2021 +0200

    docs: add gchamon as a contributor (#185)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit f3f0c8e
Author: Gabriel Chamon Araujo <[email protected]>
Date:   Thu Jun 3 04:30:10 2021 -0300

    added option to disable dns in wireguard conf (#168)

    * added option to disable dns in wireguard conf

    * updated readme

    * adding suggested edits
    - adding example in both docker and docker-compose commands
    - changing disableDNS from string to bool
    - removing the DNS line altogether
    - disabling dnsmasq service if dns is disabled

commit e3cf519
Author: Jack <[email protected]>
Date:   Thu May 20 14:45:09 2021 +0100

    feature: Add release-drafter to project (#172)

    * Add release-drafter to project

    * Extend release-drafter for features and refactor

commit dda5a7e
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 14:18:05 2021 +0200

    docs: add Coffeeri as a contributor (#183)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit fbd481c
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 14:06:09 2021 +0200

    docs: add Freekers as a contributor (#182)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit 1ef43bc
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 14:03:14 2021 +0200

    docs: add dovreshef as a contributor (#181)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit 6490762
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 14:02:21 2021 +0200

    docs: add miki725 as a contributor (#180)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit 1e86175
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 14:01:28 2021 +0200

    docs: add d3473r as a contributor (#179)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit 4f221ca
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 13:59:19 2021 +0200

    docs: add vojta7 as a contributor (#178)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit 7bf0af9
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 13:57:51 2021 +0200

    docs: add SGudbrandsson as a contributor (#177)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit 6570b64
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 13:48:43 2021 +0200

    docs: add sinanmohd as a contributor (#176)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

commit 0fa7706
Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Date:   Thu May 20 13:47:27 2021 +0200

    docs: add nhamlh as a contributor (#175)

    * docs: update README.md [skip ci]

    * docs: update .all-contributorsrc [skip ci]

    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
  • Loading branch information
Adrián González Barbosa committed Jun 3, 2021
1 parent e4e507f commit bf8db26
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 19 deletions.
90 changes: 90 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,96 @@
"contributions": [
"doc"
]
},
{
"login": "nhamlh",
"name": "Nham Le",
"avatar_url": "https://avatars.githubusercontent.com/u/11173217?v=4",
"profile": "https://nhamlh.space",
"contributions": [
"code"
]
},
{
"login": "sinanmohd",
"name": "Sinan Mohd",
"avatar_url": "https://avatars.githubusercontent.com/u/69694713?v=4",
"profile": "https://github.com/sinanmohd",
"contributions": [
"doc"
]
},
{
"login": "SGudbrandsson",
"name": "Sigurður Guðbrandsson",
"avatar_url": "https://avatars.githubusercontent.com/u/1608474?v=4",
"profile": "http://www.sigginet.info",
"contributions": [
"code"
]
},
{
"login": "vojta7",
"name": "vojta7",
"avatar_url": "https://avatars.githubusercontent.com/u/10436347?v=4",
"profile": "https://github.com/vojta7",
"contributions": [
"code"
]
},
{
"login": "d3473r",
"name": "Fabian",
"avatar_url": "https://avatars.githubusercontent.com/u/10356892?v=4",
"profile": "https://github.com/d3473r",
"contributions": [
"doc"
]
},
{
"login": "miki725",
"name": "Miroslav Shubernetskiy",
"avatar_url": "https://avatars.githubusercontent.com/u/932940?v=4",
"profile": "http://miki725.com",
"contributions": [
"doc"
]
},
{
"login": "dovreshef",
"name": "dovreshef",
"avatar_url": "https://avatars.githubusercontent.com/u/5120549?v=4",
"profile": "https://github.com/dovreshef",
"contributions": [
"code"
]
},
{
"login": "Freekers",
"name": "Freekers",
"avatar_url": "https://avatars.githubusercontent.com/u/1370857?v=4",
"profile": "https://freek.ws/",
"contributions": [
"code"
]
},
{
"login": "Coffeeri",
"name": "Leander",
"avatar_url": "https://avatars.githubusercontent.com/u/8344540?v=4",
"profile": "https://github.com/Coffeeri",
"contributions": [
"doc"
]
},
{
"login": "gchamon",
"name": "Gabriel Chamon Araujo",
"avatar_url": "https://avatars.githubusercontent.com/u/9471861?v=4",
"profile": "https://github.com/gchamon",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
51 changes: 51 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Config for https://github.com/apps/release-drafter
name-template: 'v$NEXT_MINOR_VERSION (🌈 Insert Release Name)'
tag-template: 'v$NEXT_MINOR_VERSION'
categories:
- title: 'Dependency Updates'
label: 'dependencies'
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
exclude-labels:
- 'skip-changelog'
autolabeler:
- label: 'documentation'
files:
- '*.md'
branch:
- '/docs{0,1}\/.+/'
title:
- '/docs/i'
- label: 'bug'
branch:
- '/fix\/.+/'
title:
- '/fix/i'
- label: 'enhancement'
branch:
- '/feature\/.+/'
body:
- '/feature{0,1}\/.+/'
title:
- '/feature/i'
- label: 'refactor'
branch:
- '/refactor\/.+/'
title:
- '/refactor/i'
template: |
## Changes
$CHANGES
## Upgrading
To upgrade, swap your docker-tags
```diff
- subspacecommunity/subspace:$PREVIOUS_TAG
+ subspacecommunity/subspace:$NEXT_MINOR_VERSION
```
14 changes: 14 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Draft Release

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Subspace - A simple WireGuard VPN server GUI

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

[![](https://images.microbadger.com/badges/image/subspacecommunity/subspace.svg)](https://microbadger.com/images/subspacecommunity/subspace "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/version/subspacecommunity/subspace.svg)](https://microbadger.com/images/subspacecommunity/subspace "Get your own version badge on microbadger.com")
Expand Down Expand Up @@ -156,6 +156,8 @@ Make sure to change the `--env SUBSPACE_HTTP_HOST` to your publicly accessible d

If you want to run the vpn on a different domain as the http host you can set `--env SUBSPACE_ENDPOINT_HOST`

Use `--env SUBSPACE_DISABLE_DNS=1` to make subspace generate wireguard configs without the `DNS` option, preserving the user's DNS servers.

```bash

# Your data directory should be bind-mounted as `/data` inside the container using the `--volume` flag.
Expand All @@ -172,14 +174,17 @@ docker create \
--env SUBSPACE_NAMESERVERS="1.1.1.1,8.8.8.8" \
# Optional variable to change WireGuard Listenport
--env SUBSPACE_LISTENPORT="51820" \
# Optional variables to change IPv4/v6 prefixes
# Optional variables to change IPv4/v6 prefixes
--env SUBSPACE_IPV4_POOL="10.99.97.0/24" \
--env SUBSPACE_IPV6_POOL="fd00::10:97:0/64" \
# Optional variables to change IPv4/v6 Gateway
--env SUBSPACE_IPV4_GW="10.99.97.1" \
--env SUBSPACE_IPV6_GW="fd00::10:97:1" \
# Optional variable to enable or disable IPv6 NAT
--env SUBSPACE_IPV6_NAT_ENABLED=1 \
# Optional variable to disable DNS server. Enabled by default.
# consider disabling DNS server, if supporting international VPN clients
--env SUBSPACE_DISABLE_DNS=0 \
subspacecommunity/subspace:latest

$ sudo docker start subspace
Expand Down Expand Up @@ -320,6 +325,20 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="http://blog.selvakn.in"><img src="https://avatars.githubusercontent.com/u/30524?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Selva</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=selvakn" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/syphernl"><img src="https://avatars.githubusercontent.com/u/639906?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Frank</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=syphernl" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/gianlazz"><img src="https://avatars.githubusercontent.com/u/1166579?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gian Lazzarini</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=gianlazz" title="Documentation">📖</a></td>
<td align="center"><a href="https://nhamlh.space"><img src="https://avatars.githubusercontent.com/u/11173217?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nham Le</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=nhamlh" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/sinanmohd"><img src="https://avatars.githubusercontent.com/u/69694713?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sinan Mohd</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=sinanmohd" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="http://www.sigginet.info"><img src="https://avatars.githubusercontent.com/u/1608474?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sigurður Guðbrandsson</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=SGudbrandsson" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/vojta7"><img src="https://avatars.githubusercontent.com/u/10436347?v=4?s=100" width="100px;" alt=""/><br /><sub><b>vojta7</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=vojta7" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/d3473r"><img src="https://avatars.githubusercontent.com/u/10356892?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fabian</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=d3473r" title="Documentation">📖</a></td>
<td align="center"><a href="http://miki725.com"><img src="https://avatars.githubusercontent.com/u/932940?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Miroslav Shubernetskiy</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=miki725" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/dovreshef"><img src="https://avatars.githubusercontent.com/u/5120549?v=4?s=100" width="100px;" alt=""/><br /><sub><b>dovreshef</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=dovreshef" title="Code">💻</a></td>
<td align="center"><a href="https://freek.ws/"><img src="https://avatars.githubusercontent.com/u/1370857?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Freekers</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=Freekers" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Coffeeri"><img src="https://avatars.githubusercontent.com/u/8344540?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Leander</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=Coffeeri" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/gchamon"><img src="https://avatars.githubusercontent.com/u/9471861?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gabriel Chamon Araujo</b></sub></a><br /><a href="https://github.com/subspacecommunity/subspace/commits?author=gchamon" title="Code">💻</a></td>
</tr>
</table>

Expand Down
8 changes: 8 additions & 0 deletions cmd/subspace/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ func profileAddHandler(w *Web) {
if enable := getEnv("SUBSPACE_IPV6_NAT_ENABLED", "1"); enable == "0" {
ipv6Enabled = false
}
disableDNS := false
if shouldDisableDNS := getEnv("SUBSPACE_DISABLE_DNS", "0"); shouldDisableDNS == "1" {
disableDNS = true
}

script := `
cd {{$.Datadir}}/wireguard
Expand All @@ -440,7 +444,9 @@ cat <<WGCLIENT >clients/{{$.Profile.ID}}.conf
[Interface]
# friendly_json = $(get_friendly_json)
PrivateKey = ${wg_private_key}
{{- if not .DisableDNS }}
DNS = {{if .Ipv4Enabled}}{{$.IPv4Gw}}{{end}}{{if .Ipv6Enabled}}{{if .Ipv4Enabled}},{{end}}{{$.IPv6Gw}}{{end}}
{{- end }}
Address = {{if .Ipv4Enabled}}{{$.IPv4Pref}}{{$.Profile.Number}}/{{$.IPv4Cidr}}{{end}}{{if .Ipv6Enabled}}{{if .Ipv4Enabled}},{{end}}{{$.IPv6Pref}}{{$.Profile.Number}}/{{$.IPv6Cidr}}{{end}}
[Peer]
Expand All @@ -466,6 +472,7 @@ WGCLIENT
AllowedIPS string
Ipv4Enabled bool
Ipv6Enabled bool
DisableDNS bool
}{
profile,
email,
Expand All @@ -482,6 +489,7 @@ WGCLIENT
allowedips,
ipv4Enabled,
ipv6Enabled,
disableDNS,
})
if err != nil {
logErrorAndRedirect(err, w, errorFile, "/?error=addprofile")
Expand Down
43 changes: 26 additions & 17 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,21 @@ else
export SUBSPACE_IPV4_NAT_ENABLED=0
fi

# DNS server is disabled if the flag is not ommited and set to anything other than 0.
if ! [ -z "${SUBSPACE_DISABLE_DNS-}" ] && [ "${SUBSPACE_DISABLE_DNS}" != "0" ]; then
export SUBSPACE_DISABLE_DNS=1
else
export SUBSPACE_DISABLE_DNS=0
fi

if [ "$SUBSPACE_IPV6_NAT_ENABLED" == "0" ] && [ "$SUBSPACE_IPV4_NAT_ENABLED" == "0" ]; then
echo "One of envionment variables SUBSPACE_IPV6_NAT_ENABLED, SUBSPACE_IPV4_NAT_ENABLED must be set to 1."
echo "Got SUBSPACE_IPV6_NAT_ENABLED=$SUBSPACE_IPV6_NAT_ENABLED, SUBSPACE_IPV4_NAT_ENABLED=$SUBSPACE_IPV4_NAT_ENABLED"
exit 1
fi

# Empty out inherited nameservers
echo "" > /etc/resolv.conf
echo "" >/etc/resolv.conf
# Set DNS servers
echo ${SUBSPACE_NAMESERVERS} | tr "," "\n" | while read -r ns; do echo "nameserver ${ns}" >>/etc/resolv.conf; done

Expand Down Expand Up @@ -177,16 +184,17 @@ wg setconf wg0 /data/wireguard/server.conf
ip link set wg0 up

# dnsmasq service
DNSMASQ_LISTEN_ADDRESS="127.0.0.1"
if [[ ${SUBSPACE_IPV4_NAT_ENABLED} -ne 0 ]]; then
DNSMASQ_LISTEN_ADDRESS="${DNSMASQ_LISTEN_ADDRESS},${SUBSPACE_IPV4_GW}"
fi
if [[ ${SUBSPACE_IPV6_NAT_ENABLED} -ne 0 ]]; then
DNSMASQ_LISTEN_ADDRESS="${DNSMASQ_LISTEN_ADDRESS},${SUBSPACE_IPV6_GW}"
fi
if [[ ${SUBSPACE_DISABLE_DNS} == "0" ]]; then
DNSMASQ_LISTEN_ADDRESS="127.0.0.1"
if [[ ${SUBSPACE_IPV4_NAT_ENABLED} -ne 0 ]]; then
DNSMASQ_LISTEN_ADDRESS="${DNSMASQ_LISTEN_ADDRESS},${SUBSPACE_IPV4_GW}"
fi
if [[ ${SUBSPACE_IPV6_NAT_ENABLED} -ne 0 ]]; then
DNSMASQ_LISTEN_ADDRESS="${DNSMASQ_LISTEN_ADDRESS},${SUBSPACE_IPV6_GW}"
fi

if ! test -d /etc/service/dnsmasq; then
cat <<DNSMASQ >/etc/dnsmasq.conf
if ! test -d /etc/service/dnsmasq; then
cat <<DNSMASQ >/etc/dnsmasq.conf
# Only listen on necessary addresses.
listen-address=${DNSMASQ_LISTEN_ADDRESS}
Expand All @@ -197,20 +205,21 @@ if ! test -d /etc/service/dnsmasq; then
bogus-priv
DNSMASQ

mkdir -p /etc/service/dnsmasq
cat <<RUNIT >/etc/service/dnsmasq/run
mkdir -p /etc/service/dnsmasq
cat <<RUNIT >/etc/service/dnsmasq/run
#!/bin/sh
exec /usr/sbin/dnsmasq --no-daemon
RUNIT
chmod +x /etc/service/dnsmasq/run
chmod +x /etc/service/dnsmasq/run

# dnsmasq service log
mkdir -p /etc/service/dnsmasq/log/main
cat <<RUNIT >/etc/service/dnsmasq/log/run
# dnsmasq service log
mkdir -p /etc/service/dnsmasq/log/main
cat <<RUNIT >/etc/service/dnsmasq/log/run
#!/bin/sh
exec svlogd -tt ./main
RUNIT
chmod +x /etc/service/dnsmasq/log/run
chmod +x /etc/service/dnsmasq/log/run
fi
fi

# subspace service
Expand Down

0 comments on commit bf8db26

Please sign in to comment.