MariaServiceHoster
MariaServiceHoster is a Windows application for hosting Maria GDK5 services. It can expose multiple services through a shared HTTP/HTTPS reverse proxy, with a separate gRPC listener when needed.
The host owns public listeners, routing, child-process supervision and monitoring. Each service runs as a standalone child process.
For detailed configuration, deployment instructions and examples, see the MariaServiceHoster README (repository access required). For service implementation guidance, see Writing services for MariaServiceHoster.
Hosting and routing
The reverse proxy routes requests to the appropriate service using path prefixes such as /geostore and /geofencing. Child services can remain on loopback listeners while clients connect through the shared front door.
Built-in and approved external services use the same child-process execution model. ExecutionMode may be omitted or set to Process; InProcess is no longer supported for enabled services.
Service listeners and proxy routes can be configured explicitly. Alternatively, HostedServices:<ServiceId>:EndpointHandling can be set to AutoEndpoints. Endpoint tokens such as Http:5095 and Grpc:5097 then generate loopback listeners. Set AutoProxy to true and supply a ProxyPath to generate the corresponding front-door routes.
Important: The shared front door and management UI require usable top-level Kestrel:Endpoints and reverse-proxy routes, whether configured explicitly or generated. A configuration without the front door can still start child services, but does not expose the host's management UI.
Configuration
By default, the host loads appSettings.json beside the executable. An alternative configuration file can be supplied as the first command-line argument.
| File | Purpose |
|---|---|
appSettings.json |
Front-door listeners, shared macro values and hosted-service configuration. |
appSettings.Proxy.json |
Explicit reverse-proxy routes and backend destinations. |
appSettings.ExternalProcesses.json |
External child-service package locations, configuration transport and trust settings. |
appSettings.ServiceSettings.json |
Service-specific settings, including activation and storage paths. |
appSettings.Logging.json |
Shared logging defaults, hoster overrides and per-service logging overrides. |
Sidecars are optional. Matching *.Local.json files provide deployment-specific overrides. When using a differently named base configuration file, sidecar filenames must use the same base name; see Custom AppSettings example.
Non-local sidecars load in this order: Proxy, ExternalProcesses, ServiceSettings, then Logging. The base .Local.json file loads next, followed by local sidecars in the same order. .Logging.Local.json therefore loads last. Later files override earlier values for the same key.
Services are enabled or disabled through HostedServices:<ServiceId>:Settings:Disabled, often using values from GlobalDefinitions. Restart policy can be configured under HostedServices:RestartPolicy and overridden for individual services.
The host projects only the relevant Logging, Kestrel and Settings sections to each child. By default, these are passed through process-local environment variables prefixed with MARIA_HOSTED__. HostedExternalProcesses:ChildConfigTransport can instead select File or FileAndEnvironment; file-based transport supplies a generated configuration file using --config.
Logging
Logging uses a framework-neutral policy shared by the hoster, built-in GDK services and approved external services:
Loggingsupplies shared defaults.HosterLoggingoverrides those defaults for the hoster only.HostedServices:<ServiceId>:Loggingoverrides them for one child service.
The policy supports minimum levels with category overrides, log file paths, calendar rolling, size-based rolling and retained file count. Daily and size rolling can operate simultaneously. Retention counts files, including the active file, rather than days.
The supplied log path uses [service_tag] to give the hoster and each child instance separate log file series. GDK-owned services use a Serilog adapter; external services translate the same options into their own logging framework and are not required to use Serilog.
Use appSettings.Logging.Local.json for deployment-specific changes. Logging configuration is applied at startup; restart the hoster to apply changes to it and its children.
See MariaServiceHoster logging for all settings, defaults, precedence rules and a daily/100 MB/five-file example.
Management and diagnostics
When the front door is enabled, the host exposes:
| Path | Purpose |
|---|---|
/host/monitor/ |
Service status, configured listeners, traffic counters, recent child output and supported operator controls. |
/host/swagger/ |
Entry page for host and proxied-service API documentation. Each service retains its own Swagger document. |
/host/api/services |
Service runtime state as JSON. |
With the default HTTP port, open the monitor on the server itself. Port 5111 is the default HTTP/2-only gRPC listener, not the browser entry point.
Listener binding: The current base configuration uses http://*:5110 and http://*:5111. These are wildcard bindings, not loopback-only listeners. Actual bindings depend on the selected configuration and local overrides. Use explicit loopback addresses when local-only access is required, and restrict network access with firewall rules.
Host startup does not wait for all children to become ready. Use the monitor's per-service status and the services' /ready endpoints to determine availability. A child startup failure is reported for that service rather than automatically terminating the host.
If the monitor is unavailable, check the startup log entries for Config, Proxy enabled and Host listeners. Ensure the deployed wwwroot folder contains the monitor files.
The hoster forwards child console output into its own logger as well as retaining recent output for the monitor. These copies follow the hoster's logging policy independently of the child's own file policy; see child output in the hoster log.
Deployment considerations
- Deploy the complete host payload, including configuration sidecars,
wwwroot, sharedDataresources and built-in child runtime directories underServices\<ServiceId>. Copying only the host executable is not sufficient. - Built-in children run with their own service directory as the working directory. Review relative storage paths and use absolute paths for shared or persistent storage.
- Keep logs, caches and persistent service storage outside the shared
Dataresource directory. - Install approved external service packages at their configured locations, with the required manifest and executable files. Configure executable hash and manifest-signature trust checks according to deployment policy; external registration is not permission to launch arbitrary executable paths.
- Configure trusted HTTPS certificates and remove or restrict unencrypted external listeners for production use. Child services can remain on loopback HTTP/gRPC behind the front door.
- Verify service health, readiness and required HTTP/gRPC routes. Configure bounded automatic restart where required.
- Grant the service account appropriate access to log directories, service storage and certificate private keys.
- Restrict access to the management surface; do not assume it provides built-in authentication.
Consult the README for complete settings, certificate handling, package validation and current limitations.