liquid_feedback_frontend

annotate config/example.lua @ 961:2141aef04ad7

Configuration example for free timings
author bsw
date Thu Feb 07 23:48:50 2013 +0100 (2013-02-07)
parents e3887fea39fa
children 81bde33c2256
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@729 15 -- A rocketwiki formatted text the user has to accept while registering
bsw@730 16 -- ------------------------------------------------------------------------
bsw@729 17 config.use_terms = "=== Terms of Use ==="
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@735 48 config.formatting_engine_executeables = {
bsw@735 49 rocketwiki= "/opt/rocketwiki-lqfb/rocketwiki-lqfb",
bsw@735 50 compat = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat"
bsw@735 51 }
bsw@79 52
bsw/jbe@6 53
bsw@813 54 -- Public access level
bsw@734 55 -- ------------------------------------------------------------------------
bsw@813 56 -- Available options:
bsw@813 57 -- "none"
bsw@813 58 -- -> Closed user group, no public access at all
bsw@813 59 -- (except login/registration/password reset)
bsw@813 60 -- "anonymous"
bsw@813 61 -- -> Shows only initiative/suggestions texts and aggregated
bsw@813 62 -- supporter/voter counts
bsw@813 63 -- "authors_pseudonymous"
bsw@813 64 -- -> Like anonymous, but shows screen names of authors
bsw@813 65 -- "all_pseudonymous"
bsw@813 66 -- -> Show everything a member can see, except profile pages
bsw@813 67 -- "everything"
bsw@813 68 -- -> Show everything a member can see, including profile pages
bsw@813 69 -- ------------------------------------------------------------------------
bsw@813 70 config.public_access = "none"
bsw@734 71
bsw@737 72
bsw@732 73
bsw@737 74 -- ========================================================================
bsw@737 75 -- OPTIONAL
bsw@737 76 -- Remove leading -- to use a option
bsw@737 77 -- ========================================================================
bsw@731 78
bsw@729 79 -- List of enabled languages, defaults to available languages
bsw@730 80 -- ------------------------------------------------------------------------
bsw@876 81 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'nl', 'zh-Hans', 'zh-TW' }
bsw@2 82
bsw@729 83 -- Default language, defaults to "en"
bsw@730 84 -- ------------------------------------------------------------------------
bsw@729 85 -- config.default_lang = "en"
poelzi@163 86
bsw@734 87 -- after how long is a user considered inactive and the trustee will see warning,
bsw@734 88 -- notation is according to postgresql intervals, default: no warning at all
bsw@730 89 -- ------------------------------------------------------------------------
bsw@729 90 -- config.delegation_warning_time = '6 months'
bsw/jbe@6 91
bsw@734 92 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
bsw@730 93 -- ------------------------------------------------------------------------
bsw@729 94 -- config.mail_subject_prefix = "[LiquidFeedback] "
bsw@734 95
bsw@734 96 -- Sender of all automatic mails, defaults to system defaults
bsw@734 97 -- ------------------------------------------------------------------------
bsw@839 98 -- config.mail_envelope_from = "liquidfeedback@example.com"
bsw@839 99 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
bsw@839 100 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
bsw/jbe@6 101
bsw@905 102 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
bsw@905 103 -- ------------------------------------------------------------------------
bsw@905 104 -- config.password_hash_algorithm = "crypt_sha512"
bsw@905 105 -- config.password_hash_algorithm = "crypt_sha256"
bsw@905 106 -- config.password_hash_algorithm = "crypt_md5"
bsw@905 107
bsw@905 108 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
bsw@905 109 -- (defaults to minimum 10000 and maximum 20000)
bsw@905 110 -- ------------------------------------------------------------------------
bsw@905 111 -- config.password_hash_min_rounds = 10000
bsw@905 112 -- config.password_hash_max_rounds = 20000
bsw@905 113
bsw@905 114
bsw@729 115 -- Supply custom url for avatar/photo delivery
bsw@730 116 -- ------------------------------------------------------------------------
bsw@729 117 -- config.fastpath_url_func = nil
bsw@51 118
bsw@729 119 -- Local directory for database dumps offered for download
bsw@730 120 -- ------------------------------------------------------------------------
bsw@729 121 -- config.download_dir = nil
bsw@51 122
bsw@729 123 -- Special use terms for database dump download
bsw@730 124 -- ------------------------------------------------------------------------
bsw@729 125 -- config.download_use_terms = "=== Download use terms ===\n"
bsw/jbe@52 126
bsw@734 127 -- Use custom image conversion, defaults to ImageMagick's convert
bsw@730 128 -- ------------------------------------------------------------------------
bsw@729 129 --config.member_image_content_type = "image/jpeg"
bsw@729 130 --config.member_image_convert_func = {
bsw@729 131 -- avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
bsw@729 132 -- photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
bsw@729 133 --}
bsw@51 134
bsw@837 135 -- Display a public message of the day
bsw@837 136 -- ------------------------------------------------------------------------
bsw@838 137 -- config.motd_public = "===Message of the day===\nThe MOTD is formatted with rocket wiki"
bsw@837 138
bsw@835 139 -- Automatic issue related discussion URL
bsw@835 140 -- ------------------------------------------------------------------------
bsw@835 141 -- config.issue_discussion_url_func = function(issue)
bsw@835 142 -- return "http://example.com/discussion/issue_" .. tostring(issue.id)
bsw@835 143 -- end
bsw@835 144
bsw@734 145 -- Integration of Etherpad, disabled by default
bsw@730 146 -- ------------------------------------------------------------------------
bsw@729 147 --config.etherpad = {
bsw@729 148 -- base_url = "http://example.com:9001/",
bsw@729 149 -- api_base = "http://localhost:9001/",
bsw@729 150 -- api_key = "mysecretapikey",
bsw@729 151 -- group_id = "mygroupname",
bsw@729 152 -- cookie_path = "/"
bsw@729 153 --}
bsw@51 154
bsw@961 155 -- Free timings
bsw@961 156 -- ------------------------------------------------------------------------
bsw@961 157 -- This example expects a date string entered in the free timing field
bsw@961 158 -- by the user creating a poll, interpreting it as target date for then
bsw@961 159 -- poll and splits the remaining time at the ratio of 4:1:2
bsw@961 160 -- Please note, polling policies never have an admission phase
bsw@961 161 -- The available_func is optional, if not set any target date is allowed
bsw@961 162
bsw@961 163 config.free_timing = {
bsw@961 164 calculate_func = function(policy, timing_string)
bsw@961 165 function interval_by_seconds(secs)
bsw@961 166 local secs_per_day = 60 * 60 * 24
bsw@961 167 local days
bsw@961 168 days = math.floor(secs / secs_per_day)
bsw@961 169 secs = secs - days * secs_per_day
bsw@961 170 return days .. " days " .. secs .. " seconds"
bsw@961 171 end
bsw@961 172 local target_date = parse.date(timing_string, atom.date)
bsw@961 173 if not target_date then
bsw@961 174 return false
bsw@961 175 end
bsw@961 176 local target_timestamp = target_date.midday
bsw@961 177 local now = atom.timestamp:get_current()
bsw@961 178 trace.debug(target_timestamp, now)
bsw@961 179 local duration = target_timestamp - now
bsw@961 180 if duration < 0 then
bsw@961 181 return false
bsw@961 182 end
bsw@961 183 return {
bsw@961 184 discussion = interval_by_seconds(duration / 7 * 4),
bsw@961 185 verification = interval_by_seconds(duration / 7 * 1),
bsw@961 186 voting = interval_by_seconds(duration / 7 * 2)
bsw@961 187 }
bsw@961 188 end,
bsw@961 189 available_func = function(policy)
bsw@961 190 return {
bsw@961 191 { name = "End of 2013", id = '2013-12-31' },
bsw@961 192 { name = "End of 2014", id = '2014-12-31' },
bsw@961 193 { name = "End of 2015", id = '2015-12-31' }
bsw@961 194 }
bsw@961 195 end
bsw@961 196 }
bsw@961 197
bsw@729 198 -- WebMCP accelerator
bsw/jbe@0 199 -- uncomment the following two lines to use C implementations of chosen
bsw/jbe@0 200 -- functions and to disable garbage collection during the request, to
bsw/jbe@0 201 -- increase speed:
bsw@730 202 -- ------------------------------------------------------------------------
bsw@729 203 -- require 'webmcp_accelerator'
bsw@806 204 -- if cgi then collectgarbage("stop") end
bsw/jbe@0 205
bsw@868 206 -- Trace debug
bsw@868 207 -- uncomment the following line to enable debug trace
bsw@868 208 -- config.enable_debug_trace = true
bsw/jbe@0 209
bsw@730 210 -- ========================================================================
bsw@734 211 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
bsw@730 212 -- ========================================================================
bsw@730 213
bsw@729 214 execute.config("init")

Impressum / About Us