NetHops is a community app that enables you to establish a network hop. This provides your friends and community members with secure, domain-specific access, guaranteeing a tailored browsing experience for each user.
Docker must be installed and running on your system. Install Docker
git clone https://github.com/filouz/nethops
./configure && make
make install # will erease the existing PKI-
Add a Profile
NAME="user" PASSWORD="strong_password" make addProfile name="$NAME" pwd="$PASSWORD"
-
Revoke a Profile
make revokeProfile name="$NAME" -
Generate .ovpn Files
make ovpnProfile name="$NAME"
make runFor alternative running methods, refer to docker/server/docker-compose.yaml. You can also automate the deployment process using this Ansible collection.
git clone https://github.com/filouz/nethopsCreate a folder ./vault/ovpn to store your credentials files.
client.ovpnYou can remove/comment these lines to espace auto configuration :up /scripts/update-resolv.sh down /scripts/update-resolv.shclient.pwd(Optional: Contains the password in plaintext for silent mode.)
make client_local_runYou could also explore OpenVPN Connect as an alternative.
openvpn --script-security 2 --config ./.vault/ovpn/client.ovpnSlient mode :
openvpn --script-security 2 --config ./.vault/ovpn/client.ovpn --askpass ./.vault/ovpn/client.pwdmake client- Use the
docker-compose.yamlfile located in./docker/client/docker-compose.yaml.
cd ./docker/client
docker compose upUse the nh_client.yaml file located at ./deployment/nh_client.yaml.
Modify the ./scripts/domains.conf file to control which domains users can access via the VPN.
-
Example Structure:
.google.com .facebook.com .tiktok.com .ipify.org -
Domain Specifications: Prefix domains with a
.to allow all subdomains. For example,.google.comwould include access to subdomains likemail.google.com. -
Applying Changes: After updating the
domains.conffile, restart the server to apply the changes.
When the VPN client is running, an API is available on port 8080 for VPN connection management:
-
Endpoints:
/start: Starts the VPN connection./stop: Stops the active VPN connection./healthz: Checks the service status (returns the current state of the service).
This project incorporates components from kylemanna/docker-openvpn
Your contributions are welcome! If you find bugs or have suggestions for enhancements, please create an issue or submit a pull request.
This project is licensed under the GNU General Public License v3.0 (GPLv3).
