liquid_feedback_frontend

view config/example.lua @ 1858:3d1f0464a3ea

Handle missing ldap.member.allowed function
author bsw
date Tue Sep 20 17:35:29 2022 +0200 (19 months ago)
parents 36fb14503a84
children
line source
1 -- ========================================================================
2 -- MANDATORY (MUST BE CAREFULLY CHECKED AND PROPERLY SET!)
3 -- ========================================================================
5 -- Absolute base url of application
6 -- ------------------------------------------------------------------------
7 config.absolute_base_url = "https://example.org/"
9 -- Connection information for the LiquidFeedback database
10 -- ------------------------------------------------------------------------
11 config.database = { engine='postgresql', dbname='liquid_feedback' }
13 -- Name of this instance, defaults to name of config file
14 -- ------------------------------------------------------------------------
15 config.instance_name = "Example Organisation"
17 -- Information about service provider (HTML)
18 -- ------------------------------------------------------------------------
19 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
21 -- Network interface to bind to
22 -- ------------------------------------------------------------------------
23 -- Available options:
24 -- true: bind to localhost (default)
25 -- false: bind to all interface
26 -- ------------------------------------------------------------------------
27 -- config.localhost = true
29 -- Network port to bind to, default port 8080
30 -- ------------------------------------------------------------------------
31 -- config.port = 8080
33 -- Serving content via IPV6
34 -- ------------------------------------------------------------------------
35 -- Available options:
36 -- nil or false: do not serve via IPv6 (default)
37 -- true: serve via IPv6
38 -- ------------------------------------------------------------------------
39 -- config.ipv6 = false
41 -- ========================================================================
42 -- OPTIONAL
43 -- Remove leading -- to use a option
44 -- ========================================================================
46 -- Public access level
47 -- ------------------------------------------------------------------------
48 -- Available options:
49 -- "none" (default)
50 -- -> Closed user group, no public access at all
51 -- (except login/registration/password reset)
52 -- "anonymous"
53 -- -> Shows only initiative/suggestions texts and aggregated
54 -- supporter/voter counts
55 -- "authors_pseudonymous"
56 -- -> Like anonymous, but shows screen names of authors
57 -- "all_pseudonymous"
58 -- -> Show everything a member can see, except profile pages
59 -- "everything"
60 -- -> Show everything a member can see, including profile pages
61 -- ------------------------------------------------------------------------
62 -- config.public_access = "none"
64 -- List of enabled languages, defaults to available languages
65 -- ------------------------------------------------------------------------
66 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'ka', 'nl', 'zh-Hans', 'zh-TW' }
68 -- Default language, defaults to "en"
69 -- ------------------------------------------------------------------------
70 -- config.default_lang = "en"
72 -- Disable registration
73 -- ------------------------------------------------------------------------
74 -- Available options:
75 -- false: registration is enabled (default)
76 -- true: registration is disabled
77 -- ------------------------------------------------------------------------
78 -- config.disable_registration = true
80 -- A HTML formatted text the user has to accept while registering
81 -- ------------------------------------------------------------------------
82 -- config.use_terms = "<h1>Terms of Use</h1><p>Insert terms here</p>"
84 -- Checkbox(es) the user has to accept while registering
85 -- ------------------------------------------------------------------------
86 -- config.use_terms_checkboxes = {
87 -- {
88 -- name = "terms_of_use_v1",
89 -- html = "I accept the terms of use.",
90 -- not_accepted_error = "You have to accept the terms of use to be able to register."
91 -- },
92 -- {
93 -- name = "extra_terms_of_use_v1",
94 -- html = "I accept the extra terms of use.",
95 -- not_accepted_error = "You have to accept the extra terms of use to be able to register."
96 -- }
97 -- }
99 -- after how long is a user considered inactive and the trustee will see warning,
100 -- notation is according to postgresql intervals, default: no warning at all
101 -- ------------------------------------------------------------------------
102 -- config.delegation_warning_time = '6 months'
104 -- after which time a user is advised (_soft) or forced (_hard) to check
105 -- unit and area delegations. default: no check at all
106 -- ------------------------------------------------------------------------
107 -- config.check_delegations_interval_soft = "3 months"
108 -- config.check_delegations_interval_hard = "6 months"
110 -- default option when checking delegations
111 -- available options: "confirm", "revoke" and "none", default: "confirm"
112 -- ------------------------------------------------------------------------
113 -- config.check_delegations_default = "confirm"
115 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
116 -- ------------------------------------------------------------------------
117 -- config.mail_subject_prefix = "[LiquidFeedback] "
119 -- Sender of all automatic mails, defaults to system defaults
120 -- ------------------------------------------------------------------------
121 -- config.mail_envelope_from = "liquidfeedback@example.com"
122 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
123 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
125 -- Template for digest emails
126 -- #{name} will be replaced by member screen name
127 -- #{digest} will be replaced with the digest content
128 -- ------------------------------------------------------------------------
129 -- config.notification_digest_template = [[
130 -- Hello #{name},
131 --
132 -- this is your personal digest.
133 --
134 -- #{digest}
135 -- ]]
137 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
138 -- ------------------------------------------------------------------------
139 -- config.password_hash_algorithm = "crypt_sha512"
140 -- config.password_hash_algorithm = "crypt_sha256"
141 -- config.password_hash_algorithm = "crypt_md5"
143 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
144 -- (defaults to minimum 10000 and maximum 20000)
145 -- ------------------------------------------------------------------------
146 -- config.password_hash_min_rounds = 10000
147 -- config.password_hash_max_rounds = 20000
149 -- Local directory for database dumps offered for download
150 -- ------------------------------------------------------------------------
151 -- config.download_dir = nil
153 -- Special use terms for database dump download
154 -- ------------------------------------------------------------------------
155 -- config.download_use_terms = "=== Download use terms ===\n"
157 -- Use custom image conversion, defaults to ImageMagick's convert
158 -- ------------------------------------------------------------------------
159 --config.member_image_content_type = "image/jpeg"
160 --config.member_image_convert_func = {
161 -- avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
162 -- photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
163 --}
165 -- Initiative attachments
166 -- ------------------------------------------------------------------------
167 -- config.attachments = {}
169 -- Conversion function for recoding attachments
170 -- ------------------------------------------------------------------------
171 -- config.attachments.convert_func = function(data)
172 -- return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-")
173 -- end
175 -- Custom UI colors, defaults to green/blue
176 -- ------------------------------------------------------------------------
177 -- config.style = {
178 -- color_md = {
179 -- primary = "green",
180 -- primary_contrast = "dark",
181 -- accent = "blue",
182 -- accent_contrast = "dark"
183 -- }
184 -- }
186 -- Member profile fields, defaults to no extra fields
187 -- ------------------------------------------------------------------------
188 -- config.member_profile_fields = {}
190 -- Display a html formatted public message of the day
191 -- ------------------------------------------------------------------------
192 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
194 -- Display a html formatted internal message of the day
195 -- ------------------------------------------------------------------------
196 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
198 -- Free timings
199 -- ------------------------------------------------------------------------
200 -- This example expects a date string entered in the free timing field
201 -- by the user creating a poll, interpreting it as target date for then
202 -- poll and splits the remaining time at the ratio of 4:1:2
203 -- Please note, polling policies never have an admission phase
204 -- The available_func is optional, if not set any target date is allowed
206 --[[
207 config.free_timing = {
208 calculate_func = function(policy, timing_string)
209 local function interval_by_seconds(secs)
210 local secs_per_day = 60 * 60 * 24
211 local days
212 days = math.floor(secs / secs_per_day)
213 secs = secs - days * secs_per_day
214 return days .. " days " .. secs .. " seconds"
215 end
216 local target_date = parse.date(timing_string, atom.date)
217 if not target_date then
218 return false
219 end
220 local target_timestamp = target_date.midday
221 local now = atom.timestamp:get_current()
222 trace.debug(target_timestamp, now)
223 local duration = target_timestamp - now
224 if duration < 0 then
225 return false
226 end
227 return {
228 discussion = interval_by_seconds(duration / 7 * 4),
229 verification = interval_by_seconds(duration / 7 * 1),
230 voting = interval_by_seconds(duration / 7 * 2)
231 }
232 end,
233 available_func = function(policy)
234 return {
235 { name = "End of 2013", id = '2013-12-31' },
236 { name = "End of 2014", id = '2014-12-31' },
237 { name = "End of 2015", id = '2015-12-31' }
238 }
239 end
240 }
241 --]]
243 -- External references
244 -- ------------------------------------------------------------------------
245 -- Rendering of external references
247 --[[
248 config.render_external_reference = {
249 draft = function(draft, wrapper)
250 wrapper(function()
251 ui.tag{ content = draft.external_reference)
252 end)
253 end,
254 initiative = function(initiative, wrapper)
255 wrapper(function()
256 ui.tag{ content = initiative.external_reference)
257 end)
258 end
259 end
260 --]]
262 -- Configuration of OAuth2 service, defaults to OAuth2 disabled
263 -- ------------------------------------------------------------------------
264 -- config.oauth2 = {}
266 -- Additional scopes
267 -- config.oauth2.available_scopes = {
268 -- { scope = "privA", name = { de = "Beispielprivileg A", en = "Example privilege A" } },
269 -- { scope = "privB", name = { de = "Beispielprivileg B", en = "Example privilege B" } }
270 -- }
272 -- OAuth2 endpoint magic string for dynamic app registration
273 -- ------------------------------------------------------------------------
274 -- config.oauth2.endpoint_magic = "liquidfeedback_client_redirection_endpoint"
276 -- OAuth2 Token lifetime and timings
277 -- ------------------------------------------------------------------------
278 -- config.oauth2.authorization_code_lifetime = 5 * 60
279 -- config.oauth2.refresh_token_lifetime = 60 * 60 * 24 * 30 * 3
280 -- config.oauth2.refresh_pause = 60
281 -- config.oauth2.refresh_grace_period = 60
282 -- config.oauth2.access_token_lifetime = 60 * 60
284 -- Admin logger
285 -- ------------------------------------------------------------------------
286 -- Logging administrative activities
287 -- disabled by default
289 -- config.admin_logger = function(params)
290 -- local adminid = app.session.member_id
291 -- local adminname = app.session.member.name
292 -- local url = params._webmcp_path
293 -- -- do something (e.g. calling 'logger' via extos.pfilter)
294 -- end
296 -- Application server fork configuration
297 -- ------------------------------------------------------------------------
298 -- config.fork = {
299 -- pre = 2, -- desired number of spare (idle) processes
300 -- min = 4, -- minimum number of processes
301 -- max = 128, -- maximum number of processes (hard limit)
302 -- delay = 0.125, -- delay (seconds) between creation of spare processes
303 -- error_delay = 2, -- delay (seconds) before retry of failed process creation
304 -- exit_delay = 2, -- delay (seconds) between destruction of excessive spare processes
305 -- idle_timeout = 900, -- idle time (seconds) after a fork gets terminated (0 for no timeout)
306 -- memory_limit = 0, -- maximum memory consumption (bytes) before process gets terminated
307 -- min_requests = 50, -- minimum count of requests handled before fork is terminated
308 -- max_requests = 100 -- maximum count of requests handled before fork is terminated
309 -- }
311 -- HTTP server options
312 -- ------------------------------------------------------------------------
313 -- http_options = {
314 -- static_headers = {} -- string or table of static headers to be returned with every request
315 -- request_header_size_limit = 1024*1024, -- maximum size of request body sent by client
316 -- request_body_size_limit = 64*1024*1024, -- maximum size of request body sent by client
317 -- idle_timeout = 65, -- maximum time until receiving the first byte of the request headera
318 -- stall_timeout = 60, -- maximum time a client connection may be stalled
319 -- request_header_timeout = 120, -- maximum time until receiving the remaining bytes of the request header
320 -- response_timeout = 3600, -- time in which request body and response must be sent
321 -- maximum_input_chunk_size = 16384 -- tweaks behavior of request-body parser
322 -- minimum_output_chunk_size = 1024 -- chunk size for chunked-transfer-encoding
323 -- }
325 -- WebMCP accelerator
326 -- ------------------------------------------------------------------------
327 -- uncomment the following line to use C implementations of chosen
328 -- functions:
329 -- ------------------------------------------------------------------------
330 -- require 'webmcp_accelerator'
332 -- Trace debug
333 -- ------------------------------------------------------------------------
334 -- uncomment the following line to enable debug trace
335 -- ------------------------------------------------------------------------
336 -- config.enable_debug_trace = true
338 -- Configuration of lf4rcs, disabled by default
339 -- for example configration see _lf4rcs.lua
340 -- ------------------------------------------------------------------------
341 -- execute.config("_lf4rcs")
343 -- Configuration of ldap authentication, disabled by default
344 -- for example configration, see _ldap.lua
345 -- for active directory example, see _ldap_ad.lua
346 -- ------------------------------------------------------------------------
347 -- execute.config("_ldap")
348 -- execute.config("_ldap_ad")
350 -- Integration of Etherpad, disabled by default
351 -- ------------------------------------------------------------------------
352 --config.etherpad = {
353 -- base_url = "http://example.com:9001/",
354 -- api_base = "http://localhost:9001/",
355 -- api_key = "mysecretapikey",
356 -- group_id = "mygroupname",
357 -- cookie_path = "/"
358 --}
360 -- Integration of FirstLife
361 -- ------------------------------------------------------------------------
362 --[[
363 config.firstlife = {
364 coordinates = "",
365 areaviewer_url = "about:blank",
366 inputmap_url = "about:blank"
367 }
368 config.allow_new_draft_callback = true
369 --]]

Impressum / About Us