RESTBase/config.yaml schema

From mediawiki.org


Warning Warning: Major sections on this page are incomplete or missing. You may have greater success referencing RESTBase/Installation#Configuration.

This page documents the schema used by config.yaml for RESTBase.

config.yaml file is basically for Service-runner, so there are three things to do: The first one is configuring Service-runner, the second one is registering a RESTBase as a service for Service-runner and the third one is configuring the RESTBase.

services Clause[edit]

Placement
services

A list of maps for services. The services can be either RESTBase, Citoid, Mathoid or Cxserver so on. This page only treats restbase service.

This section has the same format as service-runner's services clause. See this document for details.

RESTBase Service Configurations[edit]

This section must be set as below:

services:
  - name: restbase
    module: hyperswitch
    conf:
      # ...

conf Clause[edit]

Placement
services → * → conf

A configurations map for RESTBase, not for Service-runner.

  • port - TODO
  • salt - TODO
  • default_page_size - TODO
  • user_agent - TODO
  • ui_name - TODO
  • ui_url - TODO
  • ui_title - TODO
  • spec - See spec clause below.

spec Clause[edit]

Placement
services → * → conf → spec

A map with keys are filters or paths.

x-route-filters Clause[edit]

Placement
services → * → conf → spec → x-route-filters

A list of filters for the allowed routes. The below filters are automatically added:

- type: default
  name: metrics
- type: default
  name: validator

See also #General filter configurations.

x-request-filters Clause[edit]

Placement
services → * → conf → spec → x-request-filters

A list of filters for the allowed requests. You can use the below filters as convenience way:

- path: lib/security_response_header_filter.js
- path: lib/normalize_headers_filter.js

See also #General filter configurations.

x-sub-request-filters Clause[edit]

Placement
services → * → conf → spec → x-sub-request-filters

Example[edit]

x-sub-request-filters:
  - type: default
    name: http
    options:
      allow:
        - pattern: http://localhost/w/api.php
          forward_headers: true
        - pattern: http://localhost:8142
          forward_headers: true
        - pattern: /^https?:\/\//

General filter configurations[edit]

TODO:

If type is default and name is given, filters/<name>.js is loaded.

  • type TODO
  • name TODO
  • options TODO

paths Clause[edit]

Placement
services → * → conf → spec → paths

A map with keys for the end points.

Path Configuration[edit]

A map that contains x modules.

x-modules Clause[edit]

A list of modules.

Module Configurations[edit]

TODO:


A map.

Examples[edit]

/table module[edit]

TODO:


backend must be sqlite or cassandra.

num_workers Clause[edit]

Placement
num_workers

Same as Service-runner's num_workersclause, see the document for further details.

startup_concurrency Clause[edit]

Placement
startup_concurrency

Same as Service-runner's startup_concurrency clause, see the document for further details.

worker_heartbeat_timeout Clause[edit]

Placement
worker_heartbeat_timeout

Same as Service-runner's worker_heartbeat_timeout clause, see the document for further details.

logging Clause[edit]

Placement
services

Same as Service-runner's logging clause, see the document for further details.

Example[edit]

logging:
  name: restbase
  level: info # being "trace", "debug", "info", "warn"(Default), "error" or "fatal"

metrics Clause[edit]

Placement
metrics

Same as Service-runner's metrics clause, see the document for further details.

ratelimit Clause[edit]

Placement
ratelimit

Same as Service-runner's ratelimit clause, see the document for further details.

dns_cache Clause[edit]

Placement
dns_cache

Same as Service-runner's dns_cache clause, see the document for further details.

info Clause[edit]

Placement
info


TODO:


Example[edit]

info:
  name: restbase
  description: description

See also[edit]