Commit Graph
12 Commits
Author SHA1 Message Date
Hector Ventura 050f93e600 feat(core): make the init hook directory configurable (#5801)
* feat(core): make the init hook directory configurable

Hook directories were fixed at /etc/floci/init/{boot,start,ready,stop,
shutdown}.d, which only the image can provide. floci.init-hooks.dir
(FLOCI_INIT_HOOKS_DIR) now sets that root, defaulting to /etc/floci/init so
the image is unchanged; the LocalStack-compat tree is still read as well.

Hooks also run on Windows, where there is no /bin/sh: .ps1 with
PowerShell, .cmd and .bat with cmd, and .py with python. A .sh hook there
is skipped with a warning unless another shell is configured; on Linux and
macOS the Windows script types are ignored.

Refs #5767

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

* fix(core): match Windows hook extensions in any case and warn about a skip once

Review follow-ups for the configurable hook directory:

- Windows file names are case-insensitive, so SETUP.BAT and Init.PS1 are
  now hooks there; elsewhere the extension must stay lower case, as before.
- The warning for a hook Windows cannot run is logged once per file
  instead of on every directory listing, and Windows script types are
  ignored silently on Linux and macOS.
- The environment variable reference and application.yml list shutdown.d
  with the other hook directories.

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

* fix(core): always resolve hook directories from the configured root

findMergedScripts called getPrimaryPaths() for the default root and
getPrimaryPaths(hooksRoot) otherwise, though both return the same
directories; the no-argument form only survived because five tests stub
it on a mocked hook. The runner now always passes its root, the overload
is gone, and those tests stub getPrimaryPaths(anyString()).

The runner tests this branch added drop @DisplayName, per AGENTS.md.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-16 19:04:48 -04: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
Leonid Bogdanov 5d51052a51 fix(docker): /etc/floci/aws/config missing in published Docker images (#740)
* fix(docker): /etc/floci/aws/config missing in published Docker images

* Address PR feedback
2026-05-07 22:23:30 -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
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
TiM 6f12f78201 fix(lifecycle): run shutdown hooks before HTTP server stops (#431) (#519)
Shutdown hooks could not reach Floci's HTTP endpoint (e.g.
`aws --endpoint-url http://localhost:4566 ...`) because they ran in
the ShutdownEvent observer, which Quarkus fires only AFTER the HTTP
server has already stopped.

Split the lifecycle:
- onPreShutdown(@Observes ShutdownDelayInitiatedEvent) runs stop hooks
  while the HTTP server is still accepting connections.
- onStop(@Observes ShutdownEvent) handles resource cleanup only.

Enable the pre-shutdown phase via `quarkus.shutdown.delay-enabled:
true`. No `delay` value is set, so observers run synchronously with
no artificial sleep introduced.

Swallow all hook failures (including InterruptedException) without
restoring the interrupt flag, so the subsequent ShutdownEvent cleanup
phase always runs with a clean thread state and resource shutdown is
guaranteed even when hooks fail.

Fixes floci-io/floci#431
2026-04-19 07:49:00 -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
Mike Pettypiece d02a1d9a13 fix: default shell executable to /bin/sh for Alpine compatibility (#241)
The init hook executor defaulted to /bin/bash, which is not available on
Alpine-based Docker images (eclipse-temurin:25-jre-alpine). This caused
startup hooks to fail with "No such file or directory". /bin/sh is
universally available and POSIX-compatible.
2026-04-06 15:27:06 -05:00
冰水泡枸杞 93f122e8f8 docs: fix initialization hooks Docker image names and AWS CLI instructions (#169)
- Fix incorrect ghcr.io image reference to correct Docker Hub names
- Add explanation of different image variants (native, JVM, AWS)
- Provide clear options for users needing AWS CLI
- Fix #167
2026-04-01 20:36:40 -05:00
Simone Paolo Petta 59c24c5e4e fix: defer startup hooks until HTTP server is ready (#157) (#159)
Startup hooks that make HTTP calls back to floci (e.g. aws cli) deadlocked
because they ran synchronously during StartupEvent, before the HTTP server
bound to port 4566. Hooks now run on a virtual thread that polls for port
readiness first. When no hooks are configured, behavior is unchanged.
2026-04-01 07:36:01 -05:00
Cyril Schumacher 1e2950a3aa docs: improve initialization hooks documentation (#144)
* docs: add initialization hooks to navigation

* docs: improve link label for initialization hooks

* docs: expand initialization hooks documentation with examples
2026-03-31 17:12:01 -05:00
Cyril Schumacher 7b2576fb42 feat(lifecycle): add support for startup and shutdown initialization hooks (#128)
* feat(lifecycle): add support for startup and shutdown initialization hooks

* test(lifecycle): add unit tests for initialization hooks

* test(lifecycle): add integration tests for initialization hooks

* docs: add documentation and configuration for initialization hooks
2026-03-30 11:00:44 -05:00