@@ -13,8 +13,8 @@ It brings HA, PITR, monitoring, infrastructure as code (IaC), and rich extension
1313pig sty - Init (Download), Bootstrap, Configure, and Deploy Pigsty
1414
1515 pig sty init [-mpfvd] # install pigsty (~/pigsty by default)
16- pig sty boot [-rmpk] # install ansible and prepare offline pkg
17- pig sty conf [-cvmrsoxnpg --raw] # configure pigsty and generate config
16+ pig sty boot [-rmpk] # native controller bootstrap
17+ pig sty conf [mode] [flags] # native Inventory-aware configuration
1818 pig sty deploy # use pigsty to deploy everything (CAUTION!)
1919 pig sty get # download pigsty source tarball
2020 pig sty list # list available pigsty versions
@@ -30,15 +30,17 @@ Examples:
3030| Command | Description | Notes |
3131| :---| :---| :---|
3232| ` sty init ` | Install Pigsty | |
33- | ` sty boot ` | Install Ansible prerequisites | Requires sudo or root |
34- | ` sty conf ` | Generate configuration | |
33+ | ` sty boot ` | Bootstrap the Pigsty controller | Requires root |
34+ | ` sty conf ` | Generate and validate Inventory | Native Go workflow |
3535| ` sty deploy ` | Run deployment playbook | |
3636| ` sty list ` | List available Pigsty versions | |
3737| ` sty get ` | Download Pigsty source tarball | |
3838| ` sty grafana ` | Manage Grafana dashboards (alias ` gf ` ) | New in v1.6.0 |
3939{.full-width}
4040
41- > Since v1.6.0, the former ` pig sty edit ` / ` validate ` / ` check ` commands moved to the
41+ > Since v1.8.0, ` pig sty boot ` and ` pig sty conf ` are native Go workflows. They no longer
42+ > invoke Pigsty's legacy ` bootstrap ` or ` configure ` shell scripts. Since v1.6.0, the former
43+ > ` pig sty edit ` / ` validate ` / ` check ` commands moved to the
4244> root-level [ ` pig inventory ` ] ( /inventory/ ) command group, and the experimental
4345> ` pig sty dashboard ` was replaced by ` pig sty grafana ` .
4446
@@ -47,14 +49,17 @@ Examples:
4749Use ` pig sty ` to bootstrap and deploy Pigsty on the current node.
4850
4951``` bash
50- pig sty init # install Pigsty to ~/pigsty
51- pig sty boot # install Ansible prerequisites
52- pig sty conf # generate configuration
52+ sudo pig sty boot # prepare the controller and ~/pigsty
53+ pig sty conf -g # generate and validate pigsty.yml
54+ pig inventory edit # optional: review and adjust the Inventory
5355pig sty deploy # run deployment playbook
5456```
5557
5658See the detailed setup guide: < https://pigsty.io/docs/setup/install/ >
5759
60+ ` sty boot ` initializes a missing default ` ~/pigsty ` tree on a best-effort basis. Use
61+ ` pig sty init ` first when you need to select an explicit Pigsty version or installation path.
62+
5863## sty init
5964
6065Download and install the Pigsty distribution into ` ~/pigsty ` .
@@ -78,58 +83,96 @@ pig sty init 3 # fetch and install latest v3 major version
7883
7984## sty boot
8085
81- Install Ansible and its dependencies.
86+ Bootstrap the Pigsty controller with the native Go workflow. The command requires root,
87+ prepares a usable Ansible environment, supports online and offline repositories, repairs
88+ common controller prerequisites, and reports a structured result. It never delegates to
89+ Pigsty's legacy ` bootstrap ` script.
8290
8391``` bash
84- pig sty boot # install Ansible
85- pig sty boot -r china # use China region mirror
86- pig sty boot -m # equivalent to --region china
87- pig sty boot -k # keep existing repositories
88- pig sty boot -p /path/to/pkg # selected offline package path
92+ sudo pig sty boot # online bootstrap with the default region
93+ sudo pig sty boot -r china # use China-region repositories
94+ sudo pig sty boot -m # equivalent to --region china
95+ sudo pig sty boot -k # preserve existing repository definitions
96+ sudo pig sty boot -p /path/to/pkg.tgz # use an explicit offline package
97+ sudo pig sty boot -p https://host/pkg.tgz # download and use an offline package
98+ sudo pig sty boot -o json # machine-readable result and warnings
8999```
90100
101+ The native bootstrap performs these stages:
102+
103+ 1 . On Debian 12/13, check and repair ` en_US.UTF-8 ` when possible so Ansible can start.
104+ 2 . Verify ` ansible-playbook ` and its Python dependencies instead of checking only the binary.
105+ 3 . Reuse a committed ` /www/pigsty ` repository, consume an explicit package or URL, accept a
106+ trusted automatic ` /tmp/pkg.tgz ` , or configure the selected online repositories.
107+ 4 . Install the controller package set when Ansible is missing or unusable. Explicit offline
108+ input is still prepared when Ansible is already installed.
109+ 5 . Unless ` --keep ` is set, back up repository definitions before replacement and restore them
110+ automatically when local or online package setup fails.
111+ 6 . Best-effort repair key-based localhost SSH and initialize a missing default ` ~/pigsty ` tree.
112+ These final convenience checks produce warnings rather than turning a usable controller into
113+ a false bootstrap failure.
114+
91115** Options:**
92116
93117- ` -r|--region ` : region, such as default, china, europe
94118- ` -m|--mirror ` : equivalent to ` --region china `
95- - ` -p|--path ` : offline package path
96- - ` -k|--keep ` : keep existing repositories
119+ - ` -p|--path ` : offline package file or HTTP(S) URL; an invalid explicit source is a hard error
120+ - ` -k|--keep ` : preserve existing repositories instead of replacing them
121+
122+ An automatically discovered ` /tmp/pkg.tgz ` must be a regular, non-group/world-writable file
123+ owned by root or the invoking sudo user. Unsafe automatic candidates are ignored with a warning.
124+ Use ` -o json ` or ` -o yaml ` to consume bootstrap mode, repository policy, rollback state, locale,
125+ SSH, Pigsty initialization status, warnings, and recommended next commands without scraping text.
97126
98127See: < https://pigsty.io/docs/setup/offline/#bootstrap >
99128
100129## sty conf
101130
102- Configure Pigsty with ` ./configure ` and generate the configuration file.
131+ Generate Pigsty Inventory through the native Go workflow. ` sty conf ` reads one template below
132+ ` <PIGSTY_HOME>/conf ` , applies bounded structural mutations, validates the complete candidate,
133+ and atomically writes an owner-only Inventory. It does not invoke or fall back to ` ./configure ` .
103134
104135``` bash
105- pig sty conf # use default meta.yml config
106- pig sty conf -g # generate random passwords (recommended!)
107- pig sty conf -c rich # use conf/rich.yml template with more extensions
108- pig sty conf -c ha/full # use conf/ha/full.yml 4-node HA template
109- pig sty conf -c slim # use conf/slim.yml minimal template
110- pig sty conf -c supabase # use conf/supabase.yml self-hosting template
111- pig sty conf -v 18 -c rich # use conf/rich.yml template with PostgreSQL 18
112- pig sty conf -r china -s # use China mirror and skip IP probing
113- pig sty conf -m -s # use mirror mode and skip IP probing
114- pig sty conf -x # write proxy settings from environment variables
115- pig sty conf -c full -g -O ha.yml # full HA template, random passwords, output to ha.yml
116- pig sty conf --raw # use legacy shell configure workflow
136+ pig sty conf # use conf/meta.yml and write pigsty.yml
137+ pig sty conf -g # generate random passwords (recommended)
138+ pig sty conf rich # positional mode selects conf/rich.yml
139+ pig sty conf -c ha/full # equivalent flag form; do not combine both forms
140+ pig sty conf ha/trio --ip 10.0.0.10,10.0.0.11,10.0.0.12
141+ pig sty conf --domain infra.example.com
142+ pig sty conf rich -v 18 # request PostgreSQL 18 for a generic template
143+ pig sty conf -r china -s # China region, placeholder IP, no admin preflight
144+ pig sty conf -x # materialize proxy environment variables
145+ pig sty conf full -g -O ha.yml # custom owner-only output file
146+ pig sty conf -n --ip 10.0.0.10 -o json
117147```
118148
119149** Options:**
120150
121- - ` -c|--conf ` : configuration template name, such as meta/rich/slim/full/supabase
122- - ` --ip ` : primary node IP address
151+ - ` -c|--conf ` : template mode, equivalent to positional ` [mode] ` ; the two forms are exclusive
152+ - ` --ip ` : up to ten distinct comma-separated IPv4 addresses
153+ - ` --domain ` : replace the exact ` i.pigsty ` placeholder domain
123154- ` -v|--version ` : PostgreSQL major version, 18/17/16/15/14; 19 beta can be specified explicitly
124155- ` -r|--region ` : upstream repository region, such as default/china/europe
125156- ` -m|--mirror ` : equivalent to ` --region china `
126157- ` -O|--output-file ` : output config file path, default ` pigsty.yml `
127- - ` -s|--skip ` : use a placeholder IP and skip the admin SSH/sudo preflight
158+ - ` -s|--skip ` : keep the placeholder IP and skip admin SSH/sudo preflight; exclusive with ` --ip `
128159- ` -p|--port ` : SSH port
129- - ` -x|--proxy ` : write proxy settings from environment variables
130- - ` -n|--non-interactive ` : non-interactive mode
131- - ` -g|--generate ` : generate random default passwords, recommended
132- - ` --raw ` : use the legacy shell configure workflow (generated passwords remain visible)
160+ - ` -x|--proxy ` : write non-empty proxy environment variables into ` all.vars.proxy_env `
161+ - ` -n|--non-interactive ` : refuse ambiguous IP selection instead of prompting
162+ - ` -g|--generate ` : replace known demo credentials with random 24-character values
163+
164+ ` --ip ` maps addresses in order to the template slots ` 10.10.10.10 ` through
165+ ` 10.10.10.19 ` ; replacement is simultaneous, and unrelated addresses such as VIPs remain intact.
166+ Without ` --ip ` , interactive mode lists detected interfaces for selection; non-interactive or
167+ closed-input execution fails with guidance to specify an address. ` --domain ` only replaces the
168+ exact ` i.pigsty ` token, not names such as ` cli.pigsty ` or ` i.pigsty.cc ` .
169+
170+ Template modes are safe relative paths below ` conf ` ; absolute paths, traversal, and path escape
171+ are rejected. Output cannot alias the source template through a direct path, symlink, symlinked
172+ parent, or hard link. The rendered Inventory is validated before the atomic ` 0600 ` write, so a
173+ parse, mutation, preflight, or validation failure does not replace the destination. Structured
174+ output reports applied IP mappings, effective PostgreSQL version, generated secret identifiers,
175+ and warnings, but never generated secret values.
133176
134177See: < https://pigsty.io/docs/setup/install/#configure >
135178
0 commit comments