forked from wikimedia/restbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
162 lines (143 loc) · 4.94 KB
/
config.example.yaml
File metadata and controls
162 lines (143 loc) · 4.94 KB
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
# RESTBase config
info:
name: restbase
templates:
wmf-content-1.0.0: &wp/content/1.0.0
swagger: '2.0'
# swagger options, overriding the shared ones from the merged specs (?)
info:
version: 1.0.0-beta
title: Wikimedia REST API
description: >
This API aims to provide coherent and low-latency access to
Wikimedia content and services. It is currently in beta testing, so
things aren't completely locked down yet. Each entry point has
explicit stability markers to inform you about development status
and change policy, according to [our API version
policy](https://www.mediawiki.org/wiki/API_versioning).
### High-volume access
- Don't perform more than 500 requests/s to this API.
- Set a unique `User-Agent` header that allows us to contact you
quickly. Email addresses or URLs of contact pages work well.
- Consider using our [HTML
dumps](https://phabricator.wikimedia.org/T17017) once they
become available.
termsOfService: https://wikimediafoundation.org/wiki/Terms_of_Use
contact:
name: the Wikimedia Services team
url: http://mediawiki.org/wiki/RESTBase
license:
name: Apache2
url: http://www.apache.org/licenses/LICENSE-2.0
security:
# ACLs for public *.wikipedia.org wikis
- mediaWikiAuth:
- user:read
x-subspecs:
- mediawiki/v1/content
# - mediawiki/v1/mobile
# - mediawiki/v1/revision-scoring
wmf-sys-1.0.0: &wp/sys/1.0.0
info:
title: Default MediaWiki sys API module
version: 1.0.0
paths:
/{module:table}: &wp/sys/table # Can use this anchor to share the table
x-modules:
# There can be multiple modules too per stanza, as long as the
# exported symbols don't conflict. The operationIds from the spec
# will be resolved against all of the modules.
- name: restbase-mod-table-cassandra
version: 1.0.0
type: npm
options: # Passed to the module constructor
conf:
hosts: [localhost]
keyspace: system
username: cassandra
password: cassandra
defaultConsistency: one # or 'one' for single-node testing
storage_groups:
- name: test.group.local
domains:
- /test\..*\.org$/
- /test\.local$/
- name: default.group.local
domains: /./
/{module:page_revisions}: &wp-page-revisions
x-modules:
- name: page_revisions
version: 1.0.0
type: file
/{module:key_rev_value}: &wp/sys/key_rev_value
x-modules:
- name: key_rev_value
version: 1.0.0
type: file
/{module:parsoid}:
x-modules:
- name: parsoid
version: 1.0.0
type: file
options:
parsoidHost: http://parsoid-lb.eqiad.wikimedia.org
# For local testing, use:
# parsoidHost: http://localhost:8000
/{module:action}:
x-modules:
- name: action
type: file
options:
apiURI: http://{domain}/w/api.php
# /{module:revscore}:
# title: Simple revscore service wrapper
# x-modules:
# # Generic revision service interface; Expects requests of the form
# # /{title}/{revision}.
# # Specific interface documentation (content types etc) at public
# # entry point, although we might also want to enforce them
# # internally.
# - name: restbase-mod-service
# version: 1.0.0 # simple service module, to be shared
# options:
# storage:
# uri: /{domain}/sys/key_rev_value/revscore.scores/{title}/{revision}
# service:
# uri: http://revscore.wikimedia.org/{domain}/{title}/{revision}
wp-default-1.0.0: &wp/default/1.0.0
x-subspecs:
- paths:
/{api:v1}:
x-subspec: *wp/content/1.0.0
- paths:
/{api:sys}:
x-subspec: *wp/sys/1.0.0
spec: &spec
title: "The RESTBase root"
# Some more general RESTBase info
paths:
/{domain:en.wikipedia.org}: *wp/default/1.0.0
# /{domain:de.wikipedia.org}: *wp/default/1.0.0
# /{domain:es.wikipedia.org}: *wp/default/1.0.0
# /{domain:nl.wikipedia.org}: *wp/default/1.0.0
#
# test domain
/{domain:en.wikipedia.test.local}: *wp/default/1.0.0
services:
- name: restbase
module: ./lib/server
conf:
port: 7231
spec: *spec
logging:
name: restbase
level: info
#streams:
## XXX: Use gelf-stream -> logstash
#- type: gelf
# host: <%= @logstash_host %>
# port: <%= @logstash_port %>
metrics:
#type: txstatsd
#host: localhost
#port: 8125