mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
* 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>