| … | … | @@ -0,0 +1,84 @@ |
| 1 | # 7rnx-proxy |
| 2 | |
| 3 | Reverse proxy management CLI for the 7rnx.net Apache2 server, over the VPN. |
| 4 | |
| 5 | Keeps a registry of nodes and the services they run, generates the Apache config from it, and |
| 6 | deploys that config to 7rnx.net. Services are reachable at a path prefix under `7rnx.net/`; |
| 7 | hosts get their own subdomain vhost at the URL root, which is what an atproto PDS needs. |
| 8 | |
| 9 | ## Install |
| 10 | |
| 11 | ```sh |
| 12 | npm install -g 7rnx-proxy # provides the `7rnx` command |
| 13 | ``` |
| 14 | |
| 15 | Nodes are addressed by their VPN IP, so the VPN must be up for `deploy` and `status` to reach |
| 16 | 7rnx.net. |
| 17 | |
| 18 | ## Usage |
| 19 | |
| 20 | ```sh |
| 21 | 7rnx node add tabertron --ip 10.0.0.2 |
| 22 | 7rnx service add tabertron git --port 5005 --prefix /git |
| 23 | 7rnx deploy --dry-run # inspect the generated config |
| 24 | 7rnx deploy # write it to 7rnx.net and reload Apache |
| 25 | ``` |
| 26 | |
| 27 | ## Commands |
| 28 | |
| 29 | **Nodes** |
| 30 | |
| 31 | ```sh |
| 32 | 7rnx node add <petname> --ip <vpn-ip> [--keet-ident <key>] |
| 33 | 7rnx node list |
| 34 | 7rnx node remove <petname> |
| 35 | ``` |
| 36 | |
| 37 | **Services** — a port on a node, published at a path prefix |
| 38 | |
| 39 | ```sh |
| 40 | 7rnx service add <node> <name> --port <port> [--prefix <path>] [--root-path <path>] |
| 41 | 7rnx service add-backend <service> --node <petname> --port <port> [--mode active|standby] |
| 42 | 7rnx service remove-backend <service> --node <petname> |
| 43 | 7rnx service list [node] |
| 44 | 7rnx service remove <node> <name> |
| 45 | 7rnx service status [node] # which services are actually listening |
| 46 | ``` |
| 47 | |
| 48 | Multiple backends behind one service is how load balancing is expressed — one `active`, the |
| 49 | rest `standby`. Anything a backend serves from **local disk** only reaches the public URL if it |
| 50 | exists on the *active* backend. |
| 51 | |
| 52 | **Hosts** — a subdomain vhost at the URL root |
| 53 | |
| 54 | ```sh |
| 55 | 7rnx host add <name> <node> --port <port> --server-name <fqdn> |
| 56 | 7rnx host list |
| 57 | 7rnx host remove <name> |
| 58 | ``` |
| 59 | |
| 60 | **Deploy and inspect** |
| 61 | |
| 62 | ```sh |
| 63 | 7rnx deploy [--dry-run] # generate config, push to 7rnx.net, reload Apache |
| 64 | 7rnx status # Apache status on 7rnx.net |
| 65 | 7rnx remote config [path] # fetch the live config (default: the SSL vhost) |
| 66 | 7rnx remote ls # list sites-enabled |
| 67 | 7rnx ui [port] [--network] # dashboard, default port 7777 |
| 68 | ``` |
| 69 | |
| 70 | ## Registry |
| 71 | |
| 72 | State lives in `~/.config/7rnx-proxy/registry.json` — the single source the generated Apache |
| 73 | config is derived from, and the file to read when you need to know which backend is currently |
| 74 | active. Edit through the CLI rather than by hand, then `7rnx deploy --dry-run` to see what it |
| 75 | would produce. |
| 76 | |
| 77 | ```sh |
| 78 | 7rnx config # show the registry |
| 79 | 7rnx config set-server --host <ip> --user <user> |
| 80 | ``` |
| 81 | |
| 82 | ## License |
| 83 | |
| 84 | Not yet declared. |