config.py.example 7.95 KB
Newer Older
Robin Sonnabend's avatar
Robin Sonnabend committed
1
2
# (local) database
SQLALCHEMY_DATABASE_URI = "postgresql://user:password@host/database" # change this
Robin Sonnabend's avatar
Robin Sonnabend committed
3
4
#SQLALCHEMY_DATABASE_URI = "mysql://user:password@host/database"
#SQLALCHEMY_DATABASE_URI = "sqlite:///path/to/database.db"
Robin Sonnabend's avatar
Robin Sonnabend committed
5
SQLALCHEMY_TRACK_MODIFICATIONS = False # do not change
6

Robin Sonnabend's avatar
Robin Sonnabend committed
7
SECRET_KEY = "something random" # change this
8

9
10
11
SERVER_NAME = "protokolle.example.com"
PREFERRED_URL_SCHEME = "https" # change to http for development

12
DEBUG = False # do not change
13

Robin Sonnabend's avatar
Robin Sonnabend committed
14
# mailserver (optional)
15
16
17
MAIL_ACTIVE = True
MAIL_FROM = "protokolle@example.com"
MAIL_HOST = "mail.example.com:465"
18
19
20
MAIL_USER = "user" # set to "" for unauthenticated sending
MAIL_PASSWORD = "password" # set to "" for unauthenticated sending
MAIL_USE_TLS = True # should match the port in MAIL_HOST (if present there)
21
MAIL_USE_STARTTLS = False # Usually, it's either this or SMTPS, not both
22

Robin Sonnabend's avatar
Robin Sonnabend committed
23
# (local) message queue (necessary)
24
CELERY_BROKER_URL = "redis://localhost:6379/0" # change this if you do not use redis or it is running somewhere else
Robin Sonnabend's avatar
Robin Sonnabend committed
25
26
CELERY_TASK_SERIALIZER = "pickle" # do not change
CELERY_ACCEPT_CONTENT = ["pickle"] # do not change
27

Robin Sonnabend's avatar
Robin Sonnabend committed
28
# CUPS printserver (optional)
Robin Sonnabend's avatar
Robin Sonnabend committed
29
30
31
PRINTING_ACTIVE = True
PRINTING_SERVER = "printsrv.example.com:631"
PRINTING_USER = "protocols"
32
PRINTING_PRINTERS = {
Robin Sonnabend's avatar
Robin Sonnabend committed
33
34
    "example_printer": ["Duplex=DuplexNoTumble", "option2=value"],
    "other_printer": ["list", "of", "options"]
35
}
Robin Sonnabend's avatar
Robin Sonnabend committed
36

Robin Sonnabend's avatar
Robin Sonnabend committed
37
38
# etherpad (optional)
ETHERPAD_ACTIVE = True
39
ETHERPAD_URL = "https://example.com/etherpad" # without /p/…
Robin Sonnabend's avatar
Robin Sonnabend committed
40
41
42
43
44
45
46
47
EMPTY_ETHERPAD = """Welcome to Etherpad!

This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!

Get involved with Etherpad at http://etherpad.org

""" # do not change

Robin Sonnabend's avatar
Robin Sonnabend committed
48
# wiki (optional)
Robin Sonnabend's avatar
Robin Sonnabend committed
49
WIKI_ACTIVE = True
50
WIKI_TYPE = "MEDIAWIKI"
Robin Sonnabend's avatar
Robin Sonnabend committed
51
52
53
54
55
56
WIKI_API_URL = "https://wiki.example.com/wiki/api.php"
WIKI_ANONYMOUS = False
WIKI_USER = "user"
WIKI_PASSWORD = "password"
WIKI_DOMAIN = "domain" # set to None if not necessary

Robin Sonnabend's avatar
Robin Sonnabend committed
57
58
59
60
# CalDAV calendar (optional)
CALENDAR_ACTIVE = True
CALENDAR_URL = "https://user:password@calendar.example.com/dav/"
CALENDAR_DEFAULT_DURATION = 3 # default meeting length in hours
61
CALENDAR_MAX_REQUESTS = 10 # number of retries before giving up (some caldav servers like to randomly reply with errors)
Robin Sonnabend's avatar
Robin Sonnabend committed
62

63
64
65
66
67
CALENDAR_TIMEZONE_MAP = {
    "CET": "Europe/Berlin",
    "CEST": "Europe/Berlin",
}

