-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yaml
106 lines (86 loc) · 4.51 KB
/
config.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
# NOTE!!! This file is not used yet. It is a placeholder for future functionality
# Default configuration
# Feel free to modify or copy the sections below into your own config file.
# Any values specified in your config file will override the default values defined
# here in the source code
# CONFIG FILE
# The server will look for this file in the root of the project directory
# If you want to use a different file, specify it with the -c flag
# or set the CONFIG_FILE environment variable
# The server will look for a config file in the following order:
# 1. The file specified with the -c flag
# 2. The file specified in the environment variable CONFIG_FILE ((TODO: implement this)))
# 3. The default config file (this file)
# LOGGING CONFIGURATION
# valid values are "debug", "info", "warn", "error", "fatal"
logging: info
# SERVER CONFIGURATION
http:
port: 8080
host: localhost # leave blank to listen on all interfaces. Set to 'localhost' to only listen on the loopback interface
documentation: true # set to false to disable the documentation page
# access_log: set to the path of a file to log access to the server. Leave blank to disable.
# fileending in .json will log in json format. Any other file ending will log in text format
access_log: access.json
# maximum size of an uploaded image in bytes, kilobytes, megabytes or gigabytes
# valid values are positive integers followed by a unit of measurement (none or B for bytes, KB for kilobytes, MB for megabytes, GB for gigabytes, TB for terabytes)
max_upload_size: 30 MB
# IMAGE HANDLER CONFIGURATION
files:
clear_on_start: false # set to true to delete all images from the cache and originals on startup
clear_on_exit: false # set to true to delete all images from the cache and originals when halting the server
populate_from: # set to the path of a directory containing images to add to the server on startup. Leave empty to disable
# paths are relative. Image Handler will will load images from here on startup and save images here when they are added or cached
paths:
# The path to the directory where the original images are stored after being added
originals: img/originals
# The path to the directory where the cached images are stored
cache: img/cache
# set_perms: set to true to set the permissions of the originals and cache directories to 755
set_perms: true
# create_dirs: set to true to create the originals and cache directories if they do not exist
create_dirs: true
cache:
num: 100000 # number of images to cache
# total size (on disk) of the cache in bytes, kilobytes, megabytes, gigabytes or terabytes
# valid values are positive integers followed by a unit of measurement (none or B for bytes, KB for kilobytes, MB for megabytes, GB for gigabytes, TB for terabytes)
size: 10 GB
# NAMED IMAGE PRESETS
# Default will be used if no parameters are specified in the URL
# Values specified in the URL will override these values
# aliases are used in the URL to invoke a preset (e.g. /img/thumbnail/... or /img/tn/...)
# Image Format:
# valid formats are 'jpeg', 'gif' and 'png'.
# Image Quality:
# valid values are 1-100 for 'jpeg' and 1-256 for 'gif'. (inclusive)
# Image Width and Height:
# positive integers only.
# if only one of these is specified, the other will be calculated to maintain the aspect ratio.
# if both are specified, the image will be cropped to the specified dimensions TODO: currently streatches the image
# Note: startup will fail if both are specified and both are set to 0.
# Image Size:
# defines a maximum size for the image in bytes, kilobytes, megabytes or gigabytes
# if the image is larger than this, it will reduced in quality or scaled down to conform to this limit (itterative process that might be slow)
# valid values are positive integers followed by a unit of measurement (none for bytes, KB for kilobytes, MB for megabytes, GB for gigabytes)
# Image Resize Interpolation Function:
# interpolation algorithm used when resizing the image
# TODO: benchmark these and make a note of the performance impact in here
# valid values are 'nearest', 'bilinear', 'bicubic', 'MitchellNetravali', 'lanczos2' and 'lanczos3'
default_image_preset:
alias: [default,def]
format: jpeg
quality_jpeg: 80
quality_gif: 256
width: 800
height: 0
max_size: 1 MB
resizer: lanczos3
image_presets:
- name: default thumbnail
alias: [thumb,th]
format: jpeg
quality: 80
width: 100
height: 100
max_size: 10 KB
resizer: nearest