liquid_feedback_frontend

annotate config/lf3.lua @ 1083:6639b4188d7d

Fixed initiative link in testing config
author bsw
date Wed Jul 23 23:08:53 2014 +0200 (2014-07-23)
parents 66da54c0ae6c
children
rev   line source
bsw@1045 1 -- ========================================================================
bsw@1045 2 -- MANDATORY (MUST BE CAREFULLY CHECKED AND PROPERLY SET!)
bsw@1045 3 -- ========================================================================
bsw@1045 4
bsw@1045 5 -- Name of this instance, defaults to name of config file
bsw@1045 6 -- ------------------------------------------------------------------------
bsw@1045 7 config.instance_name = "Public Software Group e.V."
bsw@1045 8
bsw@1045 9
bsw@1045 10 -- Information about service provider (HTML)
bsw@1045 11 -- ------------------------------------------------------------------------
bsw@1045 12 config.app_service_provider = [[
bsw@1045 13 Public Software Group e. V.<br />
bsw@1045 14 Johannisstr. 12<br />
bsw@1045 15 10117 Berlin<br />
bsw@1045 16 Germany<br /><br />
bsw@1045 17 eingetragen im Vereinsregister des Amtsgerichtes Charlottenburg unter der
bsw@1045 18 Registernummer VR 28873 B<br />
bsw@1045 19 vertreten durch die Vorstandsmitglieder Jan Behrens, Axel Kistner, Andreas
bsw@1045 20 Nitsche und Björn Swierczek jeweils mit Einzelvertretungsbefugnis
bsw@1045 21 ]]
bsw@1045 22
bsw@1045 23
bsw@1045 24 -- A HTML formatted text the user has to accept while registering
bsw@1045 25 -- ------------------------------------------------------------------------
bsw@1045 26 config.use_terms = [[
bsw@1045 27 <h1>Terms of Use</h1>
bsw@1045 28 <p>
bsw@1045 29 All data display below and all data you enter later while using the system
bsw@1045 30 and all data you are submitting via the programming interface will be
bsw@1045 31 stored in the LiquidFeedback database and published. Every access to the
bsw@1045 32 system is subject of tracing and logging for development purposes.
bsw@1045 33 </p>
bsw@1045 34 <p>
bsw@1045 35 Please notice, this is a **public test dedicated to developers**: serious
bsw@1045 36 errors can happen or private data unintentionally published.
bsw@1045 37 </p>
bsw@1045 38 <p>
bsw@1045 39 Everything is <b>ON YOUR OWN RISK</b>
bsw@1045 40 </p>
bsw@1045 41 ]]
bsw@1045 42
bsw@1045 43 -- Checkbox(es) the user has to accept while registering
bsw@1045 44 -- ------------------------------------------------------------------------
bsw@1045 45 config.use_terms_checkboxes = {
bsw@1045 46 {
bsw@1045 47 name = "terms_of_use_20140514",
bsw@1045 48 html = "I accept the terms of use.",
bsw@1045 49 not_accepted_error = "You have to accept the terms of use to be able to register."
bsw@1045 50 },
bsw@1045 51 -- {
bsw@1045 52 -- name = "extra_terms_of_use_v1",
bsw@1045 53 -- html = "I accept the extra terms of use.",
bsw@1045 54 -- not_accepted_error = "You have to accept the extra terms of use to be able to register."
bsw@1045 55 -- }
bsw@1045 56 }
bsw@1045 57
bsw@1045 58
bsw@1045 59 -- Absolute base url of application
bsw@1045 60 -- ------------------------------------------------------------------------
bsw@1045 61 config.absolute_base_url = "http://dev.liquidfeedback.org/lf3/"
bsw@1045 62
bsw@1045 63
bsw@1045 64 -- Connection information for the LiquidFeedback database
bsw@1045 65 -- ------------------------------------------------------------------------
bsw@1045 66 config.database = { engine='postgresql', dbname='lf3' }
bsw@1045 67
bsw@1045 68
bsw@1045 69 -- Location of the rocketwiki binaries
bsw@1045 70 -- ------------------------------------------------------------------------
bsw@1045 71 config.enforce_formatting_engine = "markdown2"
bsw@1045 72
bsw@1045 73 config.formatting_engines = {
bsw@1045 74 { id = "markdown_py",
bsw@1045 75 name = "Python Markdown",
bsw@1045 76 executable = "markdown_py",
bsw@1045 77 args = {'/dev/stdin', '-s', 'escape', '-x', 'extra', '-x', 'nl2br', '-x', 'sane_lists'},
bsw@1045 78 remove_images = true
bsw@1045 79 },
bsw@1045 80 { id = "markdown2",
bsw@1045 81 name = "markdown2",
bsw@1045 82 executable = "markdown2",
bsw@1052 83 args = {'-s', 'escape', '-x', 'nofollow,wiki-tables'},
bsw@1045 84 remove_images = true
bsw@1045 85 },
bsw@1045 86 { id = "multimarkdown",
bsw@1045 87 name = "MultiMarkdown",
bsw@1045 88 executable = "multimarkdown",
bsw@1045 89 args = {'--filter-html', '--filter-styles', '--nolabels' ,'-x'}
bsw@1045 90 },
bsw@1045 91 { id = "rocketwiki",
bsw@1045 92 name = "RocketWiki",
bsw@1045 93 executable = "/opt/liquid_feedback3/rocketwiki-lqfb/rocketwiki-lqfb",
bsw@1045 94 remove_images = false
bsw@1045 95 },
bsw@1045 96 { id = "compat",
bsw@1045 97 name = "Traditional WIKI syntax",
bsw@1045 98 executable = "/opt/liquid_feedback3/rocketwiki-lqfb/rocketwiki-lqfb-compat",
bsw@1045 99 remove_images = false
bsw@1045 100 }
bsw@1045 101 }
bsw@1045 102
bsw@1045 103 -- Public access level
bsw@1045 104 -- ------------------------------------------------------------------------
bsw@1045 105 -- Available options:
bsw@1045 106 -- "none"
bsw@1045 107 -- -> Closed user group, no public access at all
bsw@1045 108 -- (except login/registration/password reset)
bsw@1045 109 -- "anonymous"
bsw@1045 110 -- -> Shows only initiative/suggestions texts and aggregated
bsw@1045 111 -- supporter/voter counts
bsw@1045 112 -- "authors_pseudonymous"
bsw@1045 113 -- -> Like anonymous, but shows screen names of authors
bsw@1045 114 -- "all_pseudonymous"
bsw@1045 115 -- -> Show everything a member can see, except profile pages
bsw@1045 116 -- "everything"
bsw@1045 117 -- -> Show everything a member can see, including profile pages
bsw@1045 118 -- ------------------------------------------------------------------------
bsw@1045 119 config.public_access = "none"
bsw@1045 120
bsw@1045 121
bsw@1045 122
bsw@1045 123 -- ========================================================================
bsw@1045 124 -- OPTIONAL
bsw@1045 125 -- Remove leading -- to use a option
bsw@1045 126 -- ========================================================================
bsw@1045 127
bsw@1045 128 -- List of enabled languages, defaults to available languages
bsw@1045 129 -- ------------------------------------------------------------------------
bsw@1045 130 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'nl', 'zh-TW' }
bsw@1045 131 config.enabled_languages = { 'en', 'de' }
bsw@1045 132
bsw@1045 133 -- Default language, defaults to "en"
bsw@1045 134 -- ------------------------------------------------------------------------
bsw@1045 135 -- config.default_lang = "de"
bsw@1045 136
bsw@1045 137 -- after how long is a user considered inactive and the trustee will see warning,
bsw@1045 138 -- notation is according to postgresql intervals, default: no warning at all
bsw@1045 139 -- ------------------------------------------------------------------------
bsw@1045 140 config.delegation_warning_time = '3 month'
bsw@1045 141
bsw@1045 142 -- after which time a user is suggested to (_soft) or forced to (_hard)
bsw@1045 143 -- confirm unit and area delegations. default: no confirmation at all
bsw@1045 144 -- ------------------------------------------------------------------------
bsw@1045 145 -- config.check_delegations_interval_hard = "1 day"
bsw@1045 146 -- config.check_delegations_interval_soft = "3 seconds"
bsw@1045 147
bsw@1045 148 -- default options should be checked when confirming delegations
bsw@1045 149 -- options: "confirm", "revoke" and "none"
bsw@1045 150 -- ------------------------------------------------------------------------
bsw@1045 151 -- config.check_delegations_default = "confirm"
bsw@1045 152
bsw@1045 153 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
bsw@1045 154 -- ------------------------------------------------------------------------
bsw@1045 155 config.mail_subject_prefix = "[LiquidFeedback 3.0 Test] "
bsw@1045 156
bsw@1045 157 -- Sender of all automatic mails, defaults to system defaults
bsw@1045 158 -- ------------------------------------------------------------------------
bsw@1045 159 config.mail_envelope_from = "lqfb-maintainers@public-software-group.org"
bsw@1045 160 config.mail_from = { name = "LiquidFeedback", address = "lqfb-maintainers@public-software-group.org" }
bsw@1045 161 --config.mail_reply_to = { name = "Support", address = "support@example.com" }
bsw@1045 162
bsw@1045 163 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
bsw@1045 164 -- ------------------------------------------------------------------------
bsw@1045 165 -- config.password_hash_algorithm = "crypt_sha512"
bsw@1045 166 -- config.password_hash_algorithm = "crypt_sha256"
bsw@1045 167 -- config.password_hash_algorithm = "crypt_md5"
bsw@1045 168
bsw@1045 169 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
bsw@1045 170 -- (defaults to minimum 10000 and maximum 20000)
bsw@1045 171 -- ------------------------------------------------------------------------
bsw@1045 172 -- config.password_hash_min_rounds = 10000
bsw@1045 173 -- config.password_hash_max_rounds = 20000
bsw@1045 174
bsw@1045 175 -- Supply custom url for avatar/photo delivery
bsw@1045 176 -- ------------------------------------------------------------------------
bsw@1045 177 -- config.fastpath_url_func = nil
bsw@1045 178
bsw@1045 179 -- Local directory for database dumps offered for download
bsw@1045 180 -- ------------------------------------------------------------------------
bsw@1045 181 -- config.download_dir = nil
bsw@1045 182
bsw@1045 183 -- Special use terms for database dump download
bsw@1045 184 -- ------------------------------------------------------------------------
bsw@1045 185 -- config.download_use_terms = "=== Download use terms ===\n"
bsw@1045 186
bsw@1045 187 -- Use custom image conversion, defaults to ImageMagick's convert
bsw@1045 188 -- ------------------------------------------------------------------------
bsw@1045 189 --config.member_image_content_type = "image/jpeg"
bsw@1045 190 --config.member_image_convert_func = {
bsw@1045 191 -- avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
bsw@1045 192 -- photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
bsw@1045 193 --}
bsw@1045 194
bsw@1045 195 -- Display a html formatted public message of the day
bsw@1045 196 -- ------------------------------------------------------------------------
bsw@1045 197 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
bsw@1045 198
bsw@1045 199 -- Display a html formatted internal message of the day
bsw@1045 200 -- ------------------------------------------------------------------------
bsw@1045 201 -- config.motd_public = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
bsw@1045 202
bsw@1045 203 -- Automatic issue related discussion URL
bsw@1045 204 -- ------------------------------------------------------------------------
bsw@1045 205 -- config.issue_discussion_url_func = function(issue)
bsw@1045 206 -- return "http://example.com/discussion/issue_" .. tostring(issue.id)
bsw@1045 207 -- end
bsw@1045 208
bsw@1045 209 -- Configuration of "tell others"
bsw@1045 210 -- ------------------------------------------------------------------------
bsw@1045 211 config.tell_others = {
bsw@1045 212 initiative = function (initiative)
bsw@1083 213 local text = "i" .. initiative.id .. ": " .. initiative.name .. " " .. request.get_absolute_baseurl() .. "initiative/show/" .. initiative.id .. ".html"
bsw@1045 214 return {
bsw@1045 215 { content = "Tweet this initiative", external = "https://twitter.com/intent/tweet?text=" .. encode.url_part(text) },
bsw@1045 216 { content = "Send an eMail", external = "mailto:?subject=" .. encode.url_part(initiative.display_name) .. "&body=" .. encode.url_part(text) }
bsw@1045 217 }
bsw@1045 218 end
bsw@1045 219 }
bsw@1045 220
bsw@1045 221 -- Integration of Etherpad, disabled by default
bsw@1045 222 -- ------------------------------------------------------------------------
bsw@1045 223 --config.etherpad = {
bsw@1045 224 -- base_url = "http://example.com:9001/",
bsw@1045 225 -- api_base = "http://localhost:9001/",
bsw@1045 226 -- api_key = "mysecretapikey",
bsw@1045 227 -- group_id = "mygroupname",
bsw@1045 228 -- cookie_path = "/"
bsw@1045 229 --}
bsw@1045 230
bsw@1045 231 -- Free timings, may be used together with polling policies
bsw@1045 232 -- ------------------------------------------------------------------------
bsw@1045 233 -- This example expects a date string entered in the free timing field
bsw@1045 234 -- by the user creating a poll, interpreting it as target date for then
bsw@1045 235 -- poll and splits the remainig time at the ratio of 4:1:2
bsw@1045 236 -- Please note, polling policies never have an admission phase
bsw@1045 237
bsw@1045 238
bsw@1045 239 config.free_timing = {
bsw@1045 240 calculate_func = function(policy, timing_string)
bsw@1045 241 function interval_by_seconds(secs)
bsw@1045 242 local secs_per_day = 60 * 60 * 24
bsw@1045 243 local days
bsw@1045 244 days = math.floor(secs / secs_per_day)
bsw@1045 245 secs = secs - days * secs_per_day
bsw@1045 246 return days .. " days " .. secs .. " seconds"
bsw@1045 247 end
bsw@1045 248 local target_date = parse.date(timing_string, atom.date)
bsw@1045 249 if not target_date then
bsw@1045 250 return false
bsw@1045 251 end
bsw@1045 252 local target_timestamp = target_date.midday
bsw@1045 253 local now = atom.timestamp:get_current()
bsw@1045 254 trace.debug(target_timestamp, now)
bsw@1045 255 local duration = target_timestamp - now
bsw@1045 256 if duration < 0 then
bsw@1045 257 return false
bsw@1045 258 end
bsw@1045 259 return {
bsw@1045 260 discussion = interval_by_seconds(duration / 7 * 4),
bsw@1045 261 verification = interval_by_seconds(duration / 7 * 1),
bsw@1045 262 voting = interval_by_seconds(duration / 7 * 2)
bsw@1045 263 }
bsw@1045 264 end,
bsw@1045 265 available_func = function(policy)
bsw@1045 266 return {
bsw@1045 267 { name = "End of 2014", id = '2014-12-31' },
bsw@1045 268 { name = "End of 2015", id = '2015-12-31' },
bsw@1045 269 { name = "End of 2016", id = '2016-12-31' }
bsw@1045 270 }
bsw@1045 271 end
bsw@1045 272 }
bsw@1045 273
bsw@1045 274
bsw@1045 275 config.enable_debug_trace = true
bsw@1045 276
bsw@1045 277 -- WebMCP accelerator
bsw@1045 278 -- uncomment the following two lines to use C implementations of chosen
bsw@1045 279 -- functions and to disable garbage collection during the request, to
bsw@1045 280 -- increase speed:
bsw@1045 281 -- ------------------------------------------------------------------------
bsw@1045 282 -- require 'webmcp_accelerator'
bsw@1045 283 -- if cgi then collectgarbage("stop") end
bsw@1045 284
bsw@1045 285
bsw@1045 286 -- ========================================================================
bsw@1045 287 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
bsw@1045 288 -- ========================================================================
bsw@1045 289
bsw@1045 290 execute.config("init")

Impressum / About Us