feat!: replace password environment with Docker secret references
All checks were successful
Test and Release Module / test (push) Successful in 29s
Test and Release Module / release (push) Successful in 7s

This commit is contained in:
2026-09-16 15:01:15 -04:00
parent c3ad476b1a
commit 34ccc01c26
6 changed files with 72 additions and 21 deletions

View File

@@ -5,7 +5,7 @@
## Install
```sh
go get cloud.campbellwireless.net/git/barkstack/barkfile-parser@v1.0.0
go get cloud.campbellwireless.net/git/barkstack/barkfile-parser/v2@v2.0.0
```
The module requires Go 1.24 or later.
@@ -24,7 +24,7 @@ if err != nil {
The current schema defines one `pawsql` block with a listener, an optional TLS `cert`/`key` pair, and one or more `database` routes. A route has exactly one of:
- `upstream <host:port>` for an external PostgreSQL server.
- `postgres { ... }` for a managed PostgreSQL container. Its `image`, `volume`, and `password_env` directives are required. `idle_timeout` and `traffic_idle_timeout` accept Go duration strings.
- `postgres { ... }` for a managed PostgreSQL container. Its `image`, `volume`, and `password_secret` directives are required. `password_secret` is a short lowercase reference resolved to the Docker secret `barkstack_<reference>`. `idle_timeout` and `traffic_idle_timeout` accept Go duration strings.
```text
pawsql {
@@ -40,7 +40,7 @@ pawsql {
postgres {
image postgres:18
volume application-data
password_env APPLICATION_POSTGRES_PASSWORD
password_secret application_postgres_password
idle_timeout 10m
traffic_idle_timeout 1h
}
@@ -48,6 +48,12 @@ pawsql {
}
```
Create the referenced secret before deploying PawSQL:
```sh
docker secret create barkstack_application_postgres_password /secure/path/application-postgres-password
```
## Watch validated changes
```go
@@ -80,4 +86,4 @@ Gitea Actions runs tests on each `main` push. The release job reads Conventional
| `type!:` or `BREAKING CHANGE:` | major |
| other types | no release |
Go consumers update through standard module versions, for example `go get cloud.campbellwireless.net/git/barkstack/barkfile-parser@latest`.
Go consumers update through standard module versions, for example `go get cloud.campbellwireless.net/git/barkstack/barkfile-parser/v2@latest`.