proxy-deploy
My own proxy deployment and management system, established from scratch. Based on sing-box core, and config management/generation is realized by Python.
Features
- ๐งพ Declarative manifest:
nodes.tomlact as the single source of truth (Infrastructure as Code) - ๐ Credential persistence: the state file
secrets.jsonmakes re-running idempotent, retains previous credentials - ๐งฉ Multi-protocol: VLESS+REALITY and Shadowsocks 2022 (supports extension in the future)
- ๐ One-command deploy: SSH deploy from local or "self-deploy" on the server, along with validation and survival checking
- ๐ฉบ
doctor: Post-deployment automated diagnostics (connectivity, service status, ports, REALITY handshake events, clock skew, and binary versions) - ๐ฅพ
bootstrap: One-click bare-metal installation (featuring version locking + SHA256 checksums, avoiding blindcurl | bashexecutions) - ๐ Generates sharing links and QR codes compatible with V2RayN, Shadowrocket, etc.
- โ Covered by 24 rigorous pytest cases ensuring pipeline stability
Installation
Requires Python 3.12+. With uv (recommended):
uv tool install proxy-deploy
Or with pipx: pipx install proxy-deploy
Or run without installing: uvx proxy-deploy --help
Enable shell completion (commands, options, file paths, and SSH hosts from ~/.ssh/config):
proxy-deploy --install-completion # then restart your shell
Usage (from scratch)
- Configure an SSH alias in
~/.ssh/configfor key-based login. proxy-deploy bootstrap -H <alias>โ provision the bare-metal server (once per server; omit-Hwhen running on the server itself).- Copy
config/nodes.example.tomltonodes.tomland declare your nodes. proxy-deploy generate-all -m nodes.tomlโ generate configs and state.- Open the node ports in BOTH firewalls: the cloud provider's security list AND system iptables (SS2022 needs both TCP and UDP).
proxy-deploy deploy config/config.json -H <alias>โ deploy.proxy-deploy doctor -H <alias>โ verify deployment health.- Import the printed share links / QR codes into your client.
Commands
| Command | Purpose |
|---|---|
generate-all |
Generate multi-node configs from the manifest (stateful, stable credentials) |
generate |
Generate a stateless, one-off node (quick demos / temporary use) |
deploy |
Deploy a config (locally, or remotely via SSH with -H) |
list |
List nodes currently running on a server |
doctor |
Run post-deployment diagnostics (locally or over SSH) |
bootstrap |
Install sing-box + systemd service on a fresh server (locally or over SSH) |
Topologies
Every management command works in two modes:
- Remote (
-H <alias>): run from a management machine (e.g. your laptop), operating the server over SSH/SCP. - Local (omit
-H): run on the server itself ("self-deploy") โ only Linux + sudo needed, no SSH setup.
Local-mode note: doctor skips TCP-reachability and clock-skew checks (meaningful only from a second machine).
Credential & state model
Intent (nodes.toml, human-written) + State (secrets.json, machine-written, gitignored) โ Resolved Credentials.
- Precedence: Explicitly defined in manifest > State file > Freshly generated.
- Deleting a node from the manifest equals taking it offline.
- Changing a port instantiates a completely new node.
Development
git clone https://github.com/koufodakoufo/proxy-deploy
cd proxy-deploy
uv sync # install env incl. dev dependencies
uv run pytest -v # 27 test cases
uvx ruff check src tests # lint
Architecture
proxy-deploy/
โโโ pyproject.toml # Project metadata, dependencies, and build config
โโโ uv.lock # Locked dependencies
โโโ .python-version # Python 3.12
โโโ .gitignore / README.md
โ
โโโ src/proxy_deploy/ # Python package (distribution name: proxy-deploy)
โ โโโ __init__.py
โ โโโ cli.py # ๐ฎ CLI entry point
โ โโโ manifest.py # ๐งพ Manifest model: loading, validation, credential resolution
โ โโโ state.py # ๐ State file I/O (secrets.json)
โ โโโ credentials.py # ๐ Credential generation (UUID / X25519 / short_id / SS2022 keys)
โ โโโ config_builder.py # ๐๏ธ config.json builder (protocol dispatching)
โ โโโ share_link.py # ๐ vless:// and ss:// link generators
โ โโโ qr_code.py # ๐ท QR code generator
โ โโโ deploy.py # ๐ SSH deployment and remote config fetching
โ โโโ doctor.py # ๐ฉบ Post-deployment diagnostics
โ โโโ bootstrap.py # ๐ฅพ Bare-metal installer
โ
โโโ tests/ # pytest test suite
โโโ config/ # nodes.toml (manifest), secrets.json (gitignored), templates
โโโ docs/ # Personal documentation and references
โโโ scripts/ # Auxiliary scripts (reserved)
โโโ bin/ # Local sing-box binaries (gitignored)
โโโ downloads/ # Download cache (gitignored)
Credits
- sing-box - the core this tool deploys and manages.
- Xray-core - reference implementation of VLESS/REALITY.
- Inspired by Alvin9999-newpac/fanqiang.
- Kimi K3 and Deepseek V4.
License
MIT License โ see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file proxy_deploy-1.0.0.tar.gz.
File metadata
- Download URL: proxy_deploy-1.0.0.tar.gz
- Upload date:
- Size: 56.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
441b67e0bedeceef70d802643cefead822f1ed43823cdbe201d1baf94dd89297
|
|
| MD5 |
bd54f7201cc84c3afd898129cf6d7e4b
|
|
| BLAKE2b-256 |
5eb717491b999e6b43c99ea2a20b7e222542c8358807ee2cc288dec8cb019a78
|
File details
Details for the file proxy_deploy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: proxy_deploy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab82c85b71cd2868b0bd949fe9ed42f48bbc3dd1cf175686761bb8b3dbe1ccb1
|
|
| MD5 |
97099672e46c630ec63ebcff3f9885f7
|
|
| BLAKE2b-256 |
f2df0eb0ace65cfd286a628cb87f73e804409e3caf38f7094b1eecddd08e4844
|