Merge pull request #3 from bobbypage/privileged
Remove need for running in privileged mode
This commit is contained in:
commit
f0d786c382
2 changed files with 9 additions and 1 deletions
|
@ -9,7 +9,9 @@ Now simply mount the configuration file and run! For example, if your configurat
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --name wireguard \
|
docker run --name wireguard \
|
||||||
--privileged \
|
--cap-add NET_ADMIN \
|
||||||
|
--cap-add SYS_MODULE \
|
||||||
|
--sysctl net.ipv4.conf.all.src_valid_mark=1 \
|
||||||
-v /path/to/conf/mullvad.conf:/etc/wireguard/mullvad.conf \
|
-v /path/to/conf/mullvad.conf:/etc/wireguard/mullvad.conf \
|
||||||
jordanpotter/wireguard
|
jordanpotter/wireguard
|
||||||
```
|
```
|
||||||
|
|
|
@ -11,6 +11,12 @@ fi
|
||||||
config=`echo $configs | head -n 1`
|
config=`echo $configs | head -n 1`
|
||||||
interface="${config%.*}"
|
interface="${config%.*}"
|
||||||
|
|
||||||
|
if [[ "$(cat /proc/sys/net/ipv4/conf/all/src_valid_mark)" != "1" ]]; then
|
||||||
|
echo "sysctl net.ipv4.conf.all.src_valid_mark=1 is not set" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -i "s:sysctl -q net.ipv4.conf.all.src_valid_mark=1:echo skipping setting net.ipv4.conf.all.src_valid_mark:" /usr/bin/wg-quick
|
||||||
wg-quick up $interface
|
wg-quick up $interface
|
||||||
|
|
||||||
docker_network="$(ip -o addr show dev eth0 | awk '$3 == "inet" {print $4}')"
|
docker_network="$(ip -o addr show dev eth0 | awk '$3 == "inet" {print $4}')"
|
||||||
|
|
Loading…
Reference in a new issue