liquid_feedback_frontend

view config/example.lua @ 1223:526b8c82d5fb

Do not disable garbage collection for WebMCP acceleration
author jbe
date Tue Dec 01 14:38:48 2015 +0100 (2015-12-01)
parents a38df55525d6
children e0235b3d19ee
line source
1 -- ========================================================================
2 -- MANDATORY (MUST BE CAREFULLY CHECKED AND PROPERLY SET!)
3 -- ========================================================================
5 -- Name of this instance, defaults to name of config file
6 -- ------------------------------------------------------------------------
7 config.instance_name = "Instance name"
10 -- Information about service provider (HTML)
11 -- ------------------------------------------------------------------------
12 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
15 -- A HTML formatted text the user has to accept while registering
16 -- ------------------------------------------------------------------------
17 config.use_terms = "<h1>Terms of Use</h1><p>Insert terms here</p>"
20 -- Checkbox(es) the user has to accept while registering
21 -- ------------------------------------------------------------------------
22 --[[
23 config.use_terms_checkboxes = {
24 {
25 name = "terms_of_use_v1",
26 html = "I accept the terms of use.",
27 not_accepted_error = "You have to accept the terms of use to be able to register."
28 },
29 {
30 name = "extra_terms_of_use_v1",
31 html = "I accept the extra terms of use.",
32 not_accepted_error = "You have to accept the extra terms of use to be able to register."
33 }
34 }
35 --]]
37 -- Absolute base url of application
38 -- ------------------------------------------------------------------------
39 config.absolute_base_url = "http://example.com/"
40 config.localhost = false
43 -- Connection information for the LiquidFeedback database
44 -- ------------------------------------------------------------------------
45 config.database = { engine='postgresql', dbname='liquid_feedback' }
48 -- Location of the rocketwiki binaries
49 -- ------------------------------------------------------------------------
50 config.enforce_formatting_engine = "markdown2"
51 config.formatting_engines = {
52 { id = "markdown2",
53 name = "python-markdown2",
54 executable = "markdown2",
55 args = {'-s', 'escape', '-x', 'nofollow,wiki-tables'},
56 remove_images = true
57 },
58 -- { id = "markdown_py",
59 -- name = "Python Markdown",
60 -- executable = "markdown_py",
61 -- args = {'-s', 'escape', '-x', 'extra', '-x', 'nl2br', '-x', 'sane_lists'},
62 -- remove_images = true
63 -- },
64 -- { id = "rocketwiki",
65 -- name = "RocketWiki",
66 -- executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb"
67 -- },
68 -- { id = "compat",
69 -- name = "Traditional WIKI syntax",
70 -- executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat"
71 -- },
72 }
75 -- Public access level
76 -- ------------------------------------------------------------------------
77 -- Available options:
78 -- "none"
79 -- -> Closed user group, no public access at all
80 -- (except login/registration/password reset)
81 -- "anonymous"
82 -- -> Shows only initiative/suggestions texts and aggregated
83 -- supporter/voter counts
84 -- "authors_pseudonymous"
85 -- -> Like anonymous, but shows screen names of authors
86 -- "all_pseudonymous"
87 -- -> Show everything a member can see, except profile pages
88 -- "everything"
89 -- -> Show everything a member can see, including profile pages
90 -- ------------------------------------------------------------------------
91 config.public_access = "none"
95 -- ========================================================================
96 -- OPTIONAL
97 -- Remove leading -- to use a option
98 -- ========================================================================
100 -- Disable registration
101 -- ------------------------------------------------------------------------
102 -- Available options:
103 -- false: registration is enabled (default)
104 -- true: registration is disabled
105 -- ------------------------------------------------------------------------
106 -- config.disable_registration = true
109 -- List of enabled languages, defaults to available languages
110 -- ------------------------------------------------------------------------
111 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'ka', 'nl', 'zh-Hans', 'zh-TW' }
114 -- Default language, defaults to "en"
115 -- ------------------------------------------------------------------------
116 -- config.default_lang = "en"
119 -- after how long is a user considered inactive and the trustee will see warning,
120 -- notation is according to postgresql intervals, default: no warning at all
121 -- ------------------------------------------------------------------------
122 -- config.delegation_warning_time = '6 months'
125 -- after which time a user is advised (_soft) or forced (_hard) to check
126 -- unit and area delegations. default: no check at all
127 -- ------------------------------------------------------------------------
128 -- config.check_delegations_interval_hard = "6 months"
129 -- config.check_delegations_interval_soft = "3 months"
132 -- default option when checking delegations
133 -- available options: "confirm", "revoke" and "none", default: "confirm"
134 -- ------------------------------------------------------------------------
135 -- config.check_delegations_default = "confirm"
138 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
139 -- ------------------------------------------------------------------------
140 -- config.mail_subject_prefix = "[LiquidFeedback] "
143 -- Sender of all automatic mails, defaults to system defaults
144 -- ------------------------------------------------------------------------
145 -- config.mail_envelope_from = "liquidfeedback@example.com"
146 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
147 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
150 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
151 -- ------------------------------------------------------------------------
152 -- config.password_hash_algorithm = "crypt_sha512"
153 -- config.password_hash_algorithm = "crypt_sha256"
154 -- config.password_hash_algorithm = "crypt_md5"
157 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
158 -- (defaults to minimum 10000 and maximum 20000)
159 -- ------------------------------------------------------------------------
160 -- config.password_hash_min_rounds = 10000
161 -- config.password_hash_max_rounds = 20000
164 -- Supply custom url for avatar/photo delivery
165 -- ------------------------------------------------------------------------
166 -- config.fastpath_url_func = nil
169 -- Local directory for database dumps offered for download
170 -- ------------------------------------------------------------------------
171 -- config.download_dir = nil
174 -- Special use terms for database dump download
175 -- ------------------------------------------------------------------------
176 -- config.download_use_terms = "=== Download use terms ===\n"
179 -- Use custom image conversion, defaults to ImageMagick's convert
180 -- ------------------------------------------------------------------------
181 --config.member_image_content_type = "image/jpeg"
182 --config.member_image_convert_func = {
183 -- avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
184 -- photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
185 --}
188 -- Display a html formatted public message of the day
189 -- ------------------------------------------------------------------------
190 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
193 -- Display a html formatted internal message of the day
194 -- ------------------------------------------------------------------------
195 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
198 -- Automatic issue related discussion URL
199 -- ------------------------------------------------------------------------
200 -- config.issue_discussion_url_func = function(issue)
201 -- return "http://example.com/discussion/issue_" .. tostring(issue.id)
202 -- end
205 -- Integration of Etherpad, disabled by default
206 -- ------------------------------------------------------------------------
207 --config.etherpad = {
208 -- base_url = "http://example.com:9001/",
209 -- api_base = "http://localhost:9001/",
210 -- api_key = "mysecretapikey",
211 -- group_id = "mygroupname",
212 -- cookie_path = "/"
213 --}
216 -- Free timings
217 -- ------------------------------------------------------------------------
218 -- This example expects a date string entered in the free timing field
219 -- by the user creating a poll, interpreting it as target date for then
220 -- poll and splits the remaining time at the ratio of 4:1:2
221 -- Please note, polling policies never have an admission phase
222 -- The available_func is optional, if not set any target date is allowed
224 --[[
225 config.free_timing = {
226 calculate_func = function(policy, timing_string)
227 local function interval_by_seconds(secs)
228 local secs_per_day = 60 * 60 * 24
229 local days
230 days = math.floor(secs / secs_per_day)
231 secs = secs - days * secs_per_day
232 return days .. " days " .. secs .. " seconds"
233 end
234 local target_date = parse.date(timing_string, atom.date)
235 if not target_date then
236 return false
237 end
238 local target_timestamp = target_date.midday
239 local now = atom.timestamp:get_current()
240 trace.debug(target_timestamp, now)
241 local duration = target_timestamp - now
242 if duration < 0 then
243 return false
244 end
245 return {
246 discussion = interval_by_seconds(duration / 7 * 4),
247 verification = interval_by_seconds(duration / 7 * 1),
248 voting = interval_by_seconds(duration / 7 * 2)
249 }
250 end,
251 available_func = function(policy)
252 return {
253 { name = "End of 2013", id = '2013-12-31' },
254 { name = "End of 2014", id = '2014-12-31' },
255 { name = "End of 2015", id = '2015-12-31' }
256 }
257 end
258 }
259 --]]
261 -- Configuration of lf4rcs
262 -- ------------------------------------------------------------------------
263 -- config.lf4rc = {}
265 -- Example configuration for controlling a Git repository
266 --[[
267 config.lf4rcs.git = {
269 render_draft_reference = function(url, draft)
270 if not draft.external_reference then return end
271 ui.tag{ content = _"Changeset:" }
272 slot.put(" ")
273 ui.link{
274 text = draft.external_reference,
275 external = url .. ";a=commit;h=" .. draft.external_reference
276 }
277 end,
279 get_remote_user = function()
280 return os.getenv("REMOTE_USER")
281 end,
283 get_branches = function(path, exec)
284 local branches = {}
285 for line in io.lines() do
286 local oldrev, newrev, branch = string.match(line, "([^ ]+) ([^ ]+) refs/heads/(.+)")
287 if not branch then
288 return nil, "unexpected format from git hook environment"
289 end
290 branches[branch] = { newrev }
291 end
292 return branches
293 end,
295 commit = function(path, exec, branch, target_node_id, close_message, merge_message)
296 if merge_message then
297 exec("git", "-C", path, "checkout", "-f", "master")
298 exec("git", "-C", path, "merge", target_node_id, "-m", merge_message)
299 exec("git", "-C", path, "push", "origin", "master")
300 end
301 end
303 }
305 -- Example configuration for controlling a Mercurial repository
306 config.lf4rcs.hg = {
308 working_branch_name = "work",
310 render_draft_reference = function(url, draft)
311 if not draft.external_reference then return end
312 ui.tag{ content = _"Changeset graph:" }
313 slot.put(" ")
314 ui.link{
315 text = draft.external_reference,
316 external = url .. "/graph/" .. draft.external_reference
317 }
318 end,
320 get_remote_user = function()
321 return os.getenv("REMOTE_USER")
322 end,
324 get_branches = function(path, exec)
325 local first_node_id = os.getenv("HG_NODE")
326 if not first_node_id then
327 return nil, "internal error, no first node ID available"
328 end
329 local hg_log = exec(
330 "hg", "log", "-R", path, "-r", first_node_id .. ":", "--template", "{branches}\n"
331 )
332 local branches = {}
333 for branch in hg_log:gmatch("(.-)\n") do
334 if branch == "" then branch = "default" end
335 if not branches[branch] then
336 branches[branch] = {}
337 local head_lines = exec(
338 "hg", "heads", "-R", path, "--template", "{node}\n", branch
339 )
340 for node_id in string.gmatch(head_lines, "[^\n]+") do
341 table.insert(branches[branch], node_id)
342 end
343 end
344 end
345 return branches
346 end,
348 extra_checks = function(path, exec)
349 local result = exec("hg", "heads", "-t", "-c")
350 for branch in string.gmatch(result, "[^\n]+") do
351 if branch == lf4rcs.config.hg.working_branch_name then
352 return nil, "open head found for branch " .. lf4rcs.config.hg.working_branch_name
353 end
354 end
355 return true
356 end,
358 commit = function(path, exec, branch, target_node_id, close_message, merge_message)
359 exec("hg", "up", "-R", path, "-C", "-r", target_node_id)
360 exec("hg", "commit", "-R", path, "--close-branch", "-m", close_message)
361 if merge_message then
362 exec("hg", "up", "-R", path, "-C", "-r", "default")
363 exec("hg", "merge", "-R", path, "-r", "tip")
364 exec("hg", "commit", "-R", path, "-m", merge_message)
365 end
366 end
368 }
370 lf4rcs.init()
371 --]]
373 -- External references
374 -- ------------------------------------------------------------------------
375 -- Rendering of external references
377 --[[
378 config.render_external_reference = {
379 draft = function(draft, wrapper)
380 wrapper(function()
381 ui.tag{ content = draft.external_reference)
382 end)
383 end,
384 initiative = function(initiative, wrapper)
385 wrapper(function()
386 ui.tag{ content = initiative.external_reference)
387 end)
388 end
389 end
390 --]]
392 -- Admin logger
393 -- ------------------------------------------------------------------------
394 -- Logging administrative activities
395 -- disabled by default
397 --[[
398 config.admin_logger = function(params)
400 local adminid = app.session.member_id
401 local adminname = app.session.member.name
402 local url = params._webmcp_path
404 -- do something (e.g. calling 'logger' via extos.pfilter)
406 end
407 --]]
410 -- Network interface to bind to
411 -- ------------------------------------------------------------------------
412 -- Available options:
413 -- true: bind to localhost (default)
414 -- false: bind to all interface
415 -- ------------------------------------------------------------------------
416 -- config.localhost = true
419 -- Network port to bind to
420 -- ------------------------------------------------------------------------
421 -- config.port = 8080
424 -- Serving content via IPV6
425 -- ------------------------------------------------------------------------
426 -- Available options:
427 -- nil or false: do not serve via IPv6 (default)
428 -- true: serve via IPv6
429 -- ------------------------------------------------------------------------
430 -- config.ipv6 = false
433 -- Application server fork configuration
434 -- ------------------------------------------------------------------------
435 -- config.fork = {
436 -- pre = 2, -- desired number of spare (idle) processes
437 -- min = 4, -- minimum number of processes
438 -- max = 128, -- maximum number of processes (hard limit)
439 -- delay = 0.125, -- delay (seconds) between creation of spare processes
440 -- error_delay = 2, -- delay (seconds) before retry of failed process creation
441 -- exit_delay = 2, -- delay (seconds) between destruction of excessive spare processes
442 -- idle_timeout = 900, -- idle time (seconds) after a fork gets terminated (0 for no timeout)
443 -- memory_limit = 0, -- maximum memory consumption (bytes) before process gets terminated
444 -- min_requests = 50, -- minimum count of requests handled before fork is terminated
445 -- max_requests = 100 -- maximum count of requests handled before fork is terminated
446 -- }
449 -- HTTP server options
450 -- ------------------------------------------------------------------------
451 -- http_options = {
452 -- static_headers = {} -- string or table of static headers to be returned with every request
453 -- request_header_size_limit = 1024*1024, -- maximum size of request body sent by client
454 -- request_body_size_limit = 64*1024*1024, -- maximum size of request body sent by client
455 -- idle_timeout = 65, -- maximum time until receiving the first byte of the request headera
456 -- stall_timeout = 60, -- maximum time a client connection may be stalled
457 -- request_header_timeout = 120, -- maximum time until receiving the remaining bytes of the request header
458 -- response_timeout = 3600, -- time in which request body and response must be sent
459 -- maximum_input_chunk_size = 16384 -- tweaks behavior of request-body parser
460 -- minimum_output_chunk_size = 1024 -- chunk size for chunked-transfer-encoding
461 -- }
464 -- WebMCP accelerator
465 -- ------------------------------------------------------------------------
466 -- uncomment the following line to use C implementations of chosen
467 -- functions:
468 -- ------------------------------------------------------------------------
469 -- require 'webmcp_accelerator'
472 -- Trace debug
473 -- ------------------------------------------------------------------------
474 -- uncomment the following line to enable debug trace
475 -- ------------------------------------------------------------------------
476 -- config.enable_debug_trace = true

Impressum / About Us