-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexampleconfig.cfg
252 lines (216 loc) · 7.47 KB
/
exampleconfig.cfg
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# This an example configuration file
debug = false
# configuration for the core program
[core]
# the location of the database file
# buchschloss.sqlite by default
database name = the.db
# iterations for PBKDF2. To make the hashes stronger (or faster) later,
# insert the preferred number at the beginning.
# older hashes will automatically be updated at login
hash iterations = 1,2,3
# Salt length for hashes in bytes. If it is changed,
# the new length will be applied every time a password is changed
salt length = 30
# the format dates are displayed in, see https://docs.python.org/3/library/datetime.html#datetime.date.strftime
# %Y-%m-%d by default
# date format = some other value
# number of latest borrowers to save
# 10 by default
save latest borrowers = 15
# how long different levels may borrow books for
# the index is the level, the value the max. number of weeks
# a book may be borrowed for
[[borrow time limit]]
1 = 4
3 = 10
4 = 20
[[log]]
file = example.log
# level is INFO by default
[[[rotate]]]
# other option: time; default: none
how = size
# in KiB
size = 100
# if time is used, specify
# interval unit = H # other options: S,M,D
# interval value = 12
# number of old copies, default 5
copy count = 3
# minimum levels required to do stuff
# you may go up to 10
[[required levels]]
[[[Group]]]
activate = 3
[[[Member]]]
view = 0
# configuration for utilities
[utils]
# when errors occur, emails can be sent
[[email]]
# who has to deal with errors
recipient = [email protected]
# From: header
from = Buchschloss <[email protected]>
[[[smtp]]]
host = smtp.example.tld
port = 587
username = buchschlossEmail
password = Pa$$w0rd
# for end-user messages
[[names]]
format = json
file = example_names.json
# scripts can be invoked at different times for different reasons
# a script id specified as "<name>[!<type>]", like "leseclub!lua"
# scripts are lua scripts by default, so the above is equivalent to "leseclub"
# the other script type is a Python script (!py).
# The only Python scripts are the backup scripts "local_backup" and "http_backup"
# To run a specific function in a lua script, put it after the name and a ':'
[scripts]
# startup scripts are run once on every startup
startup = local_backup!py, a-lua-script:some_func
# repeating scripts are run periodically
# the time in <days>[:<hours>[:<minutes>]] is given following a '@' symbol
repeating = http_backup!py@3:12
# configuration for Python scripts
# Note that for technical reasons underscores in Python script names
# must be omitted in this part of the configuration.
# This does not apply to other scripts or script specs,
# just the config section names
[[python]]
[[[local backup]]]
# maximum number of copies
# depth = 1
# no local encryption configured
[[[http backup]]]
# 32-byte key in base64
# PLEASE, do get your own one (head --bytes=32 /dev/urandom | base64)
secret key = 4iCNcFGc2nwxlno92In++eCCbuXj3GYLmcFvI39OGew=
# including protocol (https://)
url = https://backups.example.com/buchschloss
# file name to use when uploading
# since the server should probably save the files
# under a different name (so they have distinct names)
# this shouldn't be too important
file name = buchschloss.bak
# HTTP Basic authentication can be used
[[[[Basic authentication]]]]
username = buchschloss-backups
password = Pa$$w0rd
# or authentication via POST parameters
# or some other POST parameters...
[[[[POST authentication]]]]
some name = some value
# configuration for lua scripts
[[lua]]
[[[leseclub]]]
borrow weeks = 2
# User Interface configuration
# ============================
# the following blocks deal with UI config. You may put common subsections
# into a special top-level [ui] section. The values will be merged into every
# individual UI section
# configuration for cli and gui2
[ui]
[[intro]]
# default: Buchschloss\n\nhttps://github.com/mik2k2/buchschloss
text = """Buchschloss
Example config"""
# configuration for the gui2 user interface
[gui2]
# used to validate class entries.
# the string is converted to upper-case first
class regex = ^(EF|Q(1|2)|(10|[5-9])[A-Z]+)$
# shown on start
[[intro]]
# text set in [ui]
# default font: Times 70
[[actions]]
# Actions not listed here won't be available via GUI.
# Do note that you may have good reason to e.g. not
# provide member searching or library viewing (to get the books,
# just search specifying the library)
# Script.execute is not available, because
# explicit script actions should be used instead.
# Borrow.view is omitted because one should access
# that through search, book or person information.
# Apart from that, this list contains all possible actions.
book = Book
member = Member
borrow = Borrow:new
return = Borrow:restitute
[[[leseclub]]]
return = leseclub:restitute!lua
borrow = leseclub:borrow!lua
[[[[admin]]]]
start = leseclub:start!lua
end = leseclub:end!lua
get_results = leseclub:get_results!lua
[[[new]]]
person = Person:new
library = Library:new
group = Group:new
script = Script:new
[[[search]]]
Person = Person:search
library = Library:search
group = Group:search
borrow = Borrow:search
script = Script:search
[[[view]]]
Person = Person:view
library = Library:view
group = Group:view
script = Script:view
[[[edit]]]
Person = Person:edit
library = Library:edit
group = Group:edit
activate_group = Group:activate
script = Script:edit
# default values for entry widgets
[[entry defaults]]
[[[Person]]]
max_borrow = 3
libraries = main
[[[Book]]]
medium = book
# font for normal use
[[font]]
family = Times
size = 30
[[widget size]]
[[[main]]]
height = 500
width = 700
[[[popup]]]
height = 450
width = 500
[lua]
[[whitelist]]
# note this list can be much more permissive than a typical one
# since the whole Lua interpreter is sandboxed
assert = ''
error = ''
getmetatable = ''
ipairs = ''
next = ''
pairs = ''
pcall = ''
rawequal = ''
rawget = ''
rawset = ''
setmetatable = ''
select = ''
tonumber = ''
tostring = ''
type = ''
xpcall = ''
string = *
table = *
math = *
[[[os]]]
date = ''
time = ''