-
Notifications
You must be signed in to change notification settings - Fork 6
/
rais-example.toml
205 lines (189 loc) · 8.76 KB
/
rais-example.toml
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# This file documents all configuration options for RAIS. You may use this by
# copying it to /etc/rais.toml (or having rais.toml in the working directory
# when you run rais-server) and adjusting the values per your needs. You can
# also use environment variables and, in many cases, command-line flags. These
# are all documented here as "Env: RAIS_..." and "CLI: --...".
#
# In a traditional server environment, using this file is often a good
# approach. In a more cloud-centric environment, environment values may be
# easier (and are considered best-practice). For development or testing, it
# may be easiest to set up a configuration file locally and/or override with
# command-line flags.
#
# Any configuration setting specified in a file is ignored if the same setting
# is set in the environment. The environment is overridden by settings on the
# command-line.
# Address: Optional, defaults to ":12415". This is where RAIS listens for
# traffic. The default value causes RAIS to accept anything that talks to port
# 12415 on the server.
#
# Env: RAIS_ADDRESS
# CLI: --address
Address = ":12415"
# AdminAddress: Optional, defaults to ":12416". This is another web listener,
# but exposes information which you may not want exposed publicly. If you set
# this to the same value as Address (above), admin endpoints will be exposed on
# the same port as the public endpoints.
#
# Env: RAIS_ADMINADDRESS
# CLI: --admin-address
AdminAddress = ":12416"
# LogLevel: Optional, defaults to "DEBUG". Log messages below this severity
# are ignored.
#
# Env: RAIS_LOGLEVEL
# CLI: --log-level
LogLevel = "INFO"
# TilePath: Required. Set this to the path where images can be found. Note
# that docker uses an environment setting to force this to "/var/local/images",
# and environment settings override config file settings.
#
# Env: RAIS_TILEPATH
# CLI: --tile-path
TilePath = "/var/local/images"
# SchemeMap: Optional, defaults to an empty map. This setting allows you to
# remap a pseudo-scheme to any custom URL prefix in order to shorten image
# identifiers or obfuscate information about stored resources.
#
# This can have one or more maps of "scheme=prefix" values. Prefixes must be a
# valid URL on their own. Each map must be separated by one or more spaces.
# An example might be something like this:
#
# SchemeMap = "briggs=s3://uoregon-images/briggs-image-studio acme=s3://uoregon-historic-art"
#
# In this example, identifiers that have the "briggs" scheme will get
# translated to an S3 URL using a bucket named "uoregon-images", and prefixing
# all ids with "briggs-image-studio". Identifiers with the "acme" scheme will
# be translated to an S3 URL using a bucket named "uoregon-historic-art", and
# have no path prefix. More specific examples:
#
# - A IIIF id of "briggs://tom.jp2" would map to the resource found at
# "s3://uoregon-images/briggs-image-studio/tom.jp2"
# - A IIIF id of "acme://main.jp2" would map to the resource found at
# "s3://uoregon-historic-art/main.jp2"
#
# Schemes are only looked up once. If you added a mapping to the above list to
# make "s3" actually point to "file:///var/local/images" or something, that
# will only work when the id has "s3" as its scheme. The items with "briggs"
# as their scheme will still route to
# "s3://uoregon-images/briggs-image-studio/..."
#
# Note that RAIS internally includes two maps which turn the URL into
# "file://<TilePath>": scheme-less requests and "file" scheme requests. This
# means nobody can put in an ID of "/etc/passwd" or "file:///etc/passwd" and
# hope you've registered a text decoder or something, as both will simply end
# up translating to "file:///var/local/images/etc/passwd".
#
# Env: RAIS_SCHEMEMAP
# CLI: --scheme-map
SchemeMap = ""
# IIIFWebPath: Optional, defaults to "/iiif". This is the endpoint on which
# RAIS will listen for IIIF requests.
#
# Env: RAIS_IIIFWEBPATH
# CLI: --iiif-web-path
IIIFWebPath = "/iiif"
# IIIFBaseURL: Optional: allows RAIS to report URLs for its assets when a IIIF
# info request occurs. If used, make sure this is set to the *public* URL, and
# do not add a path. The base web path should be set above.
#
# Typically, proxy servers (like Apache or nginx) can be configured to give
# RAIS enough information to deduce its base URL, making this unnecessary.
# However, a handful of situations warrant manually specifying the base URL:
#
# - You expose RAIS directly to the Internet. In this scenario, people can
# fake the headers which Apache and nginx normally use when forwarding
# requests, causing RAIS to misrepresent its hostname. There's no risk in
# fake hostnames from a security perspective, but RAIS wouldn't function.
# - Whatever is proxying to RAIS needs to respond on a nonstandard port (80 for
# http and 443 for https are the standard ports)
# - RAIS is behind multiple levels of proxies, and configuring them all to
# forward the proper data is more of a pain than simply configuring RAIS.
# - You need RAIS to report a specific base URL, such as when it's reachable
# from multiple hostnames, but you want a canonical response
#
# Env: RAIS_IIIFBASEURL
# CLI: --iiig-base-url
#IIIFBaseURL = "http://rais.my.edu:12415"
# InfoCacheLen: Optional, defaults to 10000. Set this to 0 to avoid caching
# IIIF Info requests, or set it higher to cache more requests. The overhead
# for caching is very small; probably under 500 bytes of RAM per cached item.
# But the CPU / IO overhead for generating info requests dynamically is pretty
# small as well.
#
# Env: RAIS_INFOCACHELEN
# CLI: --iiif-info-cache-size
InfoCacheLen = 10000
# CapabilitiesFile: Optional, allows removal of undesired capabilities, such as
# image mirroring, TIFF output, etc. See cap-max.toml and cap-level0.toml.
CapabilitiesFile = ""
# TileCacheLen: Optional, defaults to 0. Set this to the *number* of tiles
# you'd like to cache. Currently the cache is set to only store specific types
# of requests in order to only cache JPG tiles. The amount of RAM which may be
# used will vary greatly depending on what ends up being cached. For
# newspapers, it's not unreasonable for a tile to be as large as 100k, and for
# a single page to have up to 200 unique 1024x1024 tiles. Therefore a
# 10,000-item cache could use as much as a gig of RAM, and still only hold 50
# pages. In practice, this is likely to only be useful for caching small
# exhibits or else sites that have one or a few "featured" images which receive
# heavy traffic.
#
# Env: RAIS_TILECACHELEN
TileCacheLen = 0
# Plugins: Optional, defaults to "-".
#
# Comma-separated list of which plugins should be loaded. A value of "" or "-"
# will disable plugins entirely. To disable this from an environment variable,
# you *must* use a hyphen due to how RAIS attempts to read environment
# variables.
#
# Items in the list which don't specify an absolute path must be in a "plugins"
# subdirectory the lives alongside the rais-server binary.
#
# This list can include wildcards, such as "s3*.so,foo.so", as well as absolute
# paths, such as "/usr/local/rais/plugins/*.so". It can also explicitly
# specify individual plugins to avoid accidentally loading plugins you don't
# want in production, even if they are compiled into the plugins/ subdirectory.
#
# A value of "*.so" replicates the 3.0.x behavior of loading everything in
# plugins/
#
# Env: RAIS_PLUGINS
# CLI: --plugins
Plugins = ""
# JPGQuality: Optional, defaults to 75. This must be between 1 and 100, where
# 1 is very low quality but very small JPGs, and 100 is very high quality, but
# very large files. Set this if you want to fine-tune the compression of
# requested JPG files. 75 is typically a good mix of efficiency and quality.
#
# Env: RAIS_JPGQUALITY
# CLI: --jpg-quality
#JPGQuality = 95
####
# If you wanted to globally limit request size, use the below values. By
# default, the server doesn't try to limit request size simply because it's
# impossible for us to assume what makes sense for a given image server.
#
# If an image is smaller than these values, there is no effect on the incoming
# requests. If an image is larger, the maximum requests will be constrained
# and the IIIF info.json profile will report these maximums so that clients
# will be aware of the limits.
####
# ImageMaxArea is the maximum number of pixels delivered: 104857600 allows RAIS to
# deliver a 100-megapixel image raw.
#
# Env: RAIS_IMAGEMAXAREA
# CLI: --image-max-area
ImageMaxArea = 104857600
# ImageMaxWidth is the maximum width a returned image may be. If you only want
# tiles served, rather than whole images, you could change this to 1024.
#
# Env: RAIS_IMAGEMAXWIDTH
# CLI: --image-max-width
ImageMaxWidth = 20480
# ImageMaxHeight is the maximum height a returned image may be. If you only want
# tiles served, rather than whole images, you could change this to 1024.
#
# Env: RAIS_IMAGEMAXHEIGHT
# CLI: --image-max-height
ImageMaxHeight = 20480