Skip to content

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 zapret-sing-box-docker

Docker image with zapret, dnscrypt-proxy and sing-box

Allows you to dockerize zapret + dnscrypt-proxy and access them via any proxy protocol supported by sing-box

Based on https://github.com/F33RNI/zapret-v2ray-docker [deprecated]


🏗️ Installation

1. Install Docker

https://docs.docker.com/engine/install/

2. Clone repo

git clone https://github.com/F33RNI/zapret-sing-box-docker.git
cd zapret-sing-box-docker

3. Build image

./build.sh

Edit .env file if needed

4. Edit config files

All configs are located in configs/ dir

Use provided strategies-converter-tester.sh script to fetch and parse windows .bat strategies from strategies-converter-tester_strategies.txt and edit configs/zapret.conf accordingly

Or you can start the container (by calling start.sh) and use strategies-converter-tester.sh with test argument to test parsed strategies:

# Start the container
TZ="Etc/UTC" ./start.sh

# Parse and test ALL strategies from strategies-converter-tester_strategies.txt using custom URL
TEST_URL="https://cp.cloudflare.com" ./strategies-converter-tester.sh test

You can specify custom URLs or local filepaths to windows .bat strategies inside strategies-converter-tester_strategies.txt and custom lists (URLs or local file paths) used by them inside strategies-converter-tester_lists.txt

5. Provide ports and start the container

PORTS="127.0.0.1:2080:2080" TZ="Etc/UTC" ./start.sh

Please see comments in the .env file for more info

NOTE: To start without -d / --detach arg, use ./start.sh nd / ./start.sh nodetach instead

# Check zapret logs
tail -f logs/zapret.log

# Check dnscrypt-proxy logs
tail -f logs/dnscrypt-proxy.log

# Check sing-box logs
tail -f logs/sing-box.log

6. Wait a bit and test

curl --proxy "127.0.0.1:2080" --head -L https://youtube.com

⏹️ Stop the container

Simply run

./stop.sh rm

Specify rm argument to this script to remove the container


🔃 Reload configs

You can apply new config files without restarting the container. For that, simply run

./reload.sh

Optionally, to see logs after reload you can run

./reload.sh && tail -f logs/sing-box.log

🧱 Blockcheck

Simply start the container and run

./blockcheck.sh

So

./start.sh
# Wait a few seconds
./blockcheck.sh

Output will be written into logs/blockcheck.log

To edit domains, add DOMAINS variable to the .env file and run ./build.sh script again


🐧 Linux service (example)

/lib/systemd/system/zapret-sing-box-docker.service

[Unit]
Description=zapret-sing-box-docker service
After=docker.service network-online.target
Requires=docker.service network-online.target multi-user.target

[Service]
Type=simple
WorkingDirectory=/path/to/zapret-sing-box-docker
Environment=PORTS="0.0.0.0:2080:2080" TZ="Etc/UTC"
ExecStartPre=/usr/bin/sleep 5
ExecStart=/path/to/zapret-sing-box-docker/start.sh nd
ExecStop=/path/to/zapret-sing-box-docker/stop.sh rm
ExecReload=/path/to/zapret-sing-box-docker/reload.sh
Restart=no
User=your-user-name
Group=your-user-name

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now zapret-sing-box-docker.service

With that service you can reload container by typing sudo systemctl reload zapret-sing-box-docker.service


🌲 Dependencies and credits

About

Allows you to dockerize zapret + dnscrypt-proxy and access them via any proxy protocol supported by sing-box

Topics

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages