liquid_feedback_frontend

view config/example.lua @ 1166:fc9169c980d5

Added missing local statement
author bsw
date Tue Mar 24 16:31:22 2015 +0100 (2015-03-24)
parents cc34ccd202b8
children 2888bdc21ed5
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 config.use_terms_checkboxes = {
23 {
24 name = "terms_of_use_v1",
25 html = "I accept the terms of use.",
26 not_accepted_error = "You have to accept the terms of use to be able to register."
27 },
28 -- {
29 -- name = "extra_terms_of_use_v1",
30 -- html = "I accept the extra terms of use.",
31 -- not_accepted_error = "You have to accept the extra terms of use to be able to register."
32 -- }
33 }
36 -- Absolute base url of application
37 -- ------------------------------------------------------------------------
38 config.absolute_base_url = "http://example.com/"
41 -- Connection information for the LiquidFeedback database
42 -- ------------------------------------------------------------------------
43 config.database = { engine='postgresql', dbname='liquid_feedback' }
46 -- Location of the rocketwiki binaries
47 -- ------------------------------------------------------------------------
48 config.enforce_formatting_engine = "markdown2"
49 config.formatting_engines = {
50 { id = "markdown2",
51 name = "python-markdown2",
52 executable = "markdown2",
53 args = {'-s', 'escape', '-x', 'nofollow,wiki-tables'},
54 remove_images = true
55 },
56 { id = "markdown_py",
57 name = "Python Markdown",
58 executable = "markdown_py",
59 args = {'-s', 'escape', '-x', 'extra', '-x', 'nl2br', '-x', 'sane_lists'},
60 remove_images = true
61 },
62 { id = "rocketwiki",
63 name = "RocketWiki",
64 executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb"
65 },
66 { id = "compat",
67 name = "Traditional WIKI syntax",
68 executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat"
69 },
71 }
74 -- Public access level
75 -- ------------------------------------------------------------------------
76 -- Available options:
77 -- "none"
78 -- -> Closed user group, no public access at all
79 -- (except login/registration/password reset)
80 -- "anonymous"
81 -- -> Shows only initiative/suggestions texts and aggregated
82 -- supporter/voter counts
83 -- "authors_pseudonymous"
84 -- -> Like anonymous, but shows screen names of authors
85 -- "all_pseudonymous"
86 -- -> Show everything a member can see, except profile pages
87 -- "everything"
88 -- -> Show everything a member can see, including profile pages
89 -- ------------------------------------------------------------------------
90 config.public_access = "none"
94 -- ========================================================================
95 -- OPTIONAL
96 -- Remove leading -- to use a option
97 -- ========================================================================
99 -- Disable registration
100 -- ------------------------------------------------------------------------
101 -- Available options:
102 -- false: registration is enabled (default)
103 -- true: registration is disabled
104 -- ------------------------------------------------------------------------
105 -- config.disable_registration = true
107 -- List of enabled languages, defaults to available languages
108 -- ------------------------------------------------------------------------
109 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'ka', 'nl', 'zh-Hans', 'zh-TW' }
111 -- Default language, defaults to "en"
112 -- ------------------------------------------------------------------------
113 -- config.default_lang = "en"
115 -- after how long is a user considered inactive and the trustee will see warning,
116 -- notation is according to postgresql intervals, default: no warning at all
117 -- ------------------------------------------------------------------------
118 -- config.delegation_warning_time = '6 months'
120 -- after which time a user is advised (_soft) or forced (_hard) to check
121 -- unit and area delegations. default: no check at all
122 -- ------------------------------------------------------------------------
123 -- config.check_delegations_interval_hard = "6 months"
124 -- config.check_delegations_interval_soft = "3 months"
126 -- default option when checking delegations
127 -- available options: "confirm", "revoke" and "none", default: "confirm"
128 -- ------------------------------------------------------------------------
129 -- config.check_delegations_default = "confirm"
131 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
132 -- ------------------------------------------------------------------------
133 -- config.mail_subject_prefix = "[LiquidFeedback] "
135 -- Sender of all automatic mails, defaults to system defaults
136 -- ------------------------------------------------------------------------
137 -- config.mail_envelope_from = "liquidfeedback@example.com"
138 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
139 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
141 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
142 -- ------------------------------------------------------------------------
143 -- config.password_hash_algorithm = "crypt_sha512"
144 -- config.password_hash_algorithm = "crypt_sha256"
145 -- config.password_hash_algorithm = "crypt_md5"
147 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
148 -- (defaults to minimum 10000 and maximum 20000)
149 -- ------------------------------------------------------------------------
150 -- config.password_hash_min_rounds = 10000
151 -- config.password_hash_max_rounds = 20000
154 -- Supply custom url for avatar/photo delivery
155 -- ------------------------------------------------------------------------
156 -- config.fastpath_url_func = nil
158 -- Local directory for database dumps offered for download
159 -- ------------------------------------------------------------------------
160 -- config.download_dir = nil
162 -- Special use terms for database dump download
163 -- ------------------------------------------------------------------------
164 -- config.download_use_terms = "=== Download use terms ===\n"
166 -- Use custom image conversion, defaults to ImageMagick's convert
167 -- ------------------------------------------------------------------------
168 --config.member_image_content_type = "image/jpeg"
169 --config.member_image_convert_func = {
170 -- avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
171 -- photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
172 --}
174 -- Display a html formatted public message of the day
175 -- ------------------------------------------------------------------------
176 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
178 -- Display a html formatted internal message of the day
179 -- ------------------------------------------------------------------------
180 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
182 -- Automatic issue related discussion URL
183 -- ------------------------------------------------------------------------
184 -- config.issue_discussion_url_func = function(issue)
185 -- return "http://example.com/discussion/issue_" .. tostring(issue.id)
186 -- end
188 -- Integration of Etherpad, disabled by default
189 -- ------------------------------------------------------------------------
190 --config.etherpad = {
191 -- base_url = "http://example.com:9001/",
192 -- api_base = "http://localhost:9001/",
193 -- api_key = "mysecretapikey",
194 -- group_id = "mygroupname",
195 -- cookie_path = "/"
196 --}
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 config.free_timing = {
207 calculate_func = function(policy, timing_string)
208 local function interval_by_seconds(secs)
209 local secs_per_day = 60 * 60 * 24
210 local days
211 days = math.floor(secs / secs_per_day)
212 secs = secs - days * secs_per_day
213 return days .. " days " .. secs .. " seconds"
214 end
215 local target_date = parse.date(timing_string, atom.date)
216 if not target_date then
217 return false
218 end
219 local target_timestamp = target_date.midday
220 local now = atom.timestamp:get_current()
221 trace.debug(target_timestamp, now)
222 local duration = target_timestamp - now
223 if duration < 0 then
224 return false
225 end
226 return {
227 discussion = interval_by_seconds(duration / 7 * 4),
228 verification = interval_by_seconds(duration / 7 * 1),
229 voting = interval_by_seconds(duration / 7 * 2)
230 }
231 end,
232 available_func = function(policy)
233 return {
234 { name = "End of 2013", id = '2013-12-31' },
235 { name = "End of 2014", id = '2014-12-31' },
236 { name = "End of 2015", id = '2015-12-31' }
237 }
238 end
239 }
241 -- Admin logger
242 -- ------------------------------------------------------------------------
243 -- Logging administrative activities
244 -- disabled by default
246 --[[
247 config.admin_logger = function(params)
249 local adminid = app.session.member_id
250 local adminname = app.session.member.name
251 local url = params._webmcp_path
253 -- do something (e.g. calling 'logger' via extos.pfilter)
255 end
256 --]]
259 -- WebMCP accelerator
260 -- uncomment the following two lines to use C implementations of chosen
261 -- functions and to disable garbage collection during the request, to
262 -- increase speed:
263 -- ------------------------------------------------------------------------
264 -- require 'webmcp_accelerator'
265 -- if cgi then collectgarbage("stop") end
267 -- Trace debug
268 -- uncomment the following line to enable debug trace
269 -- config.enable_debug_trace = true
271 -- ========================================================================
272 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
273 -- ========================================================================
275 execute.config("init")

Impressum / About Us