.. highlight:: rst .. _quakelink: ######### quakelink ######### **Earthquake distribution server** Description =========== quakelink is an event and metadata server by gempa. quakelink is part of the QuakeLink suite. .. _quakelink-architecture: Architecture: ============= quakelink is a server that collects data from SeisComP systems using plugins. The data is stored in the database and provided to clients. The clients may be other SeisComP systems, web browsers or other applications such as `EQInfo`. .. _fig-ql_architecture: .. figure:: media/quakelink.png :align: center :width: 16cm QuakeLink architecture. .. _quakelink-configuration-setup: Examples ======== See the :ref:`examples` for examples applications and setups. Module Configuration ==================== | :file:`etc/defaults/global.cfg` | :file:`etc/defaults/quakelink.cfg` | :file:`etc/global.cfg` | :file:`etc/quakelink.cfg` | :file:`~/.seiscomp/global.cfg` | :file:`~/.seiscomp/quakelink.cfg` quakelink inherits :ref:`global options`. .. note:: Modules/plugins may require a license file. The default path to license files is :file:`@DATADIR@/licenses/` which can be overridden by global configuration of the parameter :confval:`gempa.licensePath`. Example: :: gempa.licensePath = @CONFIGDIR@/licenses .. confval:: QL.port Default: ``18010`` Type: *int* Port to listen for data requests .. confval:: QL.pluginPort Default: ``18011`` Type: *int* Port to listen for plugin data feeds .. confval:: QL.filebase Default: ``@ROOTDIR@/var/lib/quakelink/archive`` Type: *path* Base path of the data storage .. confval:: QL.maxConnections Default: ``-1`` Type: *int* Maximum number of simultaneous data connections. Note: In addition to this configuration parameter an upper limit may be enforced by the license you obtained. .. confval:: QL.maxRequestLines Default: ``-1`` Type: *int* Maximum number of lines per request .. confval:: QL.cacheLifeTime Default: ``1.0`` Unit: *h* Type: *double* Time span in hours after which objects expire .. confval:: QL.database Default: ``@ROOTDIR@/var/lib/quakelink/archive/events.db`` Type: *path* Path to the SQLite database .. confval:: QL.runAsUser Type: *string* Drop privileges to specified user .. confval:: QL.users Type: *path* Path to the users database \(same format Apache users file\). The tool htpasswd can be used with switch \"\-d\" to force usage of crypt\(\) function. MD5 is currently not implemented. .. confval:: QL.access-list Default: ``@ROOTDIR@/etc/quakelink-access.cfg`` Type: *path* Path to the access control file. Format: Multiples lines of form 'KEY \= VALUE'. KEY: '[DOMAIN].ALLOW\|DENY'. VALUE: comma\-separated list of IP addresses or network masks. DOMAIN: Allowed values: 'PLUGINS, COMMANDS, URLS'. PLUGINS: Access control of plugin data connections. COMMANDS: Allowed values: 'SET, FORMAT::[NATIVE, GZNATIVE, SUMMARY, XML, GZXML], INFO::[CLIENTS, EVENTS, OPTIONS]'. .. confval:: QL.keepAliveInterval Default: ``30`` Unit: *s* Type: *int* Interval to send out keep alive messages to connected clients. The purpose of these messages is to prevent TCP connections from being silently shutdown by intermediate communication infrastructure because of inactivity. A client still needs to request keep alive messages up on connection. .. confval:: QL.enableKeepAlive Default: ``false`` Type: *boolean* By default clients need to request keep alive messages up on connection. Set this flag to true to enable the sending of keep alive messages for the native QuakeLink protocol by default. .. confval:: QL.maxRevisionsPerEvent Default: ``1000`` Type: *int* The maximum number of event revisions. All later revisions will be discarded silently. .. confval:: QL.logStats Default: ``-1`` Type: *int* Log performance statistics to file ql\-stats. The interval is in seconds. Use \-1 to disable the logging. .. confval:: QL.plugins Type: *list:string* Registration of plugins .. confval:: QL.SSL.port Default: ``-1`` Type: *int* Port to listen for data requests with SSL .. confval:: QL.SSL.pluginPort Default: ``-1`` Type: *int* Port to listen for plugin data feeds with SSL .. confval:: QL.SSL.certificate Type: *path* Path to SSL certificate file .. confval:: QL.SSL.key Type: *path* Path to SSL private key file .. confval:: QL.SSL.users Type: *path* Path to the SSL users database \(same format Apache users file\). The tool htpasswd can be used with switch \"\-d\" to force usage of crypt\(\) function. MD5 is currently not implemented. .. note:: **QL.plugin.$name.\*** $name is a placeholder for the name to be used and needs to be added to :confval:`QL.plugins` to become active. .. code-block:: sh QL.plugins = a,b QL.plugin.a.value1 = ... QL.plugin.b.value1 = ... # c is not active because it has not been added # to the list of QL.plugins QL.plugin.c.value1 = ... .. confval:: QL.plugin.$name.cmd Type: *string* Plugin command to execute .. confval:: QL.http.port Default: ``-1`` Type: *int* Port to listen for HTTP request .. confval:: QL.http.maxWorkers Default: ``4`` Type: *int* Number of workers processing requests in parallel .. confval:: QL.http.logAccess Default: ``true`` Type: *boolean* Number of workers processing requests in parallel .. confval:: QL.http.timeout Default: ``-1`` Unit: *s* Type: *integer* QuakeLink uses long polling for POST event requests. To allow returning an empty document \(HTTP 204\) rather than waiting forever this parameter can be used. It applies a no\-data timeout in seconds. This setting might be useful if QuakeLink is being ran behind a proxy. .. confval:: QL.http.rootURL Type: *string* Defines the root URL used to generate links. That option is only important if e.g. Apache with reverse proxy is used to forward QuakeLinks webpages. .. confval:: QL.http.allowNativeAttributes Default: ``false`` Type: *boolean* Expose sensitive information like author name .. confval:: QL.http.path.media Default: ``@DATADIR@/quakelink/www`` Type: *path* Path to HTTP media files .. confval:: QL.http.path.templates Default: ``@DATADIR@/quakelink/templates`` Type: *path* Path to HTTP templates .. confval:: QL.https.port Default: ``-1`` Type: *int* Port to listen for HTTPS request .. confval:: QL.dyfi.database Type: *string* Defines the database connection used to store DYFI information. If no database connection is configured the DYFI service will be disabled. Supported database backends: MySQL and SQLite3. Example: mysql:\/\/sysop:sysop\@localhost\/dyfi .. note:: **QL.dyfi.auth.\*** *Access to DYFI information is restricted by username* *and password. For querying and pushing data the access can be* *defined independently in separate files. The DYFI GET and PUT* *user databases are in the extended Apache configuration format.* *The tool htpasswd can be used with the switch "-d"* *(forces the usage of the crypt() function) to fill up the* *database with users. MD5 is not yet implemented. Optionally a* *path to a BNA file may be given to limit the result set to one* *or more regions.* *Anonymous access can be granted by adding a new line with the* *content 'guest'.* .. confval:: QL.dyfi.auth.get Type: *path* Path to the DYFI GET user database in an extended Apache configuration format. .. confval:: QL.dyfi.auth.put Type: *path* Path to the DYFI PUT user database in an extended Apache configuration format. Command-Line Options ==================== :program:`quakelink [options]` Generic ------- .. option:: -h, --help Show help message. .. option:: -V, --version Show version information. .. option:: --config-file arg Use alternative configuration file. When this option is used the loading of all stages is disabled. Only the given configuration file is parsed and used. To use another name for the configuration create a symbolic link of the application or copy it. Example: scautopick \-> scautopick2. .. option:: --plugins arg Load given plugins. .. option:: -D, --daemon Run as daemon. This means the application will fork itself and doesn't need to be started with \&. .. option:: -x, --expiry arg Default: ``1`` Time span in hours after which objects expire Verbosity --------- .. option:: --verbosity arg Verbosity level [0..4]. 0:quiet, 1:error, 2:warning, 3:info, 4:debug. .. option:: -v, --v Increase verbosity level \(may be repeated, eg. \-vv\). .. option:: -q, --quiet Quiet mode: no logging output. .. option:: --print-component arg For each log entry print the component right after the log level. By default the component output is enabled for file output but disabled for console output. .. option:: --component arg Limit the logging to a certain component. This option can be given more than once. .. option:: -s, --syslog Use syslog logging backend. The output usually goes to \/var\/lib\/messages. .. option:: -l, --lockfile arg Path to lock file. .. option:: --console arg Send log output to stdout. .. option:: --debug Execute in debug mode. Equivalent to \-\-verbosity\=4 \-\-console\=1 . .. option:: --trace Execute in trace mode. Equivalent to \-\-verbosity\=4 \-\-console\=1 \-\-print\-component\=1 \-\-print\-context\=1 . .. option:: --log-file arg Use alternative log file. server ------ .. option:: -p, --server-port arg Overrides configuration parameter :confval:`QL.port`. .. option:: --server-ssl-port arg Overrides configuration parameter :confval:`QL.SSL.port`. Default: ``-1`` .. option:: -P, --plugin-port arg Overrides configuration parameter :confval:`QL.pluginPort`. .. option:: --plugin-ssl-port arg Overrides configuration parameter :confval:`QL.SSL.pluginPort`. .. option:: --http-port arg Overrides configuration parameter :confval:`QL.http.port`. .. option:: --https-port arg Overrides configuration parameter :confval:`QL.https.port`. .. option:: ----sync-db Synchronize database with archive .. option:: --update-log When synchronizing the database the log file will be updated as well .. option:: --check-archive Check archive