liquid_feedback_frontend
view config/devel.lua @ 1197:b1ba4eb3ff1f
Updated documentation for new Moonbridge version
| author | jbe | 
|---|---|
| date | Sat Jun 20 02:44:54 2015 +0200 (2015-06-20) | 
| parents | fc9169c980d5 | 
| children | 2f510599c12f | 
 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 = "Public Software Group e.V."
    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://127.0.0.1:8080/"
    41 -- Connection information for the LiquidFeedback database
    42 -- ------------------------------------------------------------------------
    43 config.database = { engine='postgresql', dbname='lf3' }
    46 -- Location of the rocketwiki binaries
    47 -- ------------------------------------------------------------------------
    48 config.enforce_formatting_engine = "markdown2"
    50 config.formatting_engines = {
    51   { id = "markdown2",
    52     name = "python-markdown2",
    53     executable = "markdown2",
    54     args = {'-s', 'escape', '-x', 'nofollow,wiki-tables'},
    55     remove_images = true
    56   },
    57   { id = "markdown_py",
    58     name = "Python Markdown",
    59     executable = "markdown_py",
    60     args = {'-s', 'escape', '-x', 'extra', '-x', 'nl2br', '-x', 'sane_lists'},
    61     remove_images = true
    62   },
    63   { id = "rocketwiki",
    64     name = "RocketWiki",
    65     executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb",
    66     remove_images = false
    67   },
    68   { id = "compat",
    69     name = "Traditional WIKI syntax",
    70     executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat",
    71     remove_images = false
    72   }
    73 }
    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 = "all_pseudonymous"
    95 -- ========================================================================
    96 -- OPTIONAL
    97 -- Remove leading -- to use a option
    98 -- ========================================================================
   100 -- List of enabled languages, defaults to available languages
   101 -- ------------------------------------------------------------------------
   102 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'nl', 'zh-TW' }
   104 -- Default language, defaults to "en"
   105 -- ------------------------------------------------------------------------
   106 -- config.default_lang = "de"
   108 -- after how long is a user considered inactive and the trustee will see warning,
   109 -- notation is according to postgresql intervals, default: no warning at all
   110 -- ------------------------------------------------------------------------
   111 config.delegation_warning_time = '1 hour'
   113 -- after which time a user is suggested to (_soft) or forced to (_hard) 
   114 -- confirm unit and area delegations. default: no confirmation at all
   115 -- ------------------------------------------------------------------------
   116 -- config.check_delegations_interval_hard = "1 day"
   117 -- config.check_delegations_interval_soft = "3 seconds"
   119 -- default options should be checked when confirming delegations
   120 -- options: "confirm", "revoke" and "none"
   121 -- ------------------------------------------------------------------------
   122 -- config.check_delegations_default = "confirm"
   124 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
   125 -- ------------------------------------------------------------------------
   126 -- config.mail_subject_prefix = "[LiquidFeedback] "
   128 -- Sender of all automatic mails, defaults to system defaults
   129 -- ------------------------------------------------------------------------
   130 -- config.mail_envelope_from = "liquidfeedback@example.com"
   131 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
   132 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
   134 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
   135 -- ------------------------------------------------------------------------
   136 -- config.password_hash_algorithm = "crypt_sha512"
   137 -- config.password_hash_algorithm = "crypt_sha256"
   138 -- config.password_hash_algorithm = "crypt_md5"
   140 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
   141 -- (defaults to minimum 10000 and maximum 20000)
   142 -- ------------------------------------------------------------------------
   143 -- config.password_hash_min_rounds = 10000
   144 -- config.password_hash_max_rounds = 20000
   146 -- Supply custom url for avatar/photo delivery
   147 -- ------------------------------------------------------------------------
   148 -- config.fastpath_url_func = nil
   150 -- Local directory for database dumps offered for download
   151 -- ------------------------------------------------------------------------
   152 -- config.download_dir = nil
   154 -- Special use terms for database dump download
   155 -- ------------------------------------------------------------------------
   156 -- config.download_use_terms = "=== Download use terms ===\n"
   158 -- Use custom image conversion, defaults to ImageMagick's convert
   159 -- ------------------------------------------------------------------------
   160 --config.member_image_content_type = "image/jpeg"
   161 --config.member_image_convert_func = {
   162 --  avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail",   "48x48", "jpeg:-") end,
   163 --  photo =  function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
   164 --}
   166 config.member_image_content_type = "image/jpeg"
   167 config.member_image_convert_func = {
   168   avatar = function(data) return extos.pfilter(data, "convert",
   169     "jpeg:-",
   170     "-set", "option:distort:viewport", 
   171     "%[fx:min(w,h)]x%[fx:min(w,h)]+%[fx:max((w-h)/2,0)]+%[fx:max((h-w)/2,0)]",
   172     "-filter", "point",
   173     "-distort", "SRT", "0", 
   174     "+repage",
   175     "-define", "filter:filter=Sinc", 
   176     "-define", "filter:window=Jinc",
   177     "-define", "filter:lobes=3",
   178     "-thumbnail", "48x48",
   179     "jpeg:-"
   180   ) end,
   181   photo =  function(data) return extos.pfilter(data, "convert",
   182     "jpeg:-",
   183     "-define", "filter:filter=Sinc", 
   184     "-define", "filter:window=Jinc",
   185     "-define", "filter:lobes=3",
   186     "-thumbnail", "240x240",
   187     "jpeg:-"
   188   ) end
   189 }
   192 -- Display a html formatted public message of the day
   193 -- ------------------------------------------------------------------------
   194 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
   196 -- Display a html formatted internal message of the day
   197 -- ------------------------------------------------------------------------
   198 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
   200 -- Automatic issue related discussion URL
   201 -- ------------------------------------------------------------------------
   202 -- config.issue_discussion_url_func = function(issue)
   203 --   return "http://example.com/discussion/issue_" .. tostring(issue.id)
   204 -- end
   206 -- Configuration of "tell others"
   207 -- ------------------------------------------------------------------------
   208 config.tell_others = {
   209   initiative = function (initiative)
   210     local text = "i" .. initiative.id .. ": " .. initiative.name .. " " .. request.get_absolute_baseurl() .. "initiative/" .. initiative.id .. ".html"
   211     return {
   212       { content = "tweet this initiative", external = "https://twitter.com/intent/tweet?text=" .. encode.url_part(text) },
   213       { content = "send link with e-mail", external = "mailto:?subject=" .. encode.url_part(initiative.display_name) .. "&body=" .. encode.url_part(text) }
   214     }
   215   end
   216 }
   218 -- Integration of Etherpad, disabled by default
   219 -- ------------------------------------------------------------------------
   220 --config.etherpad = {
   221 --  base_url = "http://example.com:9001/",
   222 --  api_base = "http://localhost:9001/",
   223 --  api_key = "mysecretapikey",
   224 --  group_id = "mygroupname",
   225 --  cookie_path = "/"
   226 --}
   228 -- Free timings, may be used together with polling policies
   229 -- ------------------------------------------------------------------------
   230 -- This example expects a date string entered in the free timing field
   231 -- by the user creating a poll, interpreting it as target date for then
   232 -- poll and splits the remainig time at the ratio of 4:1:2
   233 -- Please note, polling policies never have an admission phase
   236 config.free_timing = {
   237   calculate_func = function(policy, timing_string)
   238     local function interval_by_seconds(secs)
   239       local secs_per_day = 60 * 60 * 24
   240       local days
   241       days = math.floor(secs / secs_per_day)
   242       secs = secs - days * secs_per_day
   243       return days .. " days " .. secs .. " seconds"
   244     end
   245     local target_date = parse.date(timing_string, atom.date)
   246     if not target_date then
   247       return false
   248     end
   249     local target_timestamp = target_date.midday
   250     local now = atom.timestamp:get_current()
   251     trace.debug(target_timestamp, now)
   252     local duration = target_timestamp - now
   253     if duration < 0 then
   254       return false
   255     end
   256     return {
   257       discussion = interval_by_seconds(duration / 7 * 4),
   258       verification = interval_by_seconds(duration / 7 * 1),
   259       voting = interval_by_seconds(duration / 7 * 2)
   260     }
   261   end,
   262   available_func = function(policy)
   263     return { 
   264       { name = "End of 2013", id = '2013-12-31' },
   265       { name = "End of 2014", id = '2014-12-31' },
   266       { name = "End of 2015", id = '2015-12-31' }
   267     }
   268   end
   269 }
   272 config.enable_debug_trace = true
   274 config.fork = { pre = 64, max = 256, delay = 0.01 }
   277 -- WebMCP accelerator
   278 -- uncomment the following two lines to use C implementations of chosen
   279 -- functions and to disable garbage collection during the request, to
   280 -- increase speed:
   281 -- ------------------------------------------------------------------------
   282 -- require 'webmcp_accelerator'
   283 -- if cgi then collectgarbage("stop") end
   286 -- ========================================================================
   287 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
   288 -- ========================================================================
   290 execute.config("init")
