commit 5ba8d0df1c3aa63592eec9c4e46f2e646b1ae6a3 Author: Pierre-Olivier Mercier Date: Fri Jul 18 16:04:27 2025 +0200 Initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2d38e1f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine:3 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/openvpn", "--cd", "/etc/openvpn", "--config", "fdn.ovpn"] + +RUN apk --no-cache add openvpn + +RUN wget -O /etc/openvpn/fdn.ovpn https://git.fdn.fr/fdn-public/wiki/-/raw/master/vpn/openvpn/client/configuration/fdn-vpn.ovpn && sed -i 's@^auth-user-pass.*$@auth-user-pass fdn-pass.txt@' /etc/openvpn/fdn.ovpn +COPY entrypoint.sh /docker-entrypoint.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..66d16bb --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +OpenVPN client for FDN VPN +========================== + +You can use this container to join the FDN VPN inside a container. + +Basic usage: + +``` +read -s -p "VPN Password: " VPN_PASSWORD; export VPN_PASSWORD="${VPN_PASSWORD}" +docker run --name fdn-router --rm --cap-add NET_ADMIN -e VPN_USERNAME=username@vpn.fdn.fr -e VPN_PASSWORD --device /dev/net/tun:/dev/net/tun nemunaire/openvpn-fdn +``` + +You can then create futher containers in the same network stack: + +``` +docker run --rm -it --network container:fdn-router alpine +``` diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..6c98d32 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +cat < /etc/openvpn/fdn-pass.txt +${VPN_USERNAME} +${VPN_PASSWORD} +EOF + +exec $@