/
config.yaml.erb
86 lines (80 loc) · 2.86 KB
/
config.yaml.erb
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
<%
cvars = {
'mwapi' => scope.lookupvar('service::configuration::mwapi_uri'),
'restbase' => scope.lookupvar('service::configuration::restbase_uri'),
'gelf_host' => scope.lookupvar('service::configuration::logstash_host'),
'gelf_port' => scope.lookupvar('service::configuration::logstash_port'),
'stat_host' => scope.lookupvar('service::configuration::statsd_host'),
'stat_port' => scope.lookupvar('service::configuration::statsd_port'),
'proxy' => scope.lookupvar('service::configuration::http_proxy')
}
cvars.keys.each do |k|
cvars[k] = '' if cvars[k].nil? or ['undef', ''].include? cvars[k].to_s
end
%>
# Number of worker processes to spawn.
# Set to 0 to run everything in a single process without clustering.
# Use 'ncpu' to run as many workers as there are CPU units
num_workers: <%= @no_workers %>
# Log error messages and gracefully restart a worker if v8 reports that it
# uses more heap (note: not RSS) than this many mb.
worker_heap_limit_mb: <%= @heap_limit %>
# Number of milliseconds to wait for a heartbeat from a worker before killing
# and restarting it
worker_heartbeat_timeout: <%= @heartbeat_to %>
# Logger info
logging:
name: <%= @logging_name %>
level: warn
streams:
# Use gelf-stream -> logstash
- type: gelf
host: <%= cvars['gelf_host'] %>
port: <%= cvars['gelf_port'] %>
<% if @local_logging -%>
- type: file
path: <%= @local_logfile %>
level: info
<% end -%>
# Statsd metrics reporter
metrics:
name: <%= @statsd_prefix %>
type: statsd
host: <%= cvars['stat_host'] %>
port: <%= cvars['stat_port'] %>
services:
- name: <%= @title %>
# a relative path or the name of an npm package, if different from name
module: <%= @starter_module %>
entrypoint: <%= @entrypoint %>
# optionally, a version constraint of the npm package
# version: ^0.4.0
# per-service config
conf:
# the port to bind to
port: <%= @port %>
# IP address to bind to, all IPs by default
# interface: localhost # uncomment to only listen on localhost
# allow cross-domain requests to the API (default '*')
cors: '*'
# to disable use:
# cors: false
# to restrict to a particular domain, use:
# cors: restricted.domain.org
# URL of the outbound proxy to use (complete with protocol)
proxy: <%= cvars['proxy'] %>
# the template used for contacting the MW API
mwapi_req:
method: post
uri: <%= cvars['mwapi'] %>
headers:
host: '{{request.params.domain}}'
user-agent: '{{user-agent}}'
body: '{{ default(request.query, {}) }}'
# the template used for contacting RESTBase
restbase_req:
method: '{{request.method}}'
uri: <%= cvars['restbase'] %>/{{domain}}/v1/{+path}
query: '{{ default(request.query, {}) }}'
headers: '{{request.headers}}'
body: '{{request.body}}'