diff --git a/docker-compose.yml b/docker-compose.yml index 265e46d098..1151d74103 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ services: build: context: . dockerfile: docker/Dockerfile + tty: true ports: - "4566:4566" - "6379-6399:6379-6399" diff --git a/src/main/java/io/github/hectorvent/floci/core/common/BouncyCastleInitializer.java b/src/main/java/io/github/hectorvent/floci/core/common/BouncyCastleInitializer.java index ce7116e979..c0cc076c7c 100644 --- a/src/main/java/io/github/hectorvent/floci/core/common/BouncyCastleInitializer.java +++ b/src/main/java/io/github/hectorvent/floci/core/common/BouncyCastleInitializer.java @@ -21,9 +21,9 @@ public class BouncyCastleInitializer { static { if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) { Security.addProvider(new BouncyCastleProvider()); - LOG.info("Registered BouncyCastle security provider (manual fallback)"); + LOG.debug("Registered BouncyCastle security provider (manual fallback)"); } else { - LOG.info("BouncyCastle provider already registered by Quarkus"); + LOG.debug("BouncyCastle provider already registered by Quarkus"); } } diff --git a/src/main/java/io/github/hectorvent/floci/core/common/ServiceRegistry.java b/src/main/java/io/github/hectorvent/floci/core/common/ServiceRegistry.java index 4dc78a463e..99efb749fb 100644 --- a/src/main/java/io/github/hectorvent/floci/core/common/ServiceRegistry.java +++ b/src/main/java/io/github/hectorvent/floci/core/common/ServiceRegistry.java @@ -34,7 +34,7 @@ public class ServiceRegistry { List enabled = new ArrayList<>(); for (ServiceDescriptor descriptor : catalog.allStatusDescriptors()) { if (descriptor.enabled()) { - enabled.add(descriptor.externalKey()); + enabled.add(descriptor.configKey()); } } return enabled; diff --git a/src/main/java/io/github/hectorvent/floci/core/common/dns/EmbeddedDnsServer.java b/src/main/java/io/github/hectorvent/floci/core/common/dns/EmbeddedDnsServer.java index e5478b9d29..04479b45e6 100644 --- a/src/main/java/io/github/hectorvent/floci/core/common/dns/EmbeddedDnsServer.java +++ b/src/main/java/io/github/hectorvent/floci/core/common/dns/EmbeddedDnsServer.java @@ -18,8 +18,10 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; import java.util.Optional; +import java.util.SequencedSet; /** * Embedded UDP/53 DNS server that runs inside the Floci container and is injected @@ -53,7 +55,7 @@ public class EmbeddedDnsServer { static final List BUILTIN_SUFFIXES = List.of(DEFAULT_SUFFIX, LOCALSTACK_SUFFIX); private volatile String serverIp; - private final List suffixes = new ArrayList<>(); + private final SequencedSet suffixes = new LinkedHashSet<>(); private String upstreamDns; EmbeddedDnsServer(List suffixes) { diff --git a/src/main/java/io/github/hectorvent/floci/core/storage/StorageFactory.java b/src/main/java/io/github/hectorvent/floci/core/storage/StorageFactory.java index 2cdeaf58dd..715291747c 100644 --- a/src/main/java/io/github/hectorvent/floci/core/storage/StorageFactory.java +++ b/src/main/java/io/github/hectorvent/floci/core/storage/StorageFactory.java @@ -57,7 +57,7 @@ public class StorageFactory { Path basePath = Path.of(config.storage().persistentPath()); Path filePath = basePath.resolve(fileName); - LOG.infov("Creating {0} storage for service {1} (file: {2})", mode, serviceName, filePath); + LOG.debugv("Creating {0} storage for service {1} (file: {2})", mode, serviceName, filePath); StorageBackend inner = switch (mode) { case "memory" -> new InMemoryStorage<>(); diff --git a/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java b/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java index 224e71aec7..455a08da1f 100644 --- a/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java +++ b/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java @@ -23,9 +23,11 @@ import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.event.Observes; import jakarta.enterprise.event.ObservesAsync; import jakarta.inject.Inject; +import org.eclipse.microprofile.config.inject.ConfigProperty; import org.jboss.logging.Logger; import java.io.IOException; +import java.util.Optional; @ApplicationScoped public class EmulatorLifecycle { @@ -33,6 +35,9 @@ public class EmulatorLifecycle { private static final Logger LOG = Logger.getLogger(EmulatorLifecycle.class); private static final int HTTP_PORT = 4566; + @ConfigProperty(name = "quarkus.application.version", defaultValue = "") + Optional appVersion = Optional.empty(); + private final StorageFactory storageFactory; private final ServiceRegistry serviceRegistry; private final EmulatorConfig config; @@ -79,10 +84,11 @@ public class EmulatorLifecycle { } void onStart(@Observes StartupEvent ignored) { - LOG.info("=== AWS Local Emulator Starting ==="); - LOG.infov("Storage mode: {0}", config.storage().mode()); - LOG.infov("Persistent path: {0}", config.storage().persistentPath()); - LOG.infov("TLS: {0}", config.tls().enabled() ? "enabled (HTTPS + HTTP dual mode)" : "disabled (HTTP only)"); + LOG.infof("=== AWS Local Emulator %s Starting ===", appVersion.orElse("")); + LOG.infof("Endpoint: http://0.0.0.0:%d", config.port()); + LOG.infof("Region: %s Account: %s", config.defaultRegion(), config.defaultAccountId()); + LOG.infov("Storage: {0} Path: {1}", config.storage().mode(), config.storage().persistentPath()); + LOG.infov("TLS: {0}", config.tls().enabled() ? "enabled (HTTPS + HTTP dual mode)" : "disabled (HTTP only)"); // BOOT hooks run before service initialization — scripts cannot use AWS APIs yet. try { diff --git a/src/main/java/io/github/hectorvent/floci/services/apigatewayv2/websocket/WebSocketHandler.java b/src/main/java/io/github/hectorvent/floci/services/apigatewayv2/websocket/WebSocketHandler.java index f7cbcdd61d..982b1e7644 100644 --- a/src/main/java/io/github/hectorvent/floci/services/apigatewayv2/websocket/WebSocketHandler.java +++ b/src/main/java/io/github/hectorvent/floci/services/apigatewayv2/websocket/WebSocketHandler.java @@ -75,7 +75,7 @@ public class WebSocketHandler { */ void init(@Observes Router router) { router.route("/ws/*").handler(this::handleWebSocketUpgrade); - LOG.info("Registered WebSocket handler on /ws/*"); + LOG.debug("Registered WebSocket handler on /ws/*"); } /** diff --git a/src/main/java/io/github/hectorvent/floci/services/ec2/Ec2MetadataServer.java b/src/main/java/io/github/hectorvent/floci/services/ec2/Ec2MetadataServer.java index adb9a31754..f364c223ae 100644 --- a/src/main/java/io/github/hectorvent/floci/services/ec2/Ec2MetadataServer.java +++ b/src/main/java/io/github/hectorvent/floci/services/ec2/Ec2MetadataServer.java @@ -98,10 +98,10 @@ public class Ec2MetadataServer { httpServer = vertx.createHttpServer(); httpServer.requestHandler(router).listen(port, result -> { if (result.succeeded()) { - LOG.infov("EC2 IMDS server listening on port {0}", port); + LOG.infof("EC2 IMDS server listening on port %d", port); future.complete(null); } else { - LOG.warnv("EC2 IMDS server failed to start on port {0}: {1}", port, result.cause().getMessage()); + LOG.warnf("EC2 IMDS server failed to start on port %d: %s", port, result.cause().getMessage()); future.completeExceptionally(result.cause()); } }); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index db8cd6c039..9bcbc44bce 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,13 +1,11 @@ quarkus: log: - # min-level sets the floor for what can be emitted at runtime. Default is INFO, - # which silently filters any TRACE/DEBUG logs even when a category override - # asks for them. Lowering the floor to TRACE lets users opt in per-category - # (e.g. QUARKUS_LOG_CATEGORY__IO_GITHUB_HECTORVENT_FLOCI_SERVICES_SQS__LEVEL=TRACE) - # without also having to raise min-level. Effective level is still INFO by default. - min-level: TRACE console: - color: true + format: "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] %s%e%n" + category: + "io.apicurio": + level: WARN + http: port: ${floci.port} host: 0.0.0.0 @@ -44,6 +42,7 @@ quarkus: - --initialize-at-run-time=io.github.hectorvent.floci.services.cognito.CognitoSrpHelper - --initialize-at-run-time=io.github.hectorvent.floci.services.ses.SesService - --initialize-at-run-time=io.github.hectorvent.floci.services.route53.Route53Service + - --initialize-at-run-time=io.github.hectorvent.floci.services.kms.KmsService floci: