dokku-compose 0.11.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +53 -6
  2. package/dist/index.js +773 -130
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -101,9 +101,43 @@ Running `up` again produces no changes — every step checks current state befor
101
101
  | `--dry-run` | Print commands without executing |
102
102
  | `--sensitive` | Show sensitive values in output (masked by default) |
103
103
  | `--fail-fast` | Stop on first error (default: continue to next app) |
104
+ | `--prune` | `up` only: also reset settings the file no longer declares (read `diff` first) |
104
105
  | `--remove-orphans` | Destroy services and networks not in config |
105
106
  | `--verbose` | Show git-style +/- diff (diff command only) |
106
107
 
108
+ ### Settings removed from the file
109
+
110
+ `diff` marks with a red `-` every setting the server still has that the file no longer declares
111
+ (managed env keys, nginx, logs, registry, scheduler, checks, `ps` and network properties, build
112
+ args, and entries missing from a declared list), including when the whole block is gone. Only
113
+ settable keys count, never read-only report lines, and a `-` counts as drift. It also warns when
114
+ an app has no `links:` but has services linked on the server, because `up` unlinks them.
115
+
116
+ `up` always unsets env keys removed from the file. For every other removal it leaves the setting in place and prints a one-line count per app of the leftovers it noticed in the blocks you declare; it does not look at removed whole blocks or checks. Run `dokku-compose diff` for the full list.
117
+
118
+ **`up --prune`** resets those leftovers. Read `diff` first: every `-` it shows for the resources below is what `--prune` will reset, and there is no prompt (`diff` is the preview, the flag is the consent). Add `--dry-run` to print the reset commands without running them.
119
+
120
+ | Resource | Reset command |
121
+ |----------|---------------|
122
+ | `nginx`, `logs`, `registry`, `ps` | `<plugin>:set <app> <key>` with no value (Dokku's default); nginx then rebuilds the proxy config |
123
+ | `scheduler` | `scheduler:set <app> selected` |
124
+ | `network` properties | `network:set <app> <key>` with no value (`attach_post_create` becomes `attach-post-create`, and so on) |
125
+ | `checks` | `checks:enable <app> <types>` for the process types of a removed `disabled`/`skipped` list that the file declares in no list (a type the file does declare is left, with a warning naming the command to run by hand), `checks:set <app> wait-to-retire` |
126
+ | `build.args` | `docker-options:remove <app> build "--build-arg KEY=VALUE"` for each stale key, by the exact option text (every occurrence); other build options stay |
127
+
128
+ It covers a block that is gone from the file as well as keys removed from a declared block, and it reads the app once more for a block the file no longer has. `--prune` never destroys an app, service or network, never uninstalls a plugin, never changes `scale`, and does not clear whole `domains`, `ports`, `storage` or `networks` lists because their key is missing (those already prune inside a block the file declares). `proxy` is not a removal. `networks:` owns `attach-post-deploy`: `--prune` does not touch it, and a missing `networks:` key does not clear it (that could detach a running app from its network on the next deploy); `networks: []` does. After `up --prune`, `diff` shows no `-` for the resources above, except for checks that were skipped with a warning (their `-` lines stay).
129
+
130
+ ### Errors
131
+
132
+ A failing Dokku command (mutation) is never reported as a success. On `up` and `down`, a
133
+ global-phase failure (plugins, docker auth, global config, networks, services) aborts the whole
134
+ run immediately. A per-app failure is printed with the command and Dokku's error output, and by
135
+ default the run continues to the next app, exiting non-zero at the end with a summary of which
136
+ apps failed; pass `--fail-fast` to stop at the first failure instead. `diff` never reports a
137
+ resource as missing when it could not actually read server state — it falls back to a per-app
138
+ read and, if that's unreadable too, marks the resource `unknown` and exits non-zero with a
139
+ warning naming what it couldn't read.
140
+
107
141
  ## Features
108
142
 
109
143
  All features are idempotent — running `up` twice produces no changes.
@@ -112,7 +146,7 @@ All features are idempotent — running `up` twice produces no changes.
112
146
  |---------|-------------|-----------|
113
147
  | Apps | Create and destroy Dokku apps | [apps](docs/reference/apps.md) |
114
148
  | Dokku Version | Warn when the server's Dokku version is older than the pinned floor | [dokku](docs/reference/dokku.md) |
115
- | Environment Variables | Set config vars per app or globally, with full convergence | [config](docs/reference/config.md) |
149
+ | Environment Variables | Set config vars per app or globally, with full convergence (keys removed from the YAML are unset) | [config](docs/reference/config.md) |
116
150
  | Build | Dockerfile path, build context, app.json, build args | [builder](docs/reference/builder.md) |
117
151
  | Docker Options | Custom Docker options per phase (build/deploy/run) | [docker_options](docs/reference/docker_options.md) |
118
152
  | Networks | Create shared Docker networks, attach to apps | [network](docs/reference/network.md) |
@@ -120,16 +154,29 @@ All features are idempotent — running `up` twice produces no changes.
120
154
  | Port Mappings | Map external ports to container ports | [ports](docs/reference/ports.md) |
121
155
  | SSL Certificates | Add or remove SSL certs | [certs](docs/reference/certs.md) |
122
156
  | Proxy | Enable/disable proxy, select implementation | [proxy](docs/reference/proxy.md) |
123
- | Storage | Persistent bind mounts with full convergence | [storage](docs/reference/storage.md) |
157
+ | Storage | Persistent bind mounts with full convergence (keys removed from the YAML are unset) | [storage](docs/reference/storage.md) |
124
158
  | Nginx | Set any nginx property per app or globally | [nginx](docs/reference/nginx.md) |
125
159
  | Zero-Downtime Checks | Configure deploy checks, disable per process type | [checks](docs/reference/checks.md) |
126
160
  | Log Management | Log retention and vector sink configuration | [logs](docs/reference/logs.md) |
127
- | Plugins | Install Dokku plugins declaratively | [plugins](docs/reference/plugins.md) |
161
+ | Plugins | Install Dokku plugins at pinned versions, updating forward only | [plugins](docs/reference/plugins.md) |
162
+ | Process Scale & ps | Declare process counts (`ps:scale`) and ps properties (`ps:set`) | [scale](docs/reference/scale.md) |
128
163
  | Docker Auth | Authenticate the host docker daemon to private registries (e.g. ghcr.io) for `git:from-image` flows | [docker_auth](docs/reference/docker_auth.md) |
129
164
  | Postgres | Postgres services with optional S3 backups | [postgres](docs/reference/postgres.md) |
130
165
  | Redis | Redis service instances | [redis](docs/reference/redis.md) |
131
166
  | Service Links | Link postgres/redis services to apps | [plugins](docs/reference/plugins.md#linking-services-to-apps-appsapplinks) |
132
167
 
168
+ ## Variable interpolation
169
+
170
+ `${VAR}` in a string value is replaced with the environment variable `VAR`. The file is parsed as YAML first and substituted afterwards, value by value, so a secret can contain any character (`"`, `'`, `#`, `\`, `:`, newlines) and arrives in the value unchanged; it can never change the file's structure. Keys and comments are never substituted. Every unset or empty variable is collected and reported together:
171
+
172
+ ```
173
+ Unset environment variable(s) referenced in config: R2_HOST, GITHUB_TOKEN
174
+ ```
175
+
176
+ To write a literal `${`, use `$${`: `"$${NOT_A_VAR}"` loads as `${NOT_A_VAR}`.
177
+
178
+ Because substitution happens after parsing, a value that is a bare `${VAR}` is always a string, and a variable cannot inject YAML (extra keys, lists, quoting). Earlier versions substituted into the raw text, so anything that relied on that must now be written in the file.
179
+
133
180
  ## Execution Modes
134
181
 
135
182
  ```bash
@@ -186,7 +233,7 @@ dokku-compose/
186
233
  │ │ └── validate.ts # validate command (offline)
187
234
  │ └── tests/
188
235
  │ ├── fixtures/ # Test YAML configs
189
- │ └── *.test.ts # Unit tests per module
236
+ │ └── *.test.ts # Unit tests, beside src/modules and src/resources
190
237
  └── dokku-compose.yml.example
191
238
  ```
192
239
 
@@ -204,8 +251,8 @@ bun install
204
251
  # Run all tests
205
252
  bun test
206
253
 
207
- # Run a specific module's tests
208
- bun test src/modules/postgres.test.ts
254
+ # Run a specific file's tests
255
+ bun test src/resources/config.test.ts
209
256
  ```
210
257
 
211
258
  Tests use [Bun's test runner](https://bun.sh/docs/cli/test) with a mocked `Runner` — no real Dokku server needed.