detached 3cd0f9c

docs: warn when adding attachments without network isolation

Attachments require network_isolation.enabled = true because Docker's
default bridge network does not provide DNS resolution between containers.
Without it, apps cannot reach attachments by hostname (e.g., postgres:5432).

Changes:
- CLI warns when adding attachment locally without network isolation
- Updated docs/config/attachments.md with Requirements section
- Updated docs/cli/attachments.md with Requirements section
- Updated CLI help text for 'attachments add' command
commit
3cd0f9c74814f9573b54268b78d127a4dd12f874
author
brice · · 2026-01-17 15:46 UTC
parent
a43bd67
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +33 -1
M docs/cli/attachments.md +6 -0
@@ -2,6 +2,12 @@
22
33 Manage attachments on local or remote Gordon instances.
44
5+## Requirements
6+
7+Attachments require `network_isolation.enabled = true` in your configuration. Without network isolation, containers use Docker's default bridge network which does not provide DNS resolution - your app won't be able to reach attachments by hostname (e.g., `postgres:5432`).
8+
9+The CLI will warn you if you try to add an attachment without network isolation enabled.
10+
511 ## gordon attachments
612
713 ### Subcommands
@@ -2,6 +2,12 @@
2 2
3 Manage attachments on local or remote Gordon instances.3 Manage attachments on local or remote Gordon instances.
4 4
5+## Requirements
6+
7+Attachments require `network_isolation.enabled = true` in your configuration. Without network isolation, containers use Docker's default bridge network which does not provide DNS resolution - your app won't be able to reach attachments by hostname (e.g., `postgres:5432`).
8+
9+The CLI will warn you if you try to add an attachment without network isolation enabled.
10+
5 ## gordon attachments11 ## gordon attachments
6 12
7 ### Subcommands13 ### Subcommands
M docs/config/attachments.md +11 -0
@@ -2,6 +2,17 @@
22
33 Attach service dependencies (databases, caches, queues) to your applications.
44
5+## Requirements
6+
7+**Network isolation must be enabled** for attachments to work properly:
8+
9+```toml
10+[network_isolation]
11+enabled = true
12+```
13+
14+Without network isolation, containers run on Docker's default bridge network which **does not provide DNS resolution**. Your application won't be able to reach attachments by hostname (e.g., `postgres:5432`).
15+
516 ## Configuration
617
718 ```toml
@@ -2,6 +2,17 @@
2 2
3 Attach service dependencies (databases, caches, queues) to your applications.3 Attach service dependencies (databases, caches, queues) to your applications.
4 4
5+## Requirements
6+
7+**Network isolation must be enabled** for attachments to work properly:
8+
9+```toml
10+[network_isolation]
11+enabled = true
12+```
13+
14+Without network isolation, containers run on Docker's default bridge network which **does not provide DNS resolution**. Your application won't be able to reach attachments by hostname (e.g., `postgres:5432`).
15+
5 ## Configuration16 ## Configuration
6 17
7 ```toml18 ```toml
M internal/adapters/in/cli/attachments.go +16 -1
@@ -180,8 +180,13 @@ func newAttachmentsAddCmd() *cobra.Command {
180180 Short: "Add an attachment",
181181 Long: `Add a container attachment to a domain or network group.
182182
183+Note: Attachments require network_isolation.enabled = true in your configuration.
184+Without network isolation, containers use Docker's default bridge network which
185+does not provide DNS resolution - your app won't be able to reach attachments
186+by hostname (e.g., 'postgres:5432').
187+
183188 Examples:
184- gordon attachments add app.example.com postgres:15
189+ gordon attachments add app.example.com postgres:18
185190 gordon attachments add backend redis:7-alpine
186191 gordon --remote https://gordon.mydomain.com attachments add api.mydomain.com memcached:latest`,
187192 Args: cobra.ExactArgs(2),
@@ -200,6 +205,16 @@ Examples:
200205 if err != nil {
201206 return fmt.Errorf("failed to initialize local services: %w", err)
202207 }
208+
209+ // Warn if network isolation is disabled
210+ if !local.GetConfigService().IsNetworkIsolationEnabled() {
211+ fmt.Println(styles.RenderWarning("network_isolation.enabled = false"))
212+ fmt.Println(styles.Theme.Muted.Render(" Attachments require network isolation for DNS resolution."))
213+ fmt.Println(styles.Theme.Muted.Render(" Without it, your app cannot reach attachments by hostname."))
214+ fmt.Println(styles.Theme.Muted.Render(" Enable with: [network_isolation] enabled = true"))
215+ fmt.Println()
216+ }
217+
203218 if err := local.GetConfigService().AddAttachment(ctx, target, image); err != nil {
204219 return fmt.Errorf("failed to add attachment: %w", err)
205220 }
@@ -180,8 +180,13 @@ func newAttachmentsAddCmd() *cobra.Command {
180 Short: "Add an attachment",180 Short: "Add an attachment",
181 Long: `Add a container attachment to a domain or network group.181 Long: `Add a container attachment to a domain or network group.
182 182
183+Note: Attachments require network_isolation.enabled = true in your configuration.
184+Without network isolation, containers use Docker's default bridge network which
185+does not provide DNS resolution - your app won't be able to reach attachments
186+by hostname (e.g., 'postgres:5432').
187+
183 Examples:188 Examples:
184- gordon attachments add app.example.com postgres:15189+ gordon attachments add app.example.com postgres:18
185 gordon attachments add backend redis:7-alpine190 gordon attachments add backend redis:7-alpine
186 gordon --remote https://gordon.mydomain.com attachments add api.mydomain.com memcached:latest`,191 gordon --remote https://gordon.mydomain.com attachments add api.mydomain.com memcached:latest`,
187 Args: cobra.ExactArgs(2),192 Args: cobra.ExactArgs(2),
@@ -200,6 +205,16 @@ Examples:
200 if err != nil {205 if err != nil {
201 return fmt.Errorf("failed to initialize local services: %w", err)206 return fmt.Errorf("failed to initialize local services: %w", err)
202 }207 }
208+
209+ // Warn if network isolation is disabled
210+ if !local.GetConfigService().IsNetworkIsolationEnabled() {
211+ fmt.Println(styles.RenderWarning("network_isolation.enabled = false"))
212+ fmt.Println(styles.Theme.Muted.Render(" Attachments require network isolation for DNS resolution."))
213+ fmt.Println(styles.Theme.Muted.Render(" Without it, your app cannot reach attachments by hostname."))
214+ fmt.Println(styles.Theme.Muted.Render(" Enable with: [network_isolation] enabled = true"))
215+ fmt.Println()
216+ }
217+
203 if err := local.GetConfigService().AddAttachment(ctx, target, image); err != nil {218 if err := local.GetConfigService().AddAttachment(ctx, target, image); err != nil {
204 return fmt.Errorf("failed to add attachment: %w", err)219 return fmt.Errorf("failed to add attachment: %w", err)
205 }220 }

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