-
Notifications
You must be signed in to change notification settings - Fork 11
configuration
A template configuration file is included in the blocking-middleware software distribution as api/1.2/libs/config. example.php
. This file can be copied to api/1.2/libs/config.php
and customized.
For docker images, a provided config.docker.php
file can be copied to the same location, allowing docker
environment variables and container aliases to be automatically read for inter-service operation.
Configuration options are declared as PHP variables (prefixed with $
) or PHP constants (used with define()
).
-
$PG_HOST
: Database hostname -
$PG_PORT
: Database port number -
$PG_USER
: Database username -
$PG_PASS
: Database password -
$PG_DB
: Database name
-
$AMQP_HOST
: RabbitMQ hostname -
$AMQP_USER
: RabbitMQ Username -
$AMQP_PASS
: RabbitMQ Password -
$AMQP_VHOST
: RabbitMQ vhost -
$SUBMIT_ROUTING_KEY
: Routing key for URL submissions
-
$ELASTIC
:http://hostname:port
used for elasticsearch query & update -
ELASTIC_ADULT_FILTER
: set of high-confidence search expressions to remove adult content (in order to highlight non-adult blocks)
-
SITE_EMAIL
: email address used in email from the system -
SITE_NAME
: name of the frontend site -
SITE_URL
: Frontend site URL, used for links in API responses and email messages -
FEATURE_SEND_SUBSCRIBE_EMAIL
(bool) : enable mail sending for "send email updates" feature -
CONFIRM_URL
: URL used for user-verification email confirmation webpage -
VERIFY_URL
: URL used for user-verification links
-
FEATURE_EMAIL_TRACKING
(bool) : enable email-based case management -
MAIL_DOMAIN
: domain used for email-based case management
-
CONFIG_LATEST
: name of the probe configuration file to serve from the/api/1.2/config/latest
API endpoint.
The blocking-middleware project includes some daemon processes and supporting scripts which are used to provide additional results processing or database maintenance. Some daemons are written in Python and use separate configuration files, and some are PHP scripts that use the same configuration as the API.
The API is used to serve probe configuration files from the /api/1.2/config/latest
or /api/1.2/config/<version>
API endpoints.
The probe configuration file format is described [here](https://wiki.openrightsgroup. org/wiki/Censorship_Monitoring_Project_API_Block_Rules_Format).
Files can be placed in api/1.2/config
. A datecode-based filename is recommended (yyyymmdd.json). The api/1. 2/config/latest
API endpoint will serve the file specified by the CONFIG_LATEST
configuration option, or the
last filename (according to alpha-numeric sorting) if the config option is not defined.