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]
https://docs.docker.com/engine/install/
git clone https://github.com/F33RNI/zapret-sing-box-docker.git
cd zapret-sing-box-docker./build.shEdit
.envfile if needed
All configs are located in configs/ dir
- sing-box official documentation: https://sing-box.sagernet.org/configuration/
- dnscrypt-proxy official documentation: https://github.com/DNSCrypt/dnscrypt-proxy/wiki/Configuration
- zapret official documentation: https://github.com/bol-van/zapret?tab=readme-ov-file#nfqws
Use provided zapret-discord-youtube-rules-converter.sh script to fetch and parse rules from
https://github.com/Flowseal/zapret-discord-youtube and edit configs/zapret.conf accordingly
Or you can start the container (by calling start.sh) and use zapret-discord-youtube-rules-converter.sh with test argument to test parsed rules
# Start the container
TZ="Etc/UTC" ./start.sh
# Parse and test ALL rules from <https://github.com/Flowseal/zapret-discord-youtube> using custom URL
TEST_URL="https://rr1---sn-aigzrnld.googlevideo.com/videoplayback" ./zapret-discord-youtube-rules-converter.sh testPORTS="127.0.0.1:2080:2080" TZ="Etc/UTC" ./start.shPlease see comments in the
.envfile for more infoNOTE: To start without -d / --detach arg, use
./start.sh nd/./start.sh nodetachinstead
# 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.logcurl --proxy "127.0.0.1:2080" --head -L https://youtube.comSimply run
./stop.sh rmSpecify
rmargument to this script to remove the container
You can apply new config files without restarting the container. For that, simply run
./reload.shOptionally, to see logs after reload you can run
./reload.sh && tail -f logs/sing-box.log
Simply start the container and run
`./blockcheck.sh`So
./start.sh
# Wait a few seconds
./blockcheck.shOutput will be written into logs/blockcheck.log
To edit domains, add DOMAINS variable to the .env file and run ./build.sh script again
/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=on-failure
RestartSec=5
User=your-user-name
Group=your-user-name
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now zapret-sing-box-docker.service