Skip to main content

proxy-deploy

PyPI - Version Python Versions License: MIT

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.toml act as the single source of truth (Infrastructure as Code)
  • ๐Ÿ” Credential persistence: the state file secrets.json makes 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 blind curl | bash executions)
  • ๐Ÿ”— 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)

  1. Configure an SSH alias in ~/.ssh/config for key-based login.
  2. proxy-deploy bootstrap -H <alias> โ€” provision the bare-metal server (once per server; omit -H when running on the server itself).
  3. Copy config/nodes.example.toml to nodes.toml and declare your nodes.
  4. proxy-deploy generate-all -m nodes.toml โ€” generate configs and state.
  5. Open the node ports in BOTH firewalls: the cloud provider's security list AND system iptables (SS2022 needs both TCP and UDP).
  6. proxy-deploy deploy config/config.json -H <alias> โ€” deploy.
  7. proxy-deploy doctor -H <alias> โ€” verify deployment health.
  8. 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

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

proxy_deploy-1.0.0.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

proxy_deploy-1.0.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

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

Hashes for proxy_deploy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 441b67e0bedeceef70d802643cefead822f1ed43823cdbe201d1baf94dd89297
MD5 bd54f7201cc84c3afd898129cf6d7e4b
BLAKE2b-256 5eb717491b999e6b43c99ea2a20b7e222542c8358807ee2cc288dec8cb019a78

See more details on using hashes here.

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

Hashes for proxy_deploy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab82c85b71cd2868b0bd949fe9ed42f48bbc3dd1cf175686761bb8b3dbe1ccb1
MD5 97099672e46c630ec63ebcff3f9885f7
BLAKE2b-256 f2df0eb0ace65cfd286a628cb87f73e804409e3caf38f7094b1eecddd08e4844

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page