mirror of
https://github.com/tiennm99/composes.git
synced 2026-10-11 03:13:16 +00:00
fix: show the container hostname in the shell prompt
Coolify injects HOST=0.0.0.0 into every compose app, and zsh seeds $HOST and the %m/%M prompt escapes from that variable rather than calling gethostname(). The prompt read "0", the first dot-separated field of 0.0.0.0, even though the container hostname itself was set correctly. Pass the hostname in as HOST alongside the hostname: key, both from a single SERVICE_HOSTNAME variable. Neither service reads HOST itself -- code-server binds [::]:8443, Paseo binds PASEO_LISTEN -- so this only affects the prompt. Not named HOSTNAME: Compose interpolation lets the deploying shell's environment win over the .env file, and HOSTNAME is set in every container, including the one Coolify runs in. PASEO_LABEL is renamed to SERVICE_HOSTNAME; it was never a Paseo variable. The example git identity is blanked out along with it.
This commit is contained in:
1 parent
f02de334e5
commit
2a4e635e09
6 files changed
+48
-7
No files matched your search
+18
-1
@@ -39,11 +39,28 @@ the old entry is cached in `localStorage`.
|
||||
| `PASEO_HOSTNAMES` | Domains allowed to reach the daemon, comma-separated. Your domain must be listed. |
|
||||
| `PASEO_TRUSTED_PROXIES` | Set to `uniquelocal`, or the UI loads but never connects. |
|
||||
| `AGENT_CLIS` | Agent CLIs to install on start if missing, space- or comma-separated. Empty installs none. See [Agents](#agents). |
|
||||
| `PASEO_LABEL` | Container hostname, shown as the host label in the UI. Without it the label is a random container ID. |
|
||||
| `SERVICE_HOSTNAME` | Container hostname, shown as the host label in the UI and in the shell prompt. Without it the label is a random container ID. |
|
||||
| `GIT_NAME` / `GIT_EMAIL` | Git author and committer identity for agents and terminals. |
|
||||
| `TZ` | Timezone for logs and agent shells. |
|
||||
| `SHELL` | Shell for Paseo's terminals. Paseo reads `$SHELL` and falls back to `/bin/sh`, ignoring the login shell, so `chsh` has no effect. |
|
||||
|
||||
`SERVICE_HOSTNAME` is used twice: as the container's `hostname:` and as the
|
||||
`HOST` variable inside it. Coolify injects `HOST=0.0.0.0` into every compose
|
||||
app, and zsh seeds `$HOST` and the `%m`/`%M` prompt escapes from that variable
|
||||
rather than calling `gethostname()` -- so the prompt reads `0`, the first
|
||||
dot-separated field of `0.0.0.0`. Paseo itself never reads `HOST` -- it binds
|
||||
`PASEO_LISTEN` -- so overriding it only affects the prompt. bash is
|
||||
unaffected; its `\h` uses the real hostname.
|
||||
|
||||
It is not called `HOSTNAME`, the obvious name, because Compose interpolation
|
||||
lets the deploying shell's environment win over the `.env` file, and `HOSTNAME`
|
||||
is set in every container -- including the one Coolify itself runs in. The
|
||||
container would silently take Coolify's hostname instead of this value.
|
||||
|
||||
`PASEO_LABEL` was this variable's old name. It was never a Paseo variable,
|
||||
only ours -- the daemon reads none of `PASEO_LABEL`, `SERVICE_HOSTNAME` or
|
||||
`HOST`, and takes the host label from the container hostname.
|
||||
|
||||
`PASEO_TRUSTED_PROXIES` matches the proxy's *source IP*, so hostnames are
|
||||
rejected. The daemon trusts `X-Forwarded-Proto` from loopback only, but
|
||||
Coolify's Traefik reaches it from the Docker bridge network — so it reads the
|
||||
|
||||
Reference in new issue
Block a user