Security Advisories (1)
CPANSA-Zonemaster-Backend-2021-001 (2021-08-05)

When running the API behind a reverse proxy on the same machine (like it is using the configuration example provided by the GUI) the remote ip might always be localhost even if the query was done from elsewher

NAME

Zonemaster::Backend::Config::DCPlugin - Daemon::Control plugin that loads the backend configuration.

SYNOPSIS

Provides validated and sanity-checked backend configuration through the config property.

my $daemon = Daemon::Control
    ->with_plugins('+Zonemaster::Backend::Config::DCPlugin')
    ->new({
        program => sub {
            my $self = shift;
            my $db   = $self->config->{db};
            ...
        },
    });

The configuration is loaded on start and restart. The start/restart is aborted if the configuration fails the validity- and sanity check. In case of the database configuration, sanity is checked by actually connecting to the database.

AUTHOR

Mattias P, <mattias.paivarinta@iis.se>

CLASS VARIABLES

%config

The loaded configuration.

PROPERTIES

config

The loaded configuration.

A hashref with the following keys.

db

A Zonemaster::Backned::DB object. It's been able to connect to the database at least once.

PRIVATE METHODS

_load_config

Checks if the configuration has been loaded before, and delegates to _load_config otherwise.

_do_load_config

Loads, validates and sanity-checks the backend configuration.