Skip to content

Commit 57c89cb

Browse files
committed
add ndoe_firewall param placeholder in vibe.yml config
1 parent d73a35c commit 57c89cb

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

conf/ha/simu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ all:
342342
retention_full_type: time # retention full backup by time on minio repo
343343
retention_full: 14 # keep full backup for last 14 days
344344
pg_crontab: # make a full backup on monday 1am, and an incremental backup during weekdays
345-
- '00 01 * * 1 /pg/bin/pg-backup'
346-
- '00 05 * * * /pg/bin/pg-vaccum'
345+
- '00 01 * * * /pg/bin/pg-backup'
346+
- '00 05 * * * /pg/bin/pg-vacuum'
347347
pg_hba_rules: # https://pigsty.io/docs/pgsql/config/hba
348348
- { user: all ,db: all ,addr: intra ,auth: pwd ,title: 'everyone intranet access with password' ,order: 800 }
349349

conf/vibe.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# File : vibe.yml
44
# Desc : Pigsty ai vibe coding sandbox
55
# Ctime : 2026-01-19
6-
# Mtime : 2026-01-27
6+
# Mtime : 2026-01-30
77
# Docs : https://pigsty.io/docs/conf/vibe
88
# License : Apache-2.0 @ https://pigsty.io/docs/about/license/
99
# Copyright : 2018-2026 Ruohang Feng / Vonng (rh@vonng.com)
@@ -41,10 +41,10 @@ all:
4141
region: default # upstream mirror region: default,china,europe
4242
infra_portal: # infra services exposed via portal
4343
home : { domain: i.pigsty } # default domain name
44-
dns_enabled: false # disable dns service
44+
dns_enabled: false # disable dns service
4545
vtrace_enabled: false # enable vtrace extension
46-
#blackbox_enabled: false # disable blackbox exporter
47-
#alertmanager_enabled: false # disable alertmanager
46+
#blackbox_enabled: false # disable blackbox exporter
47+
#alertmanager_enabled: false # disable alertmanager
4848
infra_extra_services: # home page navigation entries
4949
- { name: Code Server ,url: '/code' ,desc: 'VS Code Server' ,icon: 'code' }
5050
- { name: Jupyter ,url: '/jupyter' ,desc: 'Jupyter Notebook' ,icon: 'jupyter' }
@@ -59,6 +59,8 @@ all:
5959
node_repo_modules: node,infra,pgsql # add these repos directly to the singleton node
6060
node_packages: [ openssh-server, juicefs, restic, rclone, uv, opencode, claude, code-server, golang, asciinema, genai-toolbox, postgrest ]
6161
docker_enabled: true # enable docker service
62+
node_firewall_mode: none # change to 'zone' to enable firewall
63+
node_firewall_public_port: [22, 80, 443, 5432] # add custom public ports
6264
#docker_registry_mirrors: ["https://docker.1panel.live","https://docker.1ms.run","https://docker.xuanyuan.me","https://registry-1.docker.io"]
6365

6466
#----------------------------------------------#

roles/node/README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ node (full role)
124124

125125
### Security
126126

127-
| Variable | Default | Description |
128-
|----------------------|---------|-------------------------------------------------|
129-
| `node_selinux_mode` | `enum` | set selinux mode: enforcing,permissive,disabled |
127+
| Variable | Default | Description |
128+
|----------------------|---------|-------------------------------------------------------------------|
129+
| `node_selinux_mode` | `enum` | set selinux mode: enforcing,permissive,disabled |
130130
| `node_firewall_mode` | `enum` | firewall mode: none (skip), off (disable), zone (enable & config) |
131131

132132

@@ -230,6 +230,7 @@ For production environments, review and adjust the following:
230230
```yaml
231231
node_admin_sudo: limit # Limited sudo commands without password
232232
node_selinux_mode: enforcing # Full SELinux enforcement
233+
node_firewall_mode: zone # trust intranet, expose 22 80 443 only
233234
node_firewall_public_port: [22, 80, 443] # Remove 5432 from public
234235
vip_auth_pass: '<strong-secret>' # Explicit VRRP authentication
235236
```
@@ -239,6 +240,21 @@ for cluster operations. This is necessary for ansible but allows potential MITM
239240
Ensure your network is trusted or use a bastion host.
240241

241242

243+
## Firewall Management
244+
245+
Enable firewall with `node_firewall_mode: zone`, then apply: `./node.yml -l <target> -t node_firewall`
246+
247+
> **Note**: Firewall rules are **additive only**. To remove rules, use manual commands:
248+
249+
```bash
250+
# RHEL/Rocky (firewalld)
251+
firewall-cmd --zone=public --remove-port=5432/tcp && firewall-cmd --runtime-to-permanent
252+
253+
# Debian/Ubuntu (ufw)
254+
ufw delete allow 5432/tcp
255+
```
256+
257+
242258
## See Also
243259

244260
- [`node_id`](../node_id): Node identity derivation

0 commit comments

Comments
 (0)