-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfig.example.yml
More file actions
103 lines (86 loc) · 3.31 KB
/
Copy pathconfig.example.yml
File metadata and controls
103 lines (86 loc) · 3.31 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
# Optional. Defaults to 3000. The port for the service to run on.
port: 3000
# Optional. Logging configuration
log:
json: true # Do JSON logging
colorize: false # Do not colorize the output.
level: debug # Log level
disableAccessLogging: false # Whether to disable access logging
# Optional. Defaults to the system temp directory.
tempDir: /tmp
# Optional. Defaults to false. Whether to trust the X-Forwarded-For header. Uses express.js options.
trustProxy: true
# Configuration for errors.
errors:
# Configuration for blank images in error cases.
blankImages:
# Optional. Defaults to false. Whether to return blank images in error cases.
enabled: true
# Optional. Defaults to 30 seconds. The blank image TTL in seconds.
ttl: 30
# Optional. Defaults to 204. The status code for blank images.
statusCode: 204
# Optional. A list of valid hostnames for the service.
# This is useful if you want to hide the origin hostname (e.g. s3cr3th0s1.example.com).
validHostnames:
- localhost
# Optional. The number of pointr instances to run.
# This will default to the number of CPUs on the system bounded by the min and max.
instances:
min: 2
max: 64
# Optional. Timeout (in seconds) when requesting images.
requestTimeout: 5
# Optional. Image downloader configuration
downloader:
# A user-agent header to use when downloading images.
userAgent: pointr
# Recommended. The header to use for the end-client (browser) IP address.
# This is necessary if this service is an origin,
# fronted by a CDN that provides its own header for the client IP address.
# For example, Akamai provides a "True-Client-IP" header.
ipHeader: True-Client-IP
# How long to cache images. This will set the cache control header for the CDN.
cache:
ttlDefault: 2592000 # Default to 30 days (2592000 seconds).
ttlMin: 3600 # Minimum 1 hour (3600 seconds).
ttlMax: 2592000 # Maximum 30 days (2592000 seconds).
# Recommended. The rate limiter to use.
# The rate limiter should have a type (key) to a set of options.
rateLimiter:
# Use a redis rate limiter.
redis:
# Required. The host where the redis instance lives.
host: localhost
# Required. The port the redis instance is running on.
port: 6379
# Optional. The redis password.
# pass: 3x@mp13
# The set of clients that will be using the service.
# Each client is a key to a set of options for that client.
clients:
# A demo client. A unsafe, rate limited client for demo purposes.
demo:
# Client-specific cache time settings.
cache:
ttlDefault: 3600
ttlMin: 3600
ttlMax: 3600
# Allow requests without a signature.
unsafe: true
# Rate limit by end-client (browser) IP; allow 10 reqs per hour.
rateLimit: { by: ip, max: 10, perHours: 1 }
# An example of an internal tool that has no rate limit
# because the secret key is not exposed.
internal_tool:
# Use this secret key for generating signatures.
secret: "1nt3rn@lT00l"
# No rate limit.
rateLimit: none
# An example of a client that has a secret in addition to a
# rate limit.
mobile:
# Use this secret key for generating signatures.
secret: "M0b1l3*1m@g3*R351z1ng!"
# Rate limit by end-client (browser) IP; allow 1000 reqs per hour.
rateLimit: { by: ip, max: 1000, perHours: 1 }