rev |
line source |
bsw@730
|
1 -- ========================================================================
|
bsw@813
|
2 -- MANDATORY (MUST BE CAREFULLY CHECKED AND PROPERLY SET!)
|
bsw@730
|
3 -- ========================================================================
|
bsw@525
|
4
|
bsw@813
|
5 -- Name of this instance, defaults to name of config file
|
bsw@813
|
6 -- ------------------------------------------------------------------------
|
bsw@813
|
7 config.instance_name = "Instance name"
|
bsw@813
|
8
|
bsw@813
|
9
|
bsw@731
|
10 -- Information about service provider (HTML)
|
bsw@730
|
11 -- ------------------------------------------------------------------------
|
bsw/jbe@0
|
12 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
|
bsw/jbe@0
|
13
|
bsw@813
|
14
|
bsw@1045
|
15 -- A HTML formatted text the user has to accept while registering
|
bsw@730
|
16 -- ------------------------------------------------------------------------
|
bsw@1045
|
17 config.use_terms = "<h1>Terms of Use</h1><p>Insert terms here</p>"
|
bsw@88
|
18
|
bsw@813
|
19
|
bsw@729
|
20 -- Checkbox(es) the user has to accept while registering
|
bsw@730
|
21 -- ------------------------------------------------------------------------
|
bsw@79
|
22 config.use_terms_checkboxes = {
|
bsw@79
|
23 {
|
jbe@232
|
24 name = "terms_of_use_v1",
|
jbe@232
|
25 html = "I accept the terms of use.",
|
jbe@232
|
26 not_accepted_error = "You have to accept the terms of use to be able to register."
|
bsw@734
|
27 },
|
bsw@734
|
28 -- {
|
bsw@734
|
29 -- name = "extra_terms_of_use_v1",
|
bsw@734
|
30 -- html = "I accept the extra terms of use.",
|
bsw@734
|
31 -- not_accepted_error = "You have to accept the extra terms of use to be able to register."
|
bsw@734
|
32 -- }
|
bsw@79
|
33 }
|
bsw@813
|
34
|
bsw@735
|
35
|
bsw@813
|
36 -- Absolute base url of application
|
bsw@813
|
37 -- ------------------------------------------------------------------------
|
bsw@813
|
38 config.absolute_base_url = "http://example.com/"
|
bsw@813
|
39
|
bsw@813
|
40
|
bsw@813
|
41 -- Connection information for the LiquidFeedback database
|
bsw@813
|
42 -- ------------------------------------------------------------------------
|
bsw@813
|
43 config.database = { engine='postgresql', dbname='liquid_feedback' }
|
bsw@813
|
44
|
bsw@813
|
45
|
bsw@735
|
46 -- Location of the rocketwiki binaries
|
bsw@735
|
47 -- ------------------------------------------------------------------------
|
bsw@1045
|
48 config.enforce_formatting_engine = "markdown2"
|
bsw@1045
|
49 config.formatting_engines = {
|
bsw@1045
|
50 { id = "markdown2",
|
bsw@1045
|
51 name = "python-markdown2",
|
bsw@1045
|
52 executable = "markdown2",
|
bsw@1052
|
53 args = {'-s', 'escape', '-x', 'nofollow,wiki-tables'},
|
bsw@1045
|
54 remove_images = true
|
bsw@1045
|
55 },
|
bsw@1045
|
56 { id = "markdown_py",
|
bsw@1045
|
57 name = "Python Markdown",
|
bsw@1045
|
58 executable = "markdown_py",
|
bsw@1045
|
59 args = {'-s', 'escape', '-x', 'extra', '-x', 'nl2br', '-x', 'sane_lists'},
|
bsw@1045
|
60 remove_images = true
|
bsw@1045
|
61 },
|
bsw@1045
|
62 { id = "rocketwiki",
|
bsw@1045
|
63 name = "RocketWiki",
|
bsw@1045
|
64 executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb"
|
bsw@1045
|
65 },
|
bsw@1045
|
66 { id = "compat",
|
bsw@1045
|
67 name = "Traditional WIKI syntax",
|
bsw@1045
|
68 executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat"
|
bsw@1045
|
69 },
|
bsw@1045
|
70
|
bsw@735
|
71 }
|
bsw@79
|
72
|
bsw/jbe@6
|
73
|
bsw@813
|
74 -- Public access level
|
bsw@734
|
75 -- ------------------------------------------------------------------------
|
bsw@813
|
76 -- Available options:
|
bsw@813
|
77 -- "none"
|
bsw@813
|
78 -- -> Closed user group, no public access at all
|
bsw@813
|
79 -- (except login/registration/password reset)
|
bsw@813
|
80 -- "anonymous"
|
bsw@813
|
81 -- -> Shows only initiative/suggestions texts and aggregated
|
bsw@813
|
82 -- supporter/voter counts
|
bsw@813
|
83 -- "authors_pseudonymous"
|
bsw@813
|
84 -- -> Like anonymous, but shows screen names of authors
|
bsw@813
|
85 -- "all_pseudonymous"
|
bsw@813
|
86 -- -> Show everything a member can see, except profile pages
|
bsw@813
|
87 -- "everything"
|
bsw@813
|
88 -- -> Show everything a member can see, including profile pages
|
bsw@813
|
89 -- ------------------------------------------------------------------------
|
bsw@813
|
90 config.public_access = "none"
|
bsw@734
|
91
|
bsw@737
|
92
|
bsw@732
|
93
|
bsw@737
|
94 -- ========================================================================
|
bsw@737
|
95 -- OPTIONAL
|
bsw@737
|
96 -- Remove leading -- to use a option
|
bsw@737
|
97 -- ========================================================================
|
bsw@731
|
98
|
bsw@1071
|
99 -- Disable registration
|
bsw@1071
|
100 -- ------------------------------------------------------------------------
|
bsw@1071
|
101 -- Available options:
|
bsw@1071
|
102 -- false: registration is enabled (default)
|
bsw@1071
|
103 -- true: registration is disabled
|
bsw@1071
|
104 -- ------------------------------------------------------------------------
|
bsw@1071
|
105 -- config.disable_registration = true
|
bsw@1071
|
106
|
bsw@729
|
107 -- List of enabled languages, defaults to available languages
|
bsw@730
|
108 -- ------------------------------------------------------------------------
|
bsw@876
|
109 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'nl', 'zh-Hans', 'zh-TW' }
|
bsw@2
|
110
|
bsw@729
|
111 -- Default language, defaults to "en"
|
bsw@730
|
112 -- ------------------------------------------------------------------------
|
bsw@729
|
113 -- config.default_lang = "en"
|
poelzi@163
|
114
|
bsw@734
|
115 -- after how long is a user considered inactive and the trustee will see warning,
|
bsw@734
|
116 -- notation is according to postgresql intervals, default: no warning at all
|
bsw@730
|
117 -- ------------------------------------------------------------------------
|
bsw@729
|
118 -- config.delegation_warning_time = '6 months'
|
bsw/jbe@6
|
119
|
bsw@988
|
120 -- after which time a user is advised (_soft) or forced (_hard) to check
|
bsw@988
|
121 -- unit and area delegations. default: no check at all
|
bsw@988
|
122 -- ------------------------------------------------------------------------
|
bsw@988
|
123 -- config.check_delegations_interval_hard = "6 months"
|
bsw@988
|
124 -- config.check_delegations_interval_soft = "3 months"
|
bsw@988
|
125
|
bsw@988
|
126 -- default option when checking delegations
|
bsw@988
|
127 -- available options: "confirm", "revoke" and "none", default: "confirm"
|
bsw@988
|
128 -- ------------------------------------------------------------------------
|
bsw@988
|
129 -- config.check_delegations_default = "confirm"
|
bsw@988
|
130
|
bsw@734
|
131 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
|
bsw@730
|
132 -- ------------------------------------------------------------------------
|
bsw@729
|
133 -- config.mail_subject_prefix = "[LiquidFeedback] "
|
bsw@734
|
134
|
bsw@734
|
135 -- Sender of all automatic mails, defaults to system defaults
|
bsw@734
|
136 -- ------------------------------------------------------------------------
|
bsw@839
|
137 -- config.mail_envelope_from = "liquidfeedback@example.com"
|
bsw@839
|
138 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
|
bsw@839
|
139 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
|
bsw/jbe@6
|
140
|
bsw@905
|
141 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
|
bsw@905
|
142 -- ------------------------------------------------------------------------
|
bsw@905
|
143 -- config.password_hash_algorithm = "crypt_sha512"
|
bsw@905
|
144 -- config.password_hash_algorithm = "crypt_sha256"
|
bsw@905
|
145 -- config.password_hash_algorithm = "crypt_md5"
|
bsw@905
|
146
|
bsw@905
|
147 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
|
bsw@905
|
148 -- (defaults to minimum 10000 and maximum 20000)
|
bsw@905
|
149 -- ------------------------------------------------------------------------
|
bsw@905
|
150 -- config.password_hash_min_rounds = 10000
|
bsw@905
|
151 -- config.password_hash_max_rounds = 20000
|
bsw@905
|
152
|
bsw@905
|
153
|
bsw@729
|
154 -- Supply custom url for avatar/photo delivery
|
bsw@730
|
155 -- ------------------------------------------------------------------------
|
bsw@729
|
156 -- config.fastpath_url_func = nil
|
bsw@51
|
157
|
bsw@729
|
158 -- Local directory for database dumps offered for download
|
bsw@730
|
159 -- ------------------------------------------------------------------------
|
bsw@729
|
160 -- config.download_dir = nil
|
bsw@51
|
161
|
bsw@729
|
162 -- Special use terms for database dump download
|
bsw@730
|
163 -- ------------------------------------------------------------------------
|
bsw@729
|
164 -- config.download_use_terms = "=== Download use terms ===\n"
|
bsw/jbe@52
|
165
|
bsw@734
|
166 -- Use custom image conversion, defaults to ImageMagick's convert
|
bsw@730
|
167 -- ------------------------------------------------------------------------
|
bsw@729
|
168 --config.member_image_content_type = "image/jpeg"
|
bsw@729
|
169 --config.member_image_convert_func = {
|
bsw@729
|
170 -- avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
|
bsw@729
|
171 -- photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
|
bsw@729
|
172 --}
|
bsw@51
|
173
|
bsw@1045
|
174 -- Display a html formatted public message of the day
|
bsw@837
|
175 -- ------------------------------------------------------------------------
|
bsw@1045
|
176 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
|
bsw@1045
|
177
|
bsw@1045
|
178 -- Display a html formatted internal message of the day
|
bsw@1045
|
179 -- ------------------------------------------------------------------------
|
bsw@1045
|
180 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
|
bsw@837
|
181
|
bsw@835
|
182 -- Automatic issue related discussion URL
|
bsw@835
|
183 -- ------------------------------------------------------------------------
|
bsw@835
|
184 -- config.issue_discussion_url_func = function(issue)
|
bsw@835
|
185 -- return "http://example.com/discussion/issue_" .. tostring(issue.id)
|
bsw@835
|
186 -- end
|
bsw@835
|
187
|
bsw@734
|
188 -- Integration of Etherpad, disabled by default
|
bsw@730
|
189 -- ------------------------------------------------------------------------
|
bsw@729
|
190 --config.etherpad = {
|
bsw@729
|
191 -- base_url = "http://example.com:9001/",
|
bsw@729
|
192 -- api_base = "http://localhost:9001/",
|
bsw@729
|
193 -- api_key = "mysecretapikey",
|
bsw@729
|
194 -- group_id = "mygroupname",
|
bsw@729
|
195 -- cookie_path = "/"
|
bsw@729
|
196 --}
|
bsw@51
|
197
|
bsw@961
|
198 -- Free timings
|
bsw@961
|
199 -- ------------------------------------------------------------------------
|
bsw@961
|
200 -- This example expects a date string entered in the free timing field
|
bsw@961
|
201 -- by the user creating a poll, interpreting it as target date for then
|
bsw@961
|
202 -- poll and splits the remaining time at the ratio of 4:1:2
|
bsw@961
|
203 -- Please note, polling policies never have an admission phase
|
bsw@961
|
204 -- The available_func is optional, if not set any target date is allowed
|
bsw@961
|
205
|
bsw@961
|
206 config.free_timing = {
|
bsw@961
|
207 calculate_func = function(policy, timing_string)
|
bsw@961
|
208 function interval_by_seconds(secs)
|
bsw@961
|
209 local secs_per_day = 60 * 60 * 24
|
bsw@961
|
210 local days
|
bsw@961
|
211 days = math.floor(secs / secs_per_day)
|
bsw@961
|
212 secs = secs - days * secs_per_day
|
bsw@961
|
213 return days .. " days " .. secs .. " seconds"
|
bsw@961
|
214 end
|
bsw@961
|
215 local target_date = parse.date(timing_string, atom.date)
|
bsw@961
|
216 if not target_date then
|
bsw@961
|
217 return false
|
bsw@961
|
218 end
|
bsw@961
|
219 local target_timestamp = target_date.midday
|
bsw@961
|
220 local now = atom.timestamp:get_current()
|
bsw@961
|
221 trace.debug(target_timestamp, now)
|
bsw@961
|
222 local duration = target_timestamp - now
|
bsw@961
|
223 if duration < 0 then
|
bsw@961
|
224 return false
|
bsw@961
|
225 end
|
bsw@961
|
226 return {
|
bsw@961
|
227 discussion = interval_by_seconds(duration / 7 * 4),
|
bsw@961
|
228 verification = interval_by_seconds(duration / 7 * 1),
|
bsw@961
|
229 voting = interval_by_seconds(duration / 7 * 2)
|
bsw@961
|
230 }
|
bsw@961
|
231 end,
|
bsw@961
|
232 available_func = function(policy)
|
bsw@961
|
233 return {
|
bsw@961
|
234 { name = "End of 2013", id = '2013-12-31' },
|
bsw@961
|
235 { name = "End of 2014", id = '2014-12-31' },
|
bsw@961
|
236 { name = "End of 2015", id = '2015-12-31' }
|
bsw@961
|
237 }
|
bsw@961
|
238 end
|
bsw@961
|
239 }
|
bsw@961
|
240
|
bsw@1106
|
241 -- Admin logger
|
bsw@1106
|
242 -- ------------------------------------------------------------------------
|
bsw@1106
|
243 -- Logging administrative activities
|
bsw@1106
|
244 -- disabled by default
|
bsw@1106
|
245
|
bsw@1106
|
246 --[[
|
bsw@1106
|
247 config.admin_logger = function(params)
|
bsw@1106
|
248
|
bsw@1106
|
249 local adminid = app.session.member_id
|
bsw@1106
|
250 local adminname = app.session.member.name
|
bsw@1107
|
251 local url = params._webmcp_path
|
bsw@1106
|
252
|
bsw@1106
|
253 -- do something (e.g. calling 'logger' via extos.pfilter)
|
bsw@1106
|
254
|
bsw@1106
|
255 end
|
bsw@1106
|
256 --]]
|
bsw@1106
|
257
|
bsw@1106
|
258
|
bsw@729
|
259 -- WebMCP accelerator
|
bsw/jbe@0
|
260 -- uncomment the following two lines to use C implementations of chosen
|
bsw/jbe@0
|
261 -- functions and to disable garbage collection during the request, to
|
bsw/jbe@0
|
262 -- increase speed:
|
bsw@730
|
263 -- ------------------------------------------------------------------------
|
bsw@729
|
264 -- require 'webmcp_accelerator'
|
bsw@806
|
265 -- if cgi then collectgarbage("stop") end
|
bsw/jbe@0
|
266
|
bsw@868
|
267 -- Trace debug
|
bsw@868
|
268 -- uncomment the following line to enable debug trace
|
bsw@868
|
269 -- config.enable_debug_trace = true
|
bsw/jbe@0
|
270
|
bsw@730
|
271 -- ========================================================================
|
bsw@734
|
272 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
|
bsw@730
|
273 -- ========================================================================
|
bsw@730
|
274
|
bsw@729
|
275 execute.config("init")
|