Commit Graph
6 Commits
Author SHA1 Message Date
TiM 7e3ff3c5ee fix(docker): re-own the configured persistent path, not only /app/data (#4525)
* fix(docker): re-own the configured persistent path, not only /app/data

The entrypoint's root phase re-owned /app/data, while the writability probe
and the boot-time check both use FLOCI_STORAGE_PERSISTENT_PATH. A named volume
mounted at any other path arrived root-owned, the chown never reached it, and
with non-memory storage the container refused to start.

The root phase now re-owns the same directory the probe checks. The path is
resolved physically first and never re-owned when it resolves to /, since it
now comes from an environment variable.

* test(docker): make the chown helper prove the root phase completed

An empty chown log also results from a root phase that stops before the
privilege drop, so the 'skips a missing dir' case could pass for the wrong
reason. The helper now reports when the drop was never reached.

* fix(docker): resolve the persistent path without CDPATH

A relative FLOCI_STORAGE_PERSISTENT_PATH was resolved with cd, which searches
CDPATH and prints the directory it picks, so a set CDPATH could send the chown
to another directory or corrupt its argument. The resolution now clears it.
The test stub also records chown's full arguments, so the owner and the
recursive flag are asserted, not only the target.

* fix(docker): compare the persistent path to / by inode

bash keeps a leading // through cd -P and pwd -P, so the string test let
FLOCI_STORAGE_PERSISTENT_PATH=// reach a recursive chown on the native images,
which run bash as sh. -ef compares device and inode and holds in every shell,
and chown --preserve-root refuses / on its own as a second guard. The test
harness can now run the entrypoint under a chosen shell, and a bash case pins
the // spelling that dash alone cannot reach.
2026-09-28 22:57:18 -05:00
Niels Kootstra 1831f10105 fix(config): enforce safe default network binding (#3684)
* fix: enforce safe default network binding

* fix(config): keep signed test authority stable

Pin the integration-test listener to the existing all-interface test bind and
opt into that bind only in the test profile. This preserves localhost-based
SigV4 fixtures while production keeps the loopback default.

* fix(config): keep compat image backward compatible

* chore: retrigger CI

* fix(config): mirror JVM image network binding
2026-09-16 14:46:09 -04:00
Alexy Grabov d8e7382d5b fix(docker): allow explicit root for restricted sockets (#3558) 2026-09-13 19:35:01 -05:00
Hector Ventura b0a8dff206 perf(docker): drop the gosu layer and two no-op native-image inputs (#3037)
The native image's tools layer installed shadow-utils, which ubi9-minimal
9.7 already ships, and downloaded a gosu binary: 19 MB on disk, 3.66 MB
compressed, byte-identical on every release since 1.5.34. The entrypoint
still starts as root and still grants the bind-mounted Docker socket's
group to the floci user, but through coreutils, which the base image has:
`chroot --userspec=1001:0 --groups=0,<socket gid> --skip-chdir /` drops to
uid 1001 with the socket's gid as a supplementary group. The group is
passed by number, so no /etc/group entry is needed, and --skip-chdir keeps
/app as the working directory where the relative ./data paths resolve. The
layer is now 24.6 kB (one useradd). The JVM Dockerfile drops its gosu
download too: the entrypoint is shared, so once it execs chroot nothing
there calls gosu. Floci's release and nightly pipelines never publish that
image; build-images.yml is a reusable workflow a fork invokes to publish its
own copy, and its noble base carries the same coreutils chroot flags.

Two inputs to the native build go with it, neither changing a byte:
--allow-incomplete-classpath and --report-unsupported-elements-at-runtime
have been no-ops since GraalVM 22.1 (Quarkus passes --link-at-build-time
itself, so a missing reachable class already fails the build), and the
brotli4j platform JNI jars are excluded from quarkus-rest-jackson because
Floci never enables Brotli compression and the jar was never embedded
(resource count unchanged at 197). A native build without them produces
the same 232.25 MB image and the same reachable set.

Verified on the arm64 image: uid=1001 gid=0; a socket owned by gid 999
yields groups=0,999 end to end; /app/data writable; argv fallthrough
intact; sdk-test-java compat suite 1,667/1,667 against the native image
with the socket mounted.
2026-09-04 22:30:28 -04:00
Hector Ventura fe49bee41e fix(s3): fail fast on unwritable data root instead of opaque 500s (#1868)
When the persistent path is not writable (read-only or root-owned bind
mounts), S3Service's constructor failed lazily and every S3 request
surfaced as an opaque plain-text 500 that REST-XML SDK parsers cannot
read.

- validate the persistent path at boot and refuse to start with an
  actionable error when any enabled service uses non-memory storage
- add class-scoped exception mappers so unhandled failures on S3 and
  S3-Control routes render the S3 InternalError XML contract instead of
  Quarkus's plain-text error page
- warn loudly from the container entrypoint when the state dir is not
  writable by the runtime user

Fixes #1664
2026-07-15 00:43:11 -04:00
TomDav28 3b03b1363c fix(docker): fall back to the default command when entrypoint argv is empty (#1283) 2026-06-10 07:40:05 -05:00