detached 04a35ad

docs: Enhance README with firewall configuration and port redirection instructions

- Add UFW firewall setup steps for improved security.
- Clarify the creation and location of the gordon.toml configuration file.
- Update port redirection section to focus on iptables and make rules persistent across reboots.
commit
04a35ad7fc5119de54ca33dc80e834695eafee66
author
bamen · · 2025-06-07 08:03 UTC
parent
210f209
signature
unsigned
1 file · +18 -12
M README.md +18 -12
@@ -81,6 +81,14 @@ Containers deploy instantly when you push new images. No manual deployment steps
8181 # Any VPS provider: DigitalOcean, Linode, Vultr, Hetzner
8282 # Ubuntu/Debian recommended
8383
84+# Configure UFW firewall first
85+sudo ufw --force enable
86+sudo ufw default deny incoming
87+sudo ufw default allow outgoing
88+sudo ufw allow 22/tcp
89+sudo ufw allow 80/tcp
90+sudo ufw allow 443/tcp
91+
8492 # Install Podman (more secure than Docker)
8593 sudo apt update
8694 sudo apt install -y podman
@@ -118,7 +126,9 @@ sudo mv gordon-linux-amd64 /usr/local/bin/gordon
118126
119127 ### 3. Create Config
120128 ```toml
121-# gordon.toml
129+# Create gordon.toml in current directory (or use --config flag)
130+# Gordon searches for config in: ./ → ~/.config/gordon/ → ~/.gordon/ → ~/ → /etc/gordon/
131+
122132 [server]
123133 port = 8080
124134 registry_domain = "registry.yourdomain.com"
@@ -134,6 +144,9 @@ password = "your-secure-password"
134144 "app.yourdomain.com" = "myapp:latest"
135145 "api.yourdomain.com" = "api:v1"
136146 "blog.yourdomain.com" = "wordpress:latest"
147+
148+# Custom config file location (optional):
149+# gordon --config /path/to/custom.toml start
137150 ```
138151
139152 ### 4. Point Cloudflare DNS
@@ -176,22 +189,15 @@ sudo loginctl enable-linger $USER
176189 systemctl --user status gordon
177190 ```
178191
179-### 6. Configure Firewall
192+### 6. Redirect Ports 80/443 to 8080
180193 ```bash
181-# Set up port forwarding (choose one option)
182-
183-# Option A: iptables (most common)
194+# Simple iptables redirect
184195 sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
185196 sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080
186197
187-# Make iptables rules persistent
188-sudo apt-get install iptables-persistent
198+# Make rules persistent across reboots
199+sudo apt install -y iptables-persistent
189200 sudo netfilter-persistent save
190-
191-# Option B: UFW with NAT (Ubuntu)
192-sudo ufw allow 22,80,443,8080/tcp
193-echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.conf
194-sudo sysctl -p
195201 ```
196202
197203 ### 7. Deploy Your First App
@@ -81,6 +81,14 @@ Containers deploy instantly when you push new images. No manual deployment steps
81 # Any VPS provider: DigitalOcean, Linode, Vultr, Hetzner81 # Any VPS provider: DigitalOcean, Linode, Vultr, Hetzner
82 # Ubuntu/Debian recommended82 # Ubuntu/Debian recommended
83 83
84+# Configure UFW firewall first
85+sudo ufw --force enable
86+sudo ufw default deny incoming
87+sudo ufw default allow outgoing
88+sudo ufw allow 22/tcp
89+sudo ufw allow 80/tcp
90+sudo ufw allow 443/tcp
91+
84 # Install Podman (more secure than Docker)92 # Install Podman (more secure than Docker)
85 sudo apt update93 sudo apt update
86 sudo apt install -y podman94 sudo apt install -y podman
@@ -118,7 +126,9 @@ sudo mv gordon-linux-amd64 /usr/local/bin/gordon
118 126
119 ### 3. Create Config127 ### 3. Create Config
120 ```toml128 ```toml
121-# gordon.toml129+# Create gordon.toml in current directory (or use --config flag)
130+# Gordon searches for config in: ./ → ~/.config/gordon/ → ~/.gordon/ → ~/ → /etc/gordon/
131+
122 [server]132 [server]
123 port = 8080133 port = 8080
124 registry_domain = "registry.yourdomain.com"134 registry_domain = "registry.yourdomain.com"
@@ -134,6 +144,9 @@ password = "your-secure-password"
134 "app.yourdomain.com" = "myapp:latest"144 "app.yourdomain.com" = "myapp:latest"
135 "api.yourdomain.com" = "api:v1"145 "api.yourdomain.com" = "api:v1"
136 "blog.yourdomain.com" = "wordpress:latest"146 "blog.yourdomain.com" = "wordpress:latest"
147+
148+# Custom config file location (optional):
149+# gordon --config /path/to/custom.toml start
137 ```150 ```
138 151
139 ### 4. Point Cloudflare DNS152 ### 4. Point Cloudflare DNS
@@ -176,22 +189,15 @@ sudo loginctl enable-linger $USER
176 systemctl --user status gordon189 systemctl --user status gordon
177 ```190 ```
178 191
179-### 6. Configure Firewall192+### 6. Redirect Ports 80/443 to 8080
180 ```bash193 ```bash
181-# Set up port forwarding (choose one option)194+# Simple iptables redirect
182-
183-# Option A: iptables (most common)
184 sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080195 sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
185 sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080196 sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080
186 197
187-# Make iptables rules persistent198+# Make rules persistent across reboots
188-sudo apt-get install iptables-persistent199+sudo apt install -y iptables-persistent
189 sudo netfilter-persistent save200 sudo netfilter-persistent save
190-
191-# Option B: UFW with NAT (Ubuntu)
192-sudo ufw allow 22,80,443,8080/tcp
193-echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.conf
194-sudo sysctl -p
195 ```201 ```
196 202
197 ### 7. Deploy Your First App203 ### 7. Deploy Your First App

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close