1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 03:48:44 +00:00
dockerfiles/obfsproxy/README.md

94 lines
2.2 KiB
Markdown
Raw Normal View History

2015-04-30 10:08:49 +00:00
OpenVPN over Obfsproxy
======================
2015-05-24 04:23:19 +00:00
`Obfsproxy` is a pluggable transport proxy written in python.
It provides several obfuscation method. I consider `scramblesuit` the best.
2015-04-30 11:39:20 +00:00
I will update this image if there's better one.
2015-05-24 04:23:19 +00:00
![obfsproxy](http://www.cs.kau.se/philwint/scramblesuit/images/big_picture.png)
`scramblesuit` can transport any application that supports SOCKS.
This includes `Tor`, `VPN`, `SSH`, and many other protocols.
We can transport `OpenVPN` over `Obfsproxy`, so that firewall cannot detect it.
2016-04-02 00:19:22 +00:00
In the following example, you should run `vimagick/openvpn` container first.
2015-05-24 04:23:19 +00:00
Don't forget to edit `/etc/openvpn/openvpn.conf` to use `proto tcp`.
2015-04-30 10:32:52 +00:00
2015-04-30 10:08:49 +00:00
## docker-compose.yml
```
2015-04-30 11:39:20 +00:00
data:
2016-04-02 00:19:22 +00:00
image: busybox
2015-04-30 11:39:20 +00:00
volumes:
2015-04-30 11:50:32 +00:00
- /etc/openvpn
2015-04-30 11:39:20 +00:00
server:
2016-04-02 00:19:22 +00:00
image: vimagick/openvpn
2015-04-30 11:39:20 +00:00
ports:
2015-04-30 11:50:32 +00:00
- "1194:1194/tcp"
2015-04-30 11:39:20 +00:00
volumes_from:
2015-04-30 11:50:32 +00:00
- data
2015-04-30 11:39:20 +00:00
cap_add:
2015-04-30 11:50:32 +00:00
- NET_ADMIN
2015-04-30 11:39:20 +00:00
restart: always
2015-04-30 10:08:49 +00:00
obfsproxy:
2016-04-02 00:19:22 +00:00
image: vimagick/obfsproxy
2015-04-30 10:08:49 +00:00
ports:
- "4911:4911"
links:
2015-04-30 11:39:20 +00:00
- server:openvpn
environment:
- PASSWORD=J23TNHPJPAOQJLTCPLFD4CQYVFY6MEVP
2015-05-01 09:54:38 +00:00
- DEST_ADDR=openvpn
2015-04-30 11:39:20 +00:00
- DEST_PORT=1194
- LISTEN_ADDR=0.0.0.0
- LISTEN_PORT=4911
restart: always
```
To link a existing `openvpn` container, please use `external_links` instead of `links`.
2015-04-30 11:46:33 +00:00
```
2015-04-30 11:39:20 +00:00
obfsproxy:
2016-04-02 00:19:22 +00:00
image: vimagick/obfsproxy
2015-04-30 11:39:20 +00:00
ports:
- "4911:4911"
external_links:
2015-04-30 10:08:49 +00:00
- openvpn_server_1:openvpn
environment:
- PASSWORD=J23TNHPJPAOQJLTCPLFD4CQYVFY6MEVP
2015-05-01 09:54:38 +00:00
- DEST_ADDR=openvpn
2015-04-30 10:08:49 +00:00
- DEST_PORT=1194
- LISTEN_ADDR=0.0.0.0
- LISTEN_PORT=4911
restart: always
```
2015-05-01 09:17:40 +00:00
The default run mode is `server`. You can also run container in `client` mode.
The following example shows us how to make a OpenVPN relay:
2015-05-01 08:25:42 +00:00
```
obfsproxy:
2016-04-02 00:19:22 +00:00
image: vimagick/obfsproxy
2015-05-01 09:17:40 +00:00
ports:
2015-05-01 09:49:42 +00:00
- "1194:1194/tcp"
2015-05-01 08:25:42 +00:00
environment:
2015-05-01 09:17:40 +00:00
- PASSWORD=J23TNHPJPAOQJLTCPLFD4CQYVFY6MEVP
2016-05-01 01:06:20 +00:00
- DEST_ADDR=vpn.easypi.info
2015-05-01 09:17:40 +00:00
- DEST_PORT=4911
2015-05-01 08:25:42 +00:00
- RUN_MODE=client
2015-05-01 09:17:40 +00:00
- LISTEN_ADDR=0.0.0.0
2015-05-01 09:49:42 +00:00
- LISTEN_PORT=1194
2015-05-01 09:17:40 +00:00
restart: always
2015-05-01 08:25:42 +00:00
```
2015-04-30 11:39:20 +00:00
The password should be encoded by Base32 with fixed length.
You can generate one via this command:
2015-04-30 11:46:33 +00:00
```
2015-04-30 11:39:20 +00:00
python -c 'import base64, os; print base64.b32encode(os.urandom(20))'
```
2015-05-12 08:49:35 +00:00
Note: There's no ports exposed in Dockerfile. You need to expose port explicitly.