This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yaml
111 lines (109 loc) · 4.24 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Reference:
# https://github.com/wikimedia/restbase/blob/v1.1.4/config.example.yaml
num_workers: RESTBASE_NUM_WORKERS
services:
- name: restbase
module: hyperswitch
conf:
port: 7231
salt: secret
default_page_size: 125
user_agent: RESTBase
ui_name: RESTBase
ui_url: https://www.mediawiki.org/wiki/RESTBase
ui_title: RESTBase docs
spec:
x-request-filters:
- path: lib/security_response_header_filter.js
- path: lib/normalize_headers_filter.js
x-sub-request-filters:
- type: default
name: http
options:
allow:
- pattern: MEDIAWIKI_APIS_URI
forward_headers: true
- pattern: PARSOID_URI
forward_headers: true
- pattern: /^https?:\/\//
paths:
/{domain:MEDIAWIKI_APIS_DOMAIN}/{api:v1}:
x-modules:
- spec:
info:
version: 1.0.0
title: Wikimedia REST API
description: Welcome to your RESTBase API.
x-route-filters:
- path: ./lib/normalize_title_filter.js
options:
redirect_cache_control: 's-maxage=0, max-age=86400'
paths:
/page:
x-modules:
- path: v1/content.yaml
options:
response_cache_control: 's-maxage=0, max-age=86400'
- path: v1/common_schemas.yaml # Doesn't really matter where to mount it.
/transform:
x-modules:
- path: v1/transform.yaml
/media:
x-modules:
- path: v1/mathoid.yaml
/{domain:MEDIAWIKI_APIS_DOMAIN}/{api:sys}:
x-modules:
- path: projects/proxy.yaml
options:
backend_host_template: '{{"/{domain}/sys/legacy"}}'
- spec:
paths:
/table:
x-modules:
- path: sys/table.js
options:
conf:
backend: sqlite
dbname: db.sqlite3
pool_idle_timeout: 20000
retry_delay: 250
retry_limit: 10
show_sql: false
storage_groups:
- name: local
domains: /./
/legacy/key_value:
x-modules:
- path: sys/key_value.js
/legacy/page_revisions:
x-modules:
- path: sys/page_revisions.js
/post_data:
x-modules:
- path: sys/post_data.js
/action:
x-modules:
- path: sys/action.js
options:
# XXX Check API URL!
apiUriTemplate: MEDIAWIKI_APIS_URI
# XXX Check the base RESTBase URI
baseUriTemplate: "{{'http://{domain}:7231/{domain}/v1'}}"
/page_save:
x-modules:
- path: sys/page_save.js
/parsoid:
x-modules:
- path: sys/parsoid.js
options:
parsoidHost: PARSOID_URI
response_cache_control: 's-maxage=0, max-age=86400'
/mathoid:
x-modules:
- path: sys/mathoid.js
options:
host: MATHOID_URI
/events:
x-modules:
- path: sys/events.js
options: '{{merge({"skip_updates": options.skip_updates}, options.events)}}'