class

AptLarder::AdminConfig

Inherits YAML::Serializable / Reference / Object

Configuration for the admin HTTP server.

The admin server exposes a JSON REST API (/api/*) for programmatic cache management and an optional web UI (/*) that consumes it. Both run on a dedicated port, separate from the main proxy port.

Authentication

Two independent auth mechanisms are supported:

  • API (/api/*): HTTP Bearer token. Set api_token to a non-empty string; clients must send Authorization: Bearer <token>.
  • UI (/*): HTTP Basic Auth. Set both ui_user and ui_password; browsers will prompt for credentials.

Leaving a credential field empty disables auth for that path. The admin server is disabled by default (enabled: false).

Example config

admin:
  enabled: true
  host: "127.0.0.1"
  port: 8080
  api_token: "change-me"
  ui_user: "admin"
  ui_password: "change-me"

Constructors

new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source

Instance methods

api_token

Bearer token required for all /api/* requests.

Empty string disables authentication for the API (allow-all).

Source
api_token=(api_token : String)

Bearer token required for all /api/* requests.

Empty string disables authentication for the API (allow-all).

Source
enabled=(enabled : Bool)

When false (default), the admin server is not started.

Source
enabled?

When false (default), the admin server is not started.

Source
host

IP address the admin server binds to.

Defaults to loopback (127.0.0.1). Do not change to 0.0.0.0 unless authentication is configured.

Source
host=(host : String)

IP address the admin server binds to.

Defaults to loopback (127.0.0.1). Do not change to 0.0.0.0 unless authentication is configured.

Source
port

TCP port the admin server listens on.

Source
port=(port : Int32)

TCP port the admin server listens on.

Source
ui_password

Password for HTTP Basic Auth on the web UI (/*).

Source
ui_password=(ui_password : String)

Password for HTTP Basic Auth on the web UI (/*).

Source
ui_user

Username for HTTP Basic Auth on the web UI (/*).

Both ui_user and ui_password must be non-empty to enable auth.

Source
ui_user=(ui_user : String)

Username for HTTP Basic Auth on the web UI (/*).

Both ui_user and ui_password must be non-empty to enable auth.

Source