https://github.com/m1k1o/ovpn-nodejs
Control OVPN (+ Proxy server) via HTTP.
https://github.com/m1k1o/ovpn-nodejs
http-server nodejs openvpn-client proxy-server squid-proxy vpn-client
Last synced: 6 months ago
JSON representation
Control OVPN (+ Proxy server) via HTTP.
- Host: GitHub
- URL: https://github.com/m1k1o/ovpn-nodejs
- Owner: m1k1o
- Created: 2020-03-17T22:30:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-24T00:35:03.000Z (over 2 years ago)
- Last Synced: 2025-03-27T20:11:12.144Z (6 months ago)
- Topics: http-server, nodejs, openvpn-client, proxy-server, squid-proxy, vpn-client
- Language: JavaScript
- Homepage:
- Size: 380 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ovpn-nodejs
Run OpenVPN inside docker container. Connect using Proxy. Choose and change from supplied `.ovpn` files.
```
version: '3.4'
services:
vpn:
build: .
container_name: vpn
restart: unless-stopped
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
cap_add:
- net_admin
volumes:
- /dev/net:/dev/net:z
- ./vpn:/vpn
```
## Openvpn authentication
If your ovpn configuration contains this line `auth-user-pass` you need to supply authentication file.
Create `.auth` file in your `vpn` folder. First line will be username, second line will be your password. And then replace it in all your files:
```
find . -type f -name "*.ovpn" -print0 | xargs -0 sed -i "s/^auth-user-pass$/auth-user-pass \/vpn\/.auth/g"
```## Env
### File regex
Match only files matching given RegExp. In filename will be this part omitted.
```
FILE_REGEXP: '\.(ovpn|conf)$$'
```
Note: Use `$$` in docker-compose for `$`.Example:
* `\.(ovpn|conf)$` -> foo.bar -> *ignored*
* `\.(ovpn|conf)$` -> homelab.ovpn -> homelab
* `\.ovpn` -> homelab.ovpn -> homelab
* `\.ovpn` -> my.ovpn.server.ovpn -> my.server
* `myvpn` -> server01.myvpn.ovpn -> server01.ovpn### Group regex
First matching group of this regex will be used to group files.
```
GROUP_REGEXP: '^([a-z]+)-'
```Example:
* sk-server01.ovpn
* sk-server02.ovpn
* sk-server03.ovpn
* de-server01.ovpn
* de-server02.ovpnGroups:
* de
* sk