Commit Graph
31 Commits
Author SHA1 Message Date
Hector Ventura 9ea2f038f7 fix(ci): ship the darwin-amd64 binary to every Mac, built for Rosetta 2 (#8997)
* fix(ci): ship the darwin-amd64 binary to every Mac, built for Rosetta 2
2026-11-19 10:23:39 -04:00
outofplace a65def00a4 feat(helm): add a Helm chart for running Floci in Kubernetes (#7749) 2026-11-09 09:06:23 -04:00
Priamo Germosen e77823feed ci: push the published images with zstd -19 layers (#7159)
BuildKit compresses zstd at about level 11 at most, so the release and
nightly images now go through a composite action: the image is built
into an OCI layout, every layer is recompressed with the zstd CLI at
level 19, and a second build that only names the layout pushes it.
BuildKit keeps the recompressed layers and still attaches provenance
and the SBOM to the pushed digests.

On 2.4.0 this takes the native image from 94.6 to 70.1 MB on amd64 and
from 92.6 to 67.1 MB on arm64, and compat amd64 from 223.2 to 167.7 MB.
Pulling zstd layers needs Docker Engine 23.0 or later, so the
installation requirements move up from 20.10.

A new workflow tests the action on the pull requests that change it:
recompress.py against fixture layouts, then the whole action pushing a
two-platform image to a registry on the runner.
2026-10-31 21:38:13 -05:00
Hector Ventura 7b9e877f7a docs: document the standalone floci-aws binary (#6114)
* docs: document the standalone floci-aws binary

#5844 publishes a standalone floci-aws binary with every release but no
page says so. The installation guide gains a Native binary section: the
asset per platform, download and checksum, cosign and attestation
verification, the glibc 2.34 floor and the macOS quarantine, which
services need Docker and what happens without it, where persistent state
goes and the host-<port> container namespace, configuration, and running
it under systemd or launchd.

It also says the state directory is shared across ports, so two
persistent binaries need their own FLOCI_STORAGE_PERSISTENT_PATH, and a
persistent binary should restart on the port it used before.

The README points at the section, and the Docker images page no longer
says the arm64 baseline build is image-only.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* docs: say where the image listens and which binaries the image ships

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix: report EC2 as metadata only without Docker, and create ~/.local/bin on install

Without a Docker daemon an EC2 launch does not fail by default:
Ec2ContainerManager marks the instance running as metadata only, and
fails the launch only when security-group enforcement is on. The startup
warning listed EC2 with the services that fail on use, and the binary
page did the same. EC2 now joins the metadata-only group, and moves to
the fail-on-use group when enforcement is enabled.

The install steps create ~/.local/bin before installing into it and run
the binary by its full path, and the namespace note says that binaries
on separate hosts sharing a port and a remote daemon need their own
FLOCI_DOCKER_RESOURCE_NAMESPACE.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-25 16:41:47 -04:00
Hector Ventura 9dcb1b65ae feat(core): translate LocalStack variables in Java instead of the entrypoint (#5851)
* feat(core): translate LocalStack variables in Java instead of the entrypoint

The LocalStack-to-Floci variable mapping (PERSISTENCE, EDGE_PORT,
LOCALSTACK_HOST, GATEWAY_LISTEN, LS_LOG/DEBUG, the Lambda and Docker
variables, the DNS suffixes, USE_SSL, CUSTOM_SSL_CERT_PATH) lived in
docker/localstack-parity.sh, sourced by the image's entrypoint. A JVM run or
a native binary on the host never saw it.

LocalStackParity now computes the same mapping and LocalStackParityConfigSource
serves it at ordinal 301, just above environment variables, as the exported
variables did. A key is produced only when its Floci variable is unset, so an
explicit Floci setting still wins; the DNS suffixes are still appended to any
configured ones; LOCALSTACK_PARITY=false still turns it all off.
TlsConfigSource, which reads its properties before the configuration exists,
consults the mapping too.

The script, its shell test and every Dockerfile copy of it are removed; the
test cases move to LocalStackParityTest.

Refs #5767

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(core): keep TLS backends on loopback, keep configured DNS suffixes, and pass LocalStack settings to hooks

Review follow-ups for the Java LocalStack translation:

- Dockerfile.compat took docker-entrypoint.sh from the published native
  image, which still sourced the removed localstack-parity.sh, so the compat
  image never became healthy. It now copies the entrypoint from the build
  context, as it already does healthcheck.sh.
- At ordinal 301 the parity source outranked TlsConfigSource's loopback pin
  (300): with TLS on and GATEWAY_LISTEN set, the backends bound the gateway
  address while the proxy dialled 127.0.0.1. It now sits at 299, below
  environment variables and the TLS source and above .env and
  config/application.yml, where the exported variables used to be.
- floci.dns.extra-suffixes is no longer a translated property, which on JVM
  and native runs replaced suffixes set in application.yml. The five
  readers append LocalStack's and Floci's suffixes to the configured list
  through LocalStackParity.withDnsSuffixes instead.
- GATEWAY_LISTEN=0.0.0.0:4566 (or [::]:4566, or a list) gives the host to
  quarkus.http.host and the port to floci.port when EDGE_PORT is unset,
  instead of a host Floci rejects as malformed.
- Init hooks get the translation as FLOCI_*/QUARKUS_* variables again, as
  they did when the entrypoint exported them.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(core): parse LOCALSTACK_HOST and GATEWAY_LISTEN the way LocalStack does

Both take LocalStack's host-and-port forms (HostAndPort.parse in its
config.py): host:port, host, :port, [v6]:port and [v6].

- LOCALSTACK_HOST is <hostname>:<port>, localhost.localstack.cloud:4566 by
  default. Its port went into floci.hostname, so the base URL came out as
  http://localhost.localstack.cloud:4566:4566. floci.hostname now gets the
  host alone.
- GATEWAY_LISTEN=:4566, LocalStack's default host on 4566, did not match
  and stopped startup with "Refusing to listen on malformed host". An empty
  host now keeps Floci's own bind address and takes just the port.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-17 17:37:15 -04:00
Hector Ventura 5370920012 chore(release): publish standalone floci-aws binaries as release assets (#5844)
* chore(release): publish standalone floci-aws binaries as release assets

The release already built Linux native executables, but only to package them
into the images; they were discarded after a day and releases carried no
assets. Users without Docker had nothing to download.

release.yml now also builds macOS (arm64, and x86_64 under Rosetta) and Windows
x86_64 binaries with GraalVM Community, smoke-tests every binary on its own
runner with .github/scripts/smoke-binary.sh (version matches the tag, SQS and
DynamoDB round trips, clean stop on SIGTERM), and checks that the Linux amd64
binary still starts on glibc 2.34 (Ubuntu 22.04). A new publish-binaries job,
the only one with write access to the release, stages the six executables as
floci-aws-<os>-<arch>, writes sha256sums.txt, signs every file with keyless
cosign sign-blob, attests build provenance, and uploads them to the release
semantic-release created. Build artifacts are kept 7 days so that job can be
re-run on its own.

make native-install now installs floci-aws, since floci is the CLI.

Refs #5767

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(release): check the glibc 2.34 floor on every Linux binary and wait for the release

Review follow-ups for the binary release jobs:

- The floor check started the amd64 binary on Ubuntu 22.04, whose glibc is
  2.35, so a binary that needed 2.35 would have passed. check-glibc-floor.sh
  now reads the newest GLIBC_ symbol version the binary requires with
  readelf and fails above 2.34, then starts it in UBI 9, whose glibc is 2.34.
- The two arm64 builds had no floor check at all; they run the same script.
- publish-binaries waits up to 10 minutes for semantic-release to create the
  GitHub Release before uploading, instead of failing if it is not there yet.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(release): build darwin-amd64 with a pinned, checksummed GraalVM Community

The macOS x86_64 job downloaded Oracle GraalVM from download.oracle.com's
"latest" URL: not the Community build the job's comment names, unpinned and
unchecked, though its output is then signed and attested as ours. It now
fetches GraalVM Community 25.0.1, the last release with a macOS x64 build,
from graalvm-ce-builds and checks it against the published SHA-256 before
extracting it.

The publish-binaries header said semantic-release creates the release
before pushing the tag; it pushes the tag first, as the upload step says.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-17 12:36:20 -04:00
Hector Ventura a2d02ef967 feat(core): relay container callbacks to a loopback Floci on a Linux host (#5774)
* feat(core): relay container callbacks to a loopback Floci on a Linux host

Containers Floci starts call back through host.docker.internal, which native
Linux Docker maps to the bridge gateway (host-gateway, normally 172.17.0.1).
Docker Desktop forwards that address to the host's loopback, but Linux does
not, so a Floci binary run on a Linux host and bound to 127.0.0.1 (the default)
refused every SDK call from a Lambda function, ECS task or CodeBuild build.
The documented workaround was to listen on 0.0.0.0 with the exposure consent.

BridgeGatewayRelay now listens on the default bridge's gateway address, which
belongs to the host but is not routed from the LAN, and pipes each connection
to Floci's port on loopback. It runs only on a Linux host outside a container,
only while the public listener is on loopback, and only when Docker answers.
The quick start says so.

Refs #5767

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(core): relay every port containers call and close cleanly on shutdown

Review follow-ups for the bridge gateway relay:

- It relays the ports ContainerReachableEndpoint advertises: without TLS the
  HTTP server's port, which can differ from floci.port; with TLS the
  proxy's public port plus its AWS-HTTPS port (a failed bind on that
  privileged port is logged at debug, as the proxy's own is warned once).
- It forwards to the loopback address Floci listens on (::1, localhost,
  127.0.0.2, ...) instead of always 127.0.0.1.
- A shutdown racing the network lookup or a bind closes whatever the
  startup opens afterwards.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(core): relay only connections that come from a Docker network

Linux accepts packets for any of its own addresses on any interface, so a
LAN neighbour that routes the bridge gateway address through this host could
reach the relay and, through it, a Floci bound to loopback.

The relay now reads every Docker network's subnets and relays a connection
only when its source lies in one of them; anything else is closed. A source
outside the known subnets refreshes the list once, at most every five
seconds, so a network created after startup is picked up.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-16 07:05:34 -04:00
TATSUNO “Taz” Yasuhiro cc129007e4 perf(docker): cut healthy wait from 5 s to 0.1 s (#5447)
* perf(docker): cut healthy wait from 5 s to 0.1 s

* fix(docker): wait up to 5 s for ready hooks before reporting healthy

* fix(docker): build without pulling a Dockerfile frontend from Docker Hub
2026-10-11 22:07:24 -05:00
Hector Ventura 96264cde70 chore(build): make the native image build locally and give the Makefile a development workflow (#4271)
The Quarkus container build of the native binary failed on Apple Silicon with
GraalVM's BranchTargetOutOfBoundsException in a generated AwsQueryController
invoker (Quarkus 3.39 turns on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+),
and the packaged image died at startup because the builder links zlib
dynamically while ubi9-micro ships no libz.so.1. `make native` passes the same
flags CI does (-Ob,-H:-AOTSingleCallsiteInline), stages native/<arch>/ like the
workflow, and copies libz.so.1 from the builder image next to the binary, which
Dockerfile.native-package now puts on LD_LIBRARY_PATH.

The Makefile becomes the entry point for development: help (default), dev,
build, test T=, native (container build), native-host (host GraalVM/Mandrel,
adding the Mandrel-only flag when native-image reports Mandrel), run-native,
native-install (PREFIX, default ~/.local), native-image, native-up/native-down/
native-logs against a new docker/compose.native.yml overlay that carries the
five CI compat env vars, clean-sidecars, clean-volumes (a leftover ECR registry
volume is re-adopted on start and breaks the CDK bootstrap), compat SUITES= and
docker-tests. docker/run-docker-tests.sh gains FLOCI_START=0 and COMPAT_SUITES,
validated against the suite list, and its shell test covers both. Docs:
installation (native section rewritten), docker-images, CONTRIBUTING, AGENTS.
2026-09-23 22:35:24 -04: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
Hector Ventura 265344e304 feat(docs): add a service inventory reconciler and fix what it found (#3656)
* feat(docs): add a service inventory reconciler and fix what it found

"How many AWS services does Floci support?" had no answer anyone could defend.
Every source in the repo gave a different number, and two of them were written
down and contradicted each other: docker/localstack-parity.sh said Floci starts
"all 41 services" while migrate-from-localstack.md said "all 58". Neither is
close: the catalog registers 124 descriptors today.

tools/docs/service_inventory.py reconciles the five keyspaces that each answer a
slightly different question, and explains every delta rather than picking a
number: catalog descriptors, the config plane (EmulatorConfig accessors against
application.yml keys), Java packages under services/, the docs pages, and the
service matrix. It reports 119 documented services, 127 distinct API surfaces and
124 signing endpoints, and says which to quote for which question. 27 tests cover
the normalisation and the delta arithmetic.

It also enforces the rule that made this necessary: never write a count into
README.md or docs/, link to the Service Matrix instead. So the two stale counts
are removed rather than corrected, and the parity script and migration guide now
say "every service".

Three services the README's category table omitted are added: Lambda MicroVMs,
Cognito Identity and Bedrock AgentCore Control, each backed by a descriptor or a
docs page.

Two service-matrix corrections the reconciler surfaced:

- The sso alias pointed at iam, so the matrix resolved Identity Center's admin
  API to the IAM page's facet. ResolvedServiceCatalog registers
  descriptor("sso", "ssoadmin", ...) and docs/services/ssoadmin.md is its own
  page, so the alias now points there.
- Both bedrock-agentcore deferrals are retired. bedrock-agentcore.md exists now,
  so that entry has served its purpose; bedrock-agentcore-control has no page and
  never needed one, because the control plane owns the shared page, so it becomes
  an alias instead of a deferral that would expire and need renewing. The
  deferred list is now empty.

check_service_matrix.py --strict passes before and after, so the matrix changes
are tidy-up rather than a fix for a failing gate.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* docs: add the STS README row the inventory tool still reported

The tool's own output at the previous head listed STS as the one service
with a Service Matrix row but no README category-table entry, the same
gap this branch closed for Lambda MicroVMs, Cognito Identity and Bedrock
AgentCore Control. Add it next to IAM, so section 5 of the report now
shows zero missing rows.

Also drop the unused pathlib import from the inventory test.

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-09-15 20:36:53 -05:00
Simone Primarosa 95079965a8 fix(ecr): enforce immutable image tags (#3009)
Route Docker Distribution traffic through Floci so repository mutability applies to manifest writes. Keep legacy registry storage reachable while moving public ECR endpoints to the guarded listener.
2026-09-14 12:07:40 -04:00
Franklin G. Mendoza e0d43189f7 fix(build): publish arm64 baseline release image (#3461) 2026-09-12 11:15:52 -05:00
Hector Ventura eb0472fccc docs: fix stale image tags, release model, service nav and contributor checklists (#2980)
The getting-started and contributor docs had drifted from what the workflows and the
code actually do:

- quick-start and CONTRIBUTING pointed users at a `latest-jvm` image that the release
  pipeline never publishes; both now name the `-compat` image, and `make docs-check`
  greps the docs for any `-jvm` tag
- the CONTRIBUTING branching model now matches the workflows: `main` is published as
  the nightly channel, a maintainer runs the Release Cut workflow to tag a release, and
  the tag triggers the publish; PR builds produce compat images but never publish them
- README and the docs landing page carried a hand-maintained service count and a
  second copy of the service table, both stale; they now link to the Services Overview
- the Service Matrix gains the ELB Classic row it was missing, with an `elb` alias so
  the check no longer resolves the Classic key to the v2 page, and
  check_service_matrix.py now also fails on a docs/services page that has no row
- the README category table lists 16 documented services it omitted
- mkdocs nav gains 11 service pages that were unreachable from the site, drops a
  duplicate CloudTrail entry, and the docs job now runs `mkdocs build --strict` with nav
  and link validation so a page without a nav entry fails CI
- AGENTS.md, CONTRIBUTING.md and docs/contributing.md told contributors to register a
  service in ServiceRegistry, which has no registration API; all three now point at
  ResolvedServiceCatalog and list the config, storage, native-image, docs, tooling and
  compat-suite touchpoints a new service needs
2026-09-02 22:10:46 -04:00
Sam Fakhreddine 279f2776b7 docs: fix port ranges, OpenSearch default image and quick-start snippets (#2690)
Corrects the documented port ranges, the OpenSearch default image tag, the quick-start snippets and a duplicate CloudTrail nav entry so the docs match application.yml and EmulatorConfig.
2026-09-02 19:19:38 -05:00
kotov228andPriamo 8765cde6dd test(terraform): expand Floci IaC compatibility coverage (#1834)
* test(terraform): expand Floci IaC compatibility coverage

* fix(terraform): use current S3 backend path style option

* fix(terraform): route ElastiCache provider calls to Floci

* fix(compat): resolve Firehose name collision, drop resources with live Floci gaps

- aws_kinesis_firehose_delivery_stream.compat collided with main's
  .events stream (both named floci-compat-firehose); renamed to
  floci-compat-firehose-basic.
- Removed aws_codebuild_project, aws_cloudtrail, and aws_opensearch_domain
  from both suites: running the suite end-to-end surfaced real Floci gaps
  behind them (BatchGetProjects ARN lookup, CloudTrail ListTags, OpenSearch
  CognitoOptions nil deref crashing the provider) that only show once
  Terraform gets past apply into the post-create refresh. Tracked as
  #2799, #2800, #2801.
- Updated test counts in README to match (70/44/2,582).

* fix(compat): force_destroy the compat bucket, drop resources with live teardown gaps

- aws_s3_bucket.app now sets force_destroy = true: the CUR report now
  actually emits into this bucket (format=Parquet finally lets the
  report definition get created), so terraform destroy needs to be
  able to clear a non-empty bucket.
- Removed aws_transfer_server: Floci's DeleteServer wrongly requires
  OFFLINE state, which isn't real AWS behavior (confirmed against the
  API reference and terraform-provider-aws's own delete logic, which
  never calls StopServer first). Tracked as #2802.
- Removed aws_batch_compute_environment: UpdateComputeEnvironment
  (called by terraform destroy to disable it first) isn't implemented
  at all, so the request falls through to an HTML error page instead
  of a modeled error. Tracked as #2803.
- Updated test counts in README to match (68/42/2,578).

* fix(compat): drop aws_api_gateway_rest_api pending Floci apiStatus fix

CI (native / compat-terraform) showed terraform apply deterministically
timing out on aws_api_gateway_rest_api: terraform-provider-aws waits for
the REST API's apiStatus field to reach AVAILABLE, and Floci never sets
it (confirmed apiStatus is a real, current field in the apigateway wire
model). Removed from both suites; tracked as #2804.

Updated test counts in README to match (67/41/2,576).

* fix(compat): drop redundant ECS containerInsights setting causing drift

CreateCluster silently drops the settings field on Floci (confirmed:
handleCreateCluster never parses req.path("settings"), unlike the
update handlers), so a subsequent plan always proposes re-adding it -
permanent drift on the suite's "re-planning reports no changes" check.
containerInsights=disabled is AWS's actual default, so the block was
functionally redundant; dropped it rather than block on a Java fix.
Tracked as #2806.

---------

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-08-30 22:44:33 -04:00
Sam Fakhreddine c90c5adfcb feat(lambda): code-signing endpoints and account settings (#2646)
* feat(lambda): GetAccountSettings with usage-derived account limits

Adds the Lambda GetAccountSettings operation. AccountUsage (total code
size and function count) is derived from the caller's stored $LATEST
functions in the region; AccountLimit reports the configured regional
concurrency limit and its unreserved share after per-function reserved
concurrency.

* fix(lambda): widen the default Runtime API port pool to 12000-12499

One Runtime API port is held for the lifetime of each running Lambda
container, so the width of the range is a hard ceiling on concurrent
Lambda executions. The old default of 9200-9299 gave 100, which a
multi-account AWS Landing Zone Accelerator deployment exhausts: it fans
out several custom-resource Lambdas per account and can want well over
a hundred at once.

Exhaustion did not announce itself as a capacity limit either. The
custom resource reported FAILED and CloudFormation rolled the stack
back, so an operator saw an apparently unrelated CloudFormation error
with no hint that a port pool was the cause.

12000 rather than a widened 9200 because the old range's tail collides
with ports floci and its sidecars already use: 9200 is OpenSearch's own
REST port, 9400-9499 is the OpenSearch host-binding pool, 9092 is Kafka
and 9644 Redpanda's admin port.

Both application.yml and the @WithDefault annotation are updated.
application.yml is a config source, not a set of defaults, so a value
set there wins over the annotation; changing only the annotation would
have been a silent no-op (issue #2225). The new test asserts the two
agree, so they cannot drift apart again.

Refs #2206

* fix(lambda): make the Runtime API port-pool exhaustion error self-describing

The old message did not name the pool, its width, or the property that
widens it. It also rarely reaches an operator directly: the Lambda
failure surfaces as a custom resource reporting FAILED and
CloudFormation rolling the stack back, so this text is buried in
floci's own log alongside a CloudFormation error that looks unrelated.

The message now carries its own diagnosis — which pool ran dry, how
many ports it had, that one port is held per running container so this
is the concurrent-execution ceiling, and the two properties that widen
it. Previously the only way to learn those knobs existed was to find
this class in the source.

Refs #2206

* feat(lambda): add ListFunctionsByCodeSigningConfig

Net-new endpoint, GET /2020-04-22/code-signing-configs/{arn}/functions,
always returns an empty FunctionArns list since this codebase has no
CodeSigningConfig management (no Create/PutFunctionCodeSigningConfig),
so no function can ever actually have one attached.

Implemented as its own controller class with its own class-level
@Path("/2020-04-22") rather than folding it into the existing
LambdaCodeSigningController (/2020-06-30): a JAX-RS class-level @Path
is load-bearing for route-matching priority, and stripping it to share
one class across two API-version prefixes causes both endpoints to
fall through to a more general catch-all route elsewhere in the app.

* fix(lambda): scope code storage, publish-version counters, and S3 sync-reload to the owning account

CodeStore resolved extracted code to baseDir/<functionName> with no account
segment, so two accounts' same-named functions in one region shared a single
on-disk directory and overwrote each other's package -- while codeObjectKey
already wrote the same package to an account-prefixed S3 key. Cross-account
invoke resolves a function by the ARN's own account, so a collision here
silently serves one account's code under the other's ARN.

The PublishVersion counter was keyed region+"::"+functionName and the delete
path removed that same unscoped key; both now key on the owning account, via
the shared ownerAccount() helper the S3 key already used.

onS3ObjectUpdated runs on the CDI event thread with no RequestContext, so its
ambient scan only ever saw the default account's partition and its save wrote
back into that partition. It now lists across every account (keeping the region
and $LATEST filters) and saves into the function's own account. listAll(), whose
only caller is the startup concurrency rehydration, is broadened the same way so
a restart no longer drops non-default accounts' reserved concurrency.

Recovered from 613db7bd1, re-derived onto upstream's current shape: CodeStore's
methods are re-signed rather than overloaded (the unscoped forms had no
remaining consumer), and the sync-reload uses a new region-filtered
listAllAccounts() instead of widening listAll() at that call site.

* fix(lambda): carry persisted version counters across the account-scoped key change

The counter map is persisted precisely so a restart cannot re-issue a version
number that already names a snapshot. Re-keying it on the owning account made
every pre-existing entry unreachable, so the next PublishVersion on an upgraded
deployment would have started again at 1 and overwritten the live :1 snapshot.
The counter now adopts and clears the pre-account key on a miss, and deleting a
function clears both forms.

Also covers the widened listAll(): the reserved-concurrency pool is per region
and shared across accounts, so the startup rehydration that feeds it has to see
every account or a restart silently frees capacity that steady-state
PutFunctionConcurrency had already accounted for.

* fix(lambda): validate CodeSigningConfigArn on ListFunctionsByCodeSigningConfig

The handler took @PathParam("codeSigningConfigArn") and never read it, so any
input — including "not-an-arn" — got a 200 with an empty FunctionArns array.
It also dropped the modeled Marker/MaxItems query parameters.

Botocore models InvalidParameterValueException (400) and
ResourceNotFoundException (404) for this operation, and carries a pattern on the
CodeSigningConfigArn shape:

  arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}
  :\d{12}:code-signing-config:csc-[a-z0-9]{17}

(max 200 chars). That pattern is now applied verbatim, whole-string.

The 404 for a well-formed ARN is a derivation, not an observation against real
AWS: ResourceNotFoundException is modeled for this operation, the only resource
the path parameter can name is a code-signing config, and Floci implements no
CreateCodeSigningConfig / PutFunctionCodeSigningConfig — therefore every
well-formed ARN necessarily names a config that does not exist. The previous
always-empty 200 asserted the opposite (config exists, has no functions), which
is the stronger and false claim.

Validation order matches AWS: ARN shape, then MaxItems range (botocore
MaxListItems: min 1, max 10000), then resource resolution — so a bad MaxItems is
reported as such instead of being masked by the not-found. Marker is accepted
and stateless: the result set is always empty, so no NextMarker is ever emitted.

The pre-existing test asserted the 200-empty behaviour using an ARN whose csc-
suffix was 9 characters, which the model's pattern rejects; it is replaced by six
cases covering the two error classes and both MaxItems bounds.

docs/services/lambda.md's two "always empty" claims are corrected to match.

* docs(lambda): derive the operation count from the routed operations

The branch adds two operations (GetAccountSettings and
ListFunctionsByCodeSigningConfig) but bumped docs/services/index.md by one,
30 -> 31. Rather than hand-correcting to 32, the count was re-derived from the
routes, because 30 could not be reconstructed from anything in the tree.

index.md's own preamble states the rule for REST services: "the count reflects
distinct AWS SDK operations, collapsing routes where one JAX-RS handler fans out
via query-string or header markers". Counting JAX-RS methods across the Lambda
controllers on upstream/main gives:

  LambdaController              24
  LambdaConcurrencyController    3
  LambdaEventInvokeController    5
  LambdaLayerController          5
  LambdaTagController            3
  LambdaUrlController            4
                                --
                                44

Two collapses applied. LambdaCodeSigningController's /2020-06-30 route and
LambdaController's /2015-03-31 route are the same SDK operation
(GetFunctionCodeSigningConfig) and count once. LambdaUrlInvocationController (5)
and the lambda-package ApiGatewayController (5) are data-plane proxies with
{proxy: .*} catch-alls, not Lambda SDK operations, so they are excluded.

44 + GetAccountSettings + ListFunctionsByCodeSigningConfig = 46.

Corroboration that 44 is the real base and 30 is drift: docs/services/lambda.md's
Supported Operations table lists 34 rows on upstream/main and omits exactly the
5 layer and 5 event-invoke operations — 34 + 10 = 44. Those 10 missing table rows
are pre-existing and left alone here; only the count is in scope.

* fix(lambda): match the current CodeSigningConfigArn pattern for isolated partitions

The inlined regex predated the model's (eusc-)? prefix and widened -iso(b?)
alternation, so a well-formed ARN in aws-iso-e/iso-f or the European sovereign
cloud was rejected as malformed instead of reaching the modeled 404.

* fix(lambda): validate FunctionName length, Role ARN, and Handler on config paths

botocore models FunctionName up to 256 chars with dots allowed in the name
segment; LambdaArnUtils rejected dots and never bounded length. Also close
the gap where UpdateFunctionConfiguration accepted a malformed Role ARN or a
whitespace-containing/oversized Handler and stored it verbatim.

* fix(lambda): close leaked directory-listing streams and block dot-segment traversal in CodeStore

Files.walk/Files.list returned streams that were never closed, leaking file
descriptors and making delete() flaky on platforms that refuse to remove an
open file. Separately, sanitizeName replaced disallowed characters but let a
segment consisting entirely of dots (".", "..") pass through untouched, so an
account or function name of exactly ".." resolved outside baseDir via
Path.resolve instead of being rejected.

* fix(lambda): reclaim pre-account-scoped code directories on delete and update

A function created before code storage was account-scoped left its extracted
code at <codePath>/<functionName>. DeleteFunction only ever targeted the new
<codePath>/<accountId>/<functionName> path, and UpdateFunctionCode re-extracted
to the new path without touching the old one, so the legacy directory (and its
disk usage) lingered indefinitely after either operation. CodeStore now also
clears the legacy path on delete, and re-extraction reclaims it on success.

* fix(lambda): reject an explicit null Handler on UpdateFunctionConfiguration

validateHandler treated null as "clear the handler", matching how Description
is handled, but null is not a string at all -- and unlike Description, Handler
names the file AWS invokes. A request with "Handler": null silently cleared it
instead of failing with a 400, which would have broken every subsequent
invocation of the function instead of the one bad request that caused it.

* fix(lambda): do not reclaim a legacy code directory another account's function still uses

The pre-account-scoped layout gave every account's same-named function the
exact same on-disk directory. CodeStore.delete() and code re-extraction both
reclaimed that legacy directory unconditionally once a function migrated to
the account-scoped path, so a delete or code update in one account could
destroy the legacy directory while another account's never-migrated $LATEST
still served invocations from it -- its next cold start would then fail with
a missing code directory.

CodeStore.delete() no longer touches the legacy path at all; only
LambdaService calls deleteLegacy() explicitly, after checking every account's
$LATEST functions (via the existing cross-account listAllAccounts) for one
still pointing its codeLocalPath at that directory.

* fix(lambda): check published versions, not just $LATEST, before reclaiming a legacy code directory

publishVersion snapshots codeLocalPath verbatim (required so a version-qualified
invoke doesn't launch a container with no code, #1987), so a version published
while $LATEST was still on the pre-account-scoped legacy path keeps that
directory alive on its own after $LATEST migrates. The unused-check only
scanned $LATEST records via listAllAccounts(region), so a later delete or code
update reclaimed the directory out from under that published version's own
future invokes. Switched to functionStore.listAll(), which has no $LATEST or
region filter, matching the fact that the legacy path itself carries neither.

* fix(lambda): close a publish-vs-legacy-cleanup race on the code directory

publishVersion read codeLocalPath and persisted a snapshot of it with no
synchronization against extractZipCodeBytes's/deleteFunction's decision to
reclaim the pre-account-scoped legacy code directory (added in bede98fc1 and
f3837be32). A version could be published in the narrow window between that
decision (finding no live reference) and the actual delete, persisting a
snapshot whose codeLocalPath names a directory that is about to be removed --
its own future invocation would then fail with "Code directory not found".

publishVersion and the reclaim call in extractZipCodeBytes now both take the
same per-function lock deleteFunction already used for this. Proven with a
test that holds the lock externally and asserts publishVersion blocks until
it is released, rather than relying on timing to catch the race in the act.
2026-08-28 10:52:53 -04:00
Sebastian Schuberth 60e238e77b docs(getting-started): Switch to the io.floci test container (#2588)
* docs: Update / align Maven `testcontainers` artifact version 1.x / 2.x

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>

* docs(getting-started): Switch to the `io.floci` test container

While at it, also resolve "LATEST" to the actual latest 1.x version
1.14.0, because "LATEST" does not work anymore for Maven 3+.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>

---------

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2026-08-27 15:37:06 -04:00
Hector Ventura 717769857b docs: correct service count to 58 and add EMR, WAF v2, CloudTrail pages (#1398)
Reconcile inconsistent service counts (55/54/41) to 58 distinct services across the README, docs index, services overview, and the LocalStack migration guide. Add the missing per-service pages and Service Matrix rows for EMR, WAF v2, and CloudTrail, and wire them into the mkdocs nav and README service tables.
2026-06-16 18:57:37 -05:00
TomDav28andTomer David 076afb3ebd feat(parity): emit LocalStack-compatible "Ready." log line on startup (#1284)
Co-authored-by: Tomer David <tomer.david+catonian@catonetworks.com>
2026-06-10 07:52:15 -05:00
Hector Ventura c8c77c9e6e feat(s3): virtual-hosted style addressing support (#805)
*.s3.localhost.floci.io, *.localhost.localstack.cloud, and
  *.s3.localhost.localstack.cloud as virtual-hosted style regardless of
  FLOCI_HOSTNAME — fixes 405 when SDK uses endpointOverride("http://localhost:4566")
  without forcePathStyle (closes #801)
- EmbeddedDnsServer ships localhost.localstack.cloud and localhost.floci.io
  as built-in suffixes so spawned containers resolve these domains to Floci's
  IP without extra config
- Compatibility test S3VirtualHostStyleTest covers the full virtual-host path
  end-to-end; TestFixtures.s3VirtualHostClient() prefers s3.localhost.floci.io,
  falls back to s3.localhost.localstack.cloud, or uses FLOCI_S3_VHOST_ENDPOINT
  in Docker
- run-docker-tests.sh and compatibility.yml inject --dns <floci-ip> and
  FLOCI_S3_VHOST_ENDPOINT=http://floci:4566 into test containers
- S3 and migrate-from-localstack docs updated with virtual-hosted style details
2026-05-11 23:53:28 -05:00
Hector Ventura 9e35046647 Docs/enviroment instead yml (#764)
* docs: moving all config to env instead of yml
* docs: sync with main and new features
* docs: reverting docker-compose.yml
2026-05-10 11:53:31 -05:00
Hector Ventura 023880b7d9 feat(parity): LocalStack drop-in compatibility (#696)
- Translate LocalStack env vars (LOCALSTACK_HOST, PERSISTENCE, LAMBDA_DOCKER_NETWORK, etc.)
  to Floci equivalents automatically at startup; opt out with LOCALSTACK_PARITY=false
- Serve /_localstack/init and /_localstack/health alongside /_floci/* equivalents
- Report executed scripts with path, state, and return_code in /_floci/init response
- Add /_aws/sqs/messages GET (non-destructive peek) and DELETE (purge) inspection endpoint
- Add /_aws/execute-api/{apiId}/{stageName} LocalStack-compat path for REST API invocation
- Add four-phase init hook lifecycle (boot/start/ready/stop) with dual-path discovery
  (/etc/floci/init/ and /etc/localstack/init/ compat paths)
- Install Python 3, AWS CLI, boto3 in standard image; wrap aws binary to pre-configure
  --endpoint-url=http://localhost:4566 so init scripts need no extra flags
- Wire entrypoint.sh + gosu privilege drop into all Dockerfile variants
- Add migration guide and update README, docker-compose, docker-images, SQS, and
  initialization-hooks docs
2026-05-04 01:15:59 -05:00
Hector Ventura 3c98efe615 chore: new docker image tag and compatibility (#691)
* chore: new docker image tag and compatibility
* chore: change nightly workflow schedule time
2026-05-02 22:46:25 -05:00
Kenshin Okinaka 88f40a839b docs: update Docker image references to floci/floci (#595)
* docs: update Docker image references to floci/floci
* docs: keep README Docker Hub badges pointing to hectorvent/floci

The hectorvent/floci image has accumulated pull and size metrics; switch
the badges to floci/floci once the new image has comparable numbers.
2026-04-25 09:29:39 -05:00
Conor Heine a0ed51e9d1 feat: ecr (#337) 2026-04-11 09:59:05 -05:00
TiM a32b7f1f3b docs: comprehensive audit sweep + CHANGELOG backfill (1.1.0-1.5.2) (#326)
CHANGELOG.md was empty for the 1.1.0-1.5.2 release cycle and service docs
had drifted from code behaviour. This sweep reconciles docs against the
current codebase on upstream/main.

- Backfill CHANGELOG.md for 1.1.0 through 1.5.2 from git history
- Correct exact operation counts in docs/services/index.md: S3 (~30 -> 58),
  Lambda (~25 -> 30), API Gateway v1 (~24 -> 62). Counts now come from the
  actual dispatch handlers rather than @Path annotation counts.
- Rewrite README "Supported Services" table to drop per-service op counts
  (they drift too fast); point readers at docs/services/index.md
- Update 24 service docs for accuracy, add "Not Implemented" sections
  where relevant (s3.md, lambda.md, api-gateway.md)
- Refresh configuration and getting-started docs
- Add EventBridge Scheduler and AppConfig to mkdocs nav
- Add AppConfig / AppConfigData rows to README and services index
  following the 1.5.2 upstream release
2026-04-10 10:52:34 -05:00
Fred Peña 766d031b76 docs: migrate docs GitHub references to floci-io (#214)
* docs: migrate docs GitHub references to floci-io
* docs: update MkDocs site and repo metadata to floci-io
* docs: update MkDocs site_url and repository references to floci-io
2026-04-05 15:59:55 -05:00
Niklas Herder f44d3bc05e docs: clean up named volume examples in docker-compose and quick-start docs (#161)
Improve the Docker Compose documentation for named volumes and
persistence section for clarity and consistency. Fix indentation in
quick-start.md that broke MkDocs tabbed content rendering.
2026-04-02 08:49:03 -05:00
Dixit R Jain 4fc9398df4 feat: officially support Docker named volumes for Native images (#155)
* feat: officially support Docker named volumes for Native images

* Pre-creates /app/data and assigns 1001 ownership in Dockerfile.native and Dockerfile.native-package before declaring VOLUME and dropping to USER 1001. This natively fixes the AccessDeniedException when utilizing Docker named volumes instead of local bind mounts, aligning container architecture flawlessly with tools like LocalStack.
* Standardizes named volumes as officially documented optional alternatives across docker-compose templates in quick-start, index, and README documentation for a cleaner repository drop-in replacement footprint.

* feat: natively support Docker named volumes via recursive permissions

* Pre-creates /app/data and applies recursive 1001:root ownership and g+rwX permissions in Dockerfile.native and Dockerfile.native-package before declaring VOLUME and dropping to USER 1001. This elegantly resolves AccessDeniedException crashes when mapping Docker named volumes instead of local binds, natively supporting frictionless LocalStack-style drop-in architecture.
* Standardizes named volumes as officially documented optional alternatives across docker-compose templates in quick-start, index, and README documentation for a cleaner repository drop-in replacement footprint.
2026-04-01 08:56:38 -05:00
Hector Ventura 61433f59ab firt commit 2026-03-15 17:43:56 -05:00