sonaive is the NaïveProxy frontend of a small set of Docker containers that offers easy 5-minute setups and braindead configurations for NaïveProxy. It terminates TLS, serves the proxy, and forwards everything else to a decoy site and an upstream filtering proxy.
- A clean, simple deployment built using Caddy w/ forwardproxy@naïve.
- Automatic certificate management.
- Blocks CN traffic and ADs using HaGeZi Pro(++), TIF and Spam TLDs, via the bundled
filtercontainer. - An optional decoy site served by a separate container using reputable sources.
- Automatic QR code and link generation for popular APPs, printed to the container log.
- Automatic weekly builds.
- You can start with the example
docker-compose.ymlfrom this repo. - Adjust environment variables:
HOST: the hostname of the server.REQUIRED.PORT: the public port you expose. The container internally always use port 443 for NaïveProxy and 80 for ACME challenges. To change the NaïveProxy port, map a different host port to 443 and setPORTto the same value. Port 80 must be identity mapped for certificate generation.Optional, default = 443.SITE_URL: address of the decoy site backend, e.g.decoy:3000. When unset, all non-proxied requests receive a403response.Optional, default = "".UPSTREAM_URL: upstream http proxy address the proxy chain forwards to, e.g.filter:1080. When unset, requests are dialed directly.Optional, default = "".USERX: an arbitrary number of usernames starting from X=0, see thedocker-compose.ymlfor examples.REQUIRED: at least one user..PASSX: the corresponding password for USERX.REQUIRED: one per user.LOG_LEVEL: the verbosity of logging, one ofinfo,warn,error,debug,panicandfatal.Optional, default = warn.SELF_SIGN: use Caddy's internal CA and a self signed certificate instead of ACME. Only the literaltrueandfalseare recognized.Optional, default = false.
docker compose up -d- Check the container log using
docker logsfor per user shareable links and QR codes for v2rayN and shadowrocket. - Visit your server in the browser to see your decoy site (or a
403ifSITE_URLis unset), and test your NaïveProxy connections.
Bind mount a local folder to /opt/sonaive/data to persist settings and certificates across container reboots. Make sure the local folder is owned by or accessible to uid 1000 and gid 1000.
sonaive stores Caddy's generated configuration, data and certificates under caddy.
It also writes per-user link.txt and qrcode.png files under /opt/sonaive/users, which is outside the persisted volume. The same links and QR codes are printed to the container log on every start.
docker compose downdocker compose pulldocker compose up -d
- It may take a while to generate the certificates when running for the first time. Follow
docker logsfor more details. - If you need to turn on QUIC/HTTP3 support, simply expose UDP for the same TCP NaïveProxy port.
- Use
docker logsto debug Caddy startup failures, and the logs of thefilteranddecoycontainers for their own. - If you receive a warning about
"failed to sufficiently increase receive buffer size", you can simply ignore the warning if you do not use QUIC/HTTP3. Otherwise follow the instructions here. Note that these options must be set on HOST. You can use/etc/sysctl.confto persist the settings across reboots. - If you have trouble visiting certain sites and are sure the client is configured correctly, try relaxing
BLOCK_ADSon thefiltercontainer. DisablingBLOCK_CNis not recommended as it might leak VPS's IPs.