Robin Sonnabend's avatar
Robin Sonnabend committed
68
SESSION_PROTECTION = "strong" # do not change
Robin Sonnabend's avatar
Robin Sonnabend committed
69

Robin Sonnabend's avatar
Robin Sonnabend committed
70
# authentication
Robin Sonnabend's avatar
Robin Sonnabend committed
71
SECURITY_KEY = "some other random string" # change this
Robin Sonnabend's avatar
Robin Sonnabend committed
72
AUTH_MAX_DURATION = 300
73
from auth import LdapManager, ADManager, StaticUserManager
Robin Sonnabend's avatar
Robin Sonnabend committed
74
75
76
77
78
79
80
81
82
AUTH_BACKENDS = [
    LdapManager(
        host="ldap.example.com",
        user_dn="uid={},ou=users,dc=example,dc=com",
        group_dn="dc=example,dc=com"),
    ADManager(
        host="ad.example.com",
        domain="EXAMPLE",
        user_dn="cn=users,dc=example,dc=com",
83
        group_dn="dc=example,dc=com",
84
85
86
87
        ca_cert="/etc/ssl/certs/example-ca.pem"),
    StaticUserManager(
        users=(
            ("username", "password", ("group1", "group2")),
Robin Sonnabend's avatar
Robin Sonnabend committed
88
            ("testuser", "abc123", ("group1",)),
89
        )
Robin Sonnabend's avatar
Robin Sonnabend committed
90
91
    ),
    PAMManager(),
Robin Sonnabend's avatar
Robin Sonnabend committed
92
]
Robin Sonnabend's avatar
Robin Sonnabend committed
93

94
OBSOLETION_WARNING = """Please migrate your account!""" # not important
95

Robin Sonnabend's avatar
Robin Sonnabend committed
96
# lines of error description
97
ERROR_CONTEXT_LINES = 3
98

Robin Sonnabend's avatar
Robin Sonnabend committed
99
# pagination
Robin Sonnabend's avatar
Robin Sonnabend committed
100
101
102
PAGE_LENGTH = 20
PAGE_DIFF = 3

Robin Sonnabend's avatar
Robin Sonnabend committed
103
104
# upcoming meetings within this number of days from today are shown on the index page
MAX_INDEX_DAYS = 14
105
106
MAX_PAST_INDEX_DAYS = 2
MAX_PAST_INDEX_DAYS_BEFORE_REMINDER = 14
Robin Sonnabend's avatar
Robin Sonnabend committed
107
108
109

# mail to contact in case of complex errors
ADMIN_MAIL = "admin@example.com"
110
# users with this group may see and do everything
111
ADMIN_GROUP = "admin"
Robin Sonnabend's avatar
Robin Sonnabend committed
112
113
114
115
116
117

# accept protocols even with some errors
# useful for importing old protocols
# not recommended for regular operation
PARSER_LAZY = False

118
# minimum similarity (0-100) todos need to have to be considered equal while importing
119
FUZZY_MIN_SCORE = 90
Robin Sonnabend's avatar
Robin Sonnabend committed
120

121
# choose something nice from fc-list
Robin Sonnabend's avatar
Robin Sonnabend committed
122
# Nimbus Sans looks very much like Computer Modern
123
124
FONTS = {
    "main": {
125
126
127
128
129
130
        "extension": ".otf",
        "path": "/usr/share/fonts/OTF/",
        "regular": "NimbusSans-Regular",
        "bold": "NimbusSans-Bold",
        "italic": "NimbusSans-Oblique",
        "bolditalic": "NimbusSans-BoldOblique"
131
132
    },
    "roman": {
133
134
135
136
137
138
        "extension": ".otf",
        "path": "/usr/share/fonts/OTF/",
        "regular": "NimbusRoman-Regular",
        "bold": "NimbusRoman-Bold",
        "italic": "NimbusRoman-Italic",
        "bolditalic": "NimbusRoman-BoldItalic"
139
140
    },
    "sans": {
141
142
143
144
145
146
        "extension": ".otf",
        "path": "/usr/share/fonts/OTF/",
        "regular": "NimbusSans-Regular",
        "bold": "NimbusSans-Bold",
        "italic": "NimbusSans-Oblique",
        "bolditalic": "NimbusSans-BoldOblique"
147
148
    },
    "mono": {
149
150
151
152
153
154
        "extension": ".otf",
        "path": "/usr/share/fonts/OTF/",
        "regular": "NimbusMonoPS-Regular",
        "bold": "NimbusMonoPS-Bold",
        "italic": "NimbusMonoPS-Italic",
        "bolditalic": "NimbusMonoPS-BoldItalic"
155
156
    }
}
Robin Sonnabend's avatar
Robin Sonnabend committed
157

