-
Notifications
You must be signed in to change notification settings - Fork 80
/
config.example.wikimedia.yaml
181 lines (162 loc) · 5.3 KB
/
config.example.wikimedia.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# RESTBase wikimedia example config
# Load some project templates. These are referenced / shared between domains
# in the root_spec further down.
default_project: &default_project
x-modules:
- path: projects/wmf_default.yaml
options: &default_options
table:
backend: '{env(RB_TEST_BACKEND, sqlite)}'
hosts: [localhost]
keyspace: system
username: cassandra
password: cassandra
defaultConsistency: one # or 'localQuorum' for production
storage_groups:
- name: test.group.local
domains: /./
# ignored in cassandra, but useful in SQLite testing. only used in tests.
dbname: test.db.sqlite3
parsoid:
host: https://parsoid-beta.wmflabs.org
grace_ttl: 1000000
stash_ratelimit: 5
action:
apiUriTemplate: "{{'https://{domain}/w/api.php'}}"
baseUriTemplate: "{{'https://{domain}/api/rest_v1'}}"
graphoid:
host: https://graphoid-beta.wmflabs.org
mathoid:
host: https://mathoid-beta.wmflabs.org
# 10 days Varnish caching, one day client-side
cache-control: s-maxage=864000, max-age=86400
mobileapps:
host: https://appservice.wmflabs.org
summary:
protocol: https
implementation: mcs
host: https://appservice.wmflabs.org
related:
cache_control: s-maxage=86400, max-age=86400
citoid:
host: https://citoid-beta.wmflabs.org
recommendation:
host: https://recommendation-api-beta.wmflabs.org
# 10 days Varnish caching, one day client-side
purged_cache_control: s-maxage=1209600, max-age=0, must-revalidate
# Cache control for purged endpoints allowing short-term client caching
purged_cache_control_client_cache: s-maxage=1209600, max-age=300
pdf:
# Cache PDF for 5 minutes since it's not purged
cache_control: s-maxage=600, max-age=600
uri: https://proton-beta.wmflabs.org
transform:
cx_host: https://cxserver-beta.wmflabs.org
skip_updates: false
# A separate project for en.wikipedia because it is more feature-rich
en.wikipedia.org: &en.wikipedia.org
x-modules:
- path: projects/wmf_enwiki.yaml
options: *default_options
# A different project template, sharing configuration options.
wikimedia.org: &wikimedia.org
x-modules:
- path: projects/wikimedia.org.yaml
options:
<<: *default_options
pageviews:
host: https://wikimedia.org/api/rest_v1/metrics
wikidata.org: &wikidata.org
x-modules:
- path: projects/wmf_wikidata.yaml
options: *default_options
wiktionary_project: &wiktionary_project
x-modules:
- path: projects/wmf_wiktionary.yaml
options: *default_options
wikipedia_project: &wikipedia_project
x-modules:
- path: projects/wmf_wikipedia.yaml
options: *default_options
wikivoyage_project: &wikivoyage_project
x-modules:
- path: projects/wmf_wikivoyage.yaml
options: *default_options
# The root of the spec tree. Domains tend to share specs by referencing them
# using YAML references.
spec_root: &spec_root
title: "The RESTBase root"
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: /^https?:\/\/[a-zA-Z0-9\.]+\/w\/api\.php/
forward_headers: true
- pattern: /^https?:\/\/parsoid-beta.wmflabs.org.+/
forward_headers: true
- pattern: /^https?:\/\//
paths:
/{domain:en.wikipedia.org}: *en.wikipedia.org
/{domain:ru.wikipedia.org}: *wikipedia_project
/{domain:de.wikipedia.org}: *wikipedia_project
/{domain:es.wikipedia.org}: *wikipedia_project
/{domain:it.wikipedia.org}: *wikipedia_project
/{domain:da.wikipedia.org}: *wikipedia_project
/{domain:sv.wikipedia.org}: *wikipedia_project
# Example for wiktionary
/{domain:en.wiktionary.org}: *wiktionary_project
# global domain
/{domain:wikimedia.org}: *wikimedia.org
# special case for wikidata
/{domain:www.wikidata.org}: *wikidata.org
# example for non-wikipedia
/{domain:en.wikivoyage.beta.wmflabs.org}: *wikivoyage_project
# A robots.txt to make sure that the content isn't indexed.
/robots.txt:
get:
x-request-handler:
- static:
return:
status: 200
headers:
content-type: text/plain
body: |
User-agent: *
Allow: /*/v1/?doc
Disallow: /
# Finally, a standard service-runner config.
info:
name: restbase
services:
- name: restbase
module: hyperswitch
conf:
port: 7231
spec: *spec_root
salt: secret
default_page_size: 125
user_agent: RESTBase
ui_name: RESTBase
ui_url: https://www.mediawiki.org/wiki/RESTBase
ui_title: RESTBase docs
logging:
name: restbase
level: warn
streams:
- type: stdout
#metrics:
# type: statsd
# host: localhost
# port: 8125
# batch: true
ratelimiter:
type: kademlia
# Cluster nodes
seeds:
# Port 3050 used by default
- 127.0.0.1
num_workers: 0