12 Commits
Author SHA1 Message Date
tiennm99 47afb85093 fix: close remaining secret leaks, timeout gaps and config blind spots
- Generated service names come only from a URL host, a key=value DSN's
  host=, or a MySQL tcp() address, so a password in a key=value DSN can no
  longer end up in the name printed on every log line.
- connect_timeout is added only to postgres:// and postgresql:// URLs
  (parsed, so it never lands after a fragment) or as a key=value token, never
  glued onto a key=value value containing "://".
- Driver parse errors that quote password fragments (mongo escape errors,
  lib/pq's missing "=" error) are replaced with generic hints.
- MongoDB keeps its client only after a successful connect, so a failed
  connect is not disconnected twice.
- Couchbase gets ready_timeout plus 1 minute to connect, so raising
  ready_timeout takes effect.
- Shutdown waits at most 7 seconds, inside Docker's 10-second grace period.
- Each adapter declares its config keys; unknown keys anywhere in the file,
  including under config, log a warning without blocking start.
2026-10-09 12:36:21 +07:00
tiennm99 e646af19b8 fix(redis): silence go-redis's internal dial logging
go-redis logs each failed dial attempt, several lines per connect, on top of
the runner's single error line per one-minute retry.
2026-10-09 11:20:09 +07:00
tiennm99 0af652953f fix: bound connects, write on start, and tighten config checks
- Each connect attempt, including initialization, times out after 1 minute,
  and PostgreSQL DSNs without connect_timeout get connect_timeout=30, since
  lib/pq honours the context only while dialing.
- A service increments right after connecting, so a restart writes even
  when the interval outlasts the process.
- A config path that is a directory (Docker's stand-in for a missing
  bind-mount source) fails with a clear message.
- Generated service names take the first free suffix, and suffixed names
  are reserved so an explicit name cannot silently collide with them.
- counter_key inside a service's config map is rejected instead of being
  overwritten.
- Unknown keys in the config file log a warning without blocking start.
- A .dockerignore keeps local configs and .env out of the build context.
2026-10-09 11:15:59 +07:00
tiennm99 30fd62a46c fix(couchbase): increment atomically under the tick context
Increment read the counter and wrote it back, ignoring the tick context, and
treated any read error as a missing document, so a timeout reset the counter
to 1. A single binary increment is atomic, honours the context, and surfaces
real errors. The cluster is also assigned only after a successful connect so
a failed connect is not closed twice.
2026-10-09 11:10:45 +07:00
tiennm99 cbcee9ccd8 refactor(adapter)!: drop the valkey adapter in favor of redis
Valkey speaks the Redis protocol, so the redis adapter (go-redis) already
serves it. Dropping valkey-go removes a dependency and shrinks the stripped
binary by about 9 MB.

The redis adapter now also closes a client that failed to connect only once.

BREAKING CHANGE: `adapter: valkey` is no longer accepted. Use
`adapter: redis` with a redis:// or rediss:// URL instead of valkey:// or
valkeys://. The namespace option now applies to these services.
2026-10-09 11:10:44 +07:00
tiennm99 8108288dca feat(redis): add namespace counter key 2026-06-28 19:35:06 +07:00
tiennm99 77b08464b0 fix(couchbase): restore readiness timeout 2026-06-28 19:20:05 +07:00
tiennm99 0ad7fbebfc fix(couchbase): improve readiness timeout 2026-06-28 19:02:31 +07:00
tiennm99 6b0c2f5a4c fix(runtime): initialize resources per service 2026-06-28 18:03:16 +07:00
tiennm99 f3a23ee91e feat(config): support multi-service yaml config 2026-06-28 09:27:43 +07:00
tiennm99 655db8dcbf feat(config): standardize keepalive env names 2026-06-27 21:47:14 +07:00
tiennm99 e3b7ea5011 feat: initial db-keepalive — pluggable adapters for 6 free-tier DBs
Consolidates the *-keepalive family (redis, valkey, postgresql, mysql,
mongodb, couchbase) into a single binary with a runtime DB_TYPE dispatch
and an Adapter interface. Original repos archived with a pointer here.
2026-05-11 20:15:35 +07:00