158
# local filesystem path to save compiled and uploaded protocols (and attachments)
159
# create this path!
Robin Sonnabend's avatar
Robin Sonnabend committed
160
161
DOCUMENTS_PATH = "documents"

Robin Sonnabend's avatar
Robin Sonnabend committed
162
# keywords indicating private protocol parts
Robin Sonnabend's avatar
Robin Sonnabend committed
163
164
PRIVATE_KEYWORDS = ["private", "internal", "privat", "intern"]

Robin Sonnabend's avatar
Robin Sonnabend committed
165
# list of bulletpoints to use in latex
166
167
# these are latex-defaults, add more if you like more
# they are cycled as often as necessary to allow (theoretically) infinite nesting depth
168
169
170
171
172
173
LATEX_BULLETPOINTS = [
    r"\textbullet",
    r"\normalfont \bfseries \textendash",
    r"\textasteriskcentered",
    r"\textperiodcentered"
]
174

175
# optional: path to additional jinja-templates, will be need in combination with LATEX_TEMPLATES
176
177
178
179
180
181
182
183
184
185
186
#LATEX_LOCAL_TEMPLATES = "local-templates"
# optional: the template to include at the top of protocol.tex
#LATEX_LOGO_TEMPLATE = "asta-logo.tex"
# optional: custom protocol page geometry
#LATEX_GEOMETRY = "bottom=1.6cm,top=1.6cm,inner=2.5cm,outer=1.0cm,footskip=1.0cm,headsep=0.6cm"
# optional: custom protocol pagestyle
#LATEX_PAGESTYLE = "fancy"
# optional: additional latex packages
#LATEX_ADDITIONAL_PACKAGES = ["[absolute]{textpos}", "{fancyheadings}"]
# optional: include header and footer in asta-style, not just a page number on top
#LATEX_HEADER_FOOTER = True
187
188
189
190
191
# optional: define multiple LaTeX-templates to use with a each protocol type individually overiding the general LATEX options
# the LATEX_LOCAL_TEMPLATES parameter is need to provide the path for the templates
# each template must be placed in an individual folder named by its ID in LATEX_TEMPLATES and must contain the provided template files: e.g.
# - the files for the template "yourtemplate" need to be in the folder named "yourtemplate"
# - the templates provides the files: "protokoll2.cls" (class), "protocol.tex" (protocol), "decision.tex" (decision) and "asta-logo.tex"
192
193
194
#LATEX_TEMPLATES = {
#    "yourtemplate": {
#        "name": "Dein Template",
195
196
197
198
199
200
#        "provides": ["class", "protocol", "decision"], # optional: if this option is set the corresponding files must be provided
#        "logo": "asta-logo.tex", # optional: replaces the general template to include at the top of protocol.tex set by LATEX_LOGO_TEMPLATE
#        "geometry": "bottom=1.6cm,top=1.6cm,inner=2.5cm,outer=1.0cm,footskip=1.0cm,headsep=0.6cm", # optional: replaces the general protocol page geometry set by LATEX_GEOMETRY
#        "pagestyle": "fancy", # optional: replaces the general protocol pagestyle set by LATEX_PAGESTYLE
#        "additionalpackages": ["[absolute]{textpos}", "{fancyheadings}"], # optional: replaces the general latex packages set by LATEX_ADDITIONAL_PACKAGES
#        "headerfooter": True # optional: replaces the general LATEX_HEADER_FOOTER option
201
202
203
#    }
#}

204
205
206
207
208
HTML_LEVEL_OFFSET = 3

def dummy_todomail_provider():
    return {"example": ("Name", "mail@example.com")}

209
210
# if you want to generate this mapping automatically
# manually creating todomails through the web interface will still be possible for every authenticated user
211
212
213
214
# list of functions that return dicts mapping todomail-keys to a tuple containing name and mail address
ADDITIONAL_TODOMAIL_PROVIDERS = [
    dummy_todomail_provider
]