Cloak server/client v2.12.0. Inspired by https://github.com/cbeuw/Cloak
771
Homepage of sources: https://github.com/cbeuw/Cloak
Docker image OS is Alpine Linux (Egde) Inside this docker image there are Cloak 2.8.0. Also this docker image has some scripts for simplifying ordinary administration tasks.
MODE=SERVER
To make a permanent docker volume for storing Cloak settings please create the /opt/cloak folder on the host of your Cloak server/client, and put this docker-compose.yml file anywhere you want in this host:
Many variables of this example has default values. You should reassign them with your needs before start the container!
services:
cloak:
container_name: cloak
image: robonuka/cloak:latest
restart: unless-stopped
ports:
- 443:443/tcp
environment:
- 'MODE=SERVER'
- 'CK_SERVER_PORT=443'
- 'TCP_BACKEND_ADDRESS=openvp.your.domain'
- 'TCP_BACKEND_PORT=1194'
- 'UDP_BACKEND_ADDRESS=wireguard.your.domain'
- 'UDP_BACKEND_PORT=51820'
volumes:
- /etc/localtime:/etc/localtime
- /opt/cloak:/etc/cloak
networks:
- cloak
networks:
cloak:
driver: 'bridge'
Then run docker container as usually:
sudo docker compose up -d -f /path/to/your/docker-compose.yml
See the log of docker container with command:
sudo docker logs -f cloak
Cloak server generate ckserver.json and ckserver.pub files at the first run. Do not remove or modify them manually!
| Variable | Description | Default value |
|---|---|---|
| MODE | Must be 'SERVER' or 'CLIENT' only! | N/A |
MODE='SERVER'
| Variable | Description | Default value |
|---|---|---|
| CK_SERVER_ADDRESS | Specify IP address to bind Cloak server or it will bind to 0.0.0.0 | N/A |
| CK_SERVER_PORT | Specify port number to bind Cloak server | 443 |
| TCP_BACKEND_ADDRESS | Backend service's IP address for TCP protocol | 127.0.0.1 |
| TCP_BACKEND_PORT | Backend service's port number for TCP protocol | 1234 |
| UDP_BACKEND_ADDRESS | Backend service's IP address for UDP protocol | 127.0.0.1 |
| UDP_BACKEND_PORT | Backend service's port number for UDP protocol | 1234 |
| REDIR_ADDRESS | google.com | |
| CK_SERVER_DB | Path to users database | userinfo.db |
| CK_SERVER_STREAM_TIMEOUT | 300 | |
| CK_CLIENT_ENCRYPTION_METHOD | Specify encryption for HTTPS stream | chacha20-poly1305 |
| CK_CLIENT_NUMCONN | Specify client's sessions numder | 4 |
All commands below should be run in Cloak SERVER host where is docker container working!
sudo docker exec cloak admin new [ProxyMethod]
ProxyMethod should be tcp or udp only!
sudo docker exec cloak admin get [ProxyMethod]
ProxyMethod should be tcp or udp only!
Put showed config to the ckclient.json file in a Cloak admin's host.
sudo docker exec cloak admin del
sudo docker exec cloak list
ProxyMethod should be tcp or udp only!
sudo docker exec cloak add <ProxyMethod>
ProxyMethod should be tcp or udp only!
Put showed config to the ckclient.json file in a Cloak client's host.
sudo docker exec cloak get <UID> <ProxyMethod>
ProxyMethod should be tcp or udp only!
Put showed config to the ckclient.json file in a Cloak client's host.
sudo docker exec cloak del <UID>
sudo docker exec cloak del KILLEMALL
MODE='CLIENT'
To make a permanent docker volume for storing Cloak client settings please create the /opt/cloak-client-openvpn and/or /opt/cloak-client-wireguard folder(s) with appropriate ckclient.json inside, and put this docker-compose.yml file anywhere you want in this host:
services:
cloak-client-openvpn:
container_name: cloak-client-openvpn
image: robonuka/cloak:latest
restart: unless-stopped
ports:
- 443:443/tcp
environment:
- 'MODE=CLIENT'
- 'CK_CLIENT_PROTOCOL=tcp'
- 'CK_CLIENT_LISTEN_ADDRESS=cloak-client-openvpn'
- 'CK_CLIENT_LISTEN_PORT=443'
- 'CK_SERVER_ADDRESS=your.cloak.server'
- 'CK_SERVER_PORT=443'
volumes:
- /etc/localtime:/etc/localtime
- /opt/cloak-client-openvpn:/etc/cloak
networks:
- cloak
cloak-client-wireguard:
container_name: cloak-client-wireguard
image: robonuka/cloak:latest
restart: unless-stopped
ports:
- 138:138/udp
environment:
- 'MODE=CLIENT'
- 'CK_CLIENT_PROTOCOL=udp'
- 'CK_CLIENT_LISTEN_ADDRESS=cloak-client-wireguard'
- 'CK_CLIENT_LISTEN_PORT=138'
- 'CK_SERVER_ADDRESS=your.cloak.server'
- 'CK_SERVER_PORT=443'
volumes:
- /etc/localtime:/etc/localtime
- /opt/cloak-client-wireguard:/etc/cloak
networks:
- cloak
networks:
cloak:
driver: 'bridge'
Port number in the CK_SERVER_PORT should be the same for Cloak server and Cloak client!
| Variable | Description | Default value |
|---|---|---|
| CK_CLIENT_ADMINUID | Specify your AdminUID if you have | N/A |
| CK_CLIENT_PROTOCOL | Specify Cloak client listen protocol. Shoud be TCP or UDP only! | N/A |
| CK_CLIENT_LISTEN_ADDRESS | Specify Cloak client listen IP address | 0.0.0.0 |
| CK_CLIENT_LISTEN_PORT | Specify Cloak client listen port | 443 |
| CK_SERVER_ADDRESS | Specify IP address of Cloak server | 127.0.0.1 |
| CK_SERVER_PORT | Specify port number to bind Cloak server | 443 |
Then run docker container as usually:
sudo docker compose up -d -f /path/to/your/docker-compose.yml
See the log of docker container with command:
sudo docker logs -f cloak-client-openvpn
or
sudo docker logs -f cloak-client-wireguard
After Cloak session established you can configure your OpenVPN and/or Wireguard client(s) connect to 443/tcp or 138/udp ports of your Cloak client host. Your OpenVPN/Wireguard traffic will be catched and encapsulated by Cloak client into the classic HTTPS stream which will be decapsulated and routed by Cloak server to the appropriate VPN server further.
Content type
Image
Digest
sha256:982b684e0…
Size
20.2 MB
Last updated
12 months ago
docker pull robonuka/cloak