liquid_feedback_frontend
view config/example.lua @ 1203:e77c8a3e33a2
Added tag v3.0.7 for changeset ccc357ccb68c
| author | jbe | 
|---|---|
| date | Tue Jun 23 21:18:28 2015 +0200 (2015-06-23) | 
| parents | 61b81906b505 | 
| 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 = "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 --  },
    70 }
    73 -- Public access level
    74 -- ------------------------------------------------------------------------
    75 -- Available options:
    76 -- "none" 
    77 --     -> Closed user group, no public access at all
    78 --        (except login/registration/password reset)
    79 -- "anonymous"
    80 --     -> Shows only initiative/suggestions texts and aggregated
    81 --        supporter/voter counts
    82 -- "authors_pseudonymous" 
    83 --     -> Like anonymous, but shows screen names of authors
    84 -- "all_pseudonymous" 
    85 --     -> Show everything a member can see, except profile pages
    86 -- "everything"
    87 --     -> Show everything a member can see, including profile pages
    88 -- ------------------------------------------------------------------------
    89 config.public_access = "none"
    93 -- ========================================================================
    94 -- OPTIONAL
    95 -- Remove leading -- to use a option
    96 -- ========================================================================
    98 -- Disable registration
    99 -- ------------------------------------------------------------------------
   100 -- Available options:
   101 -- false: registration is enabled (default)
   102 -- true: registration is disabled
   103 -- ------------------------------------------------------------------------
   104 -- 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' }
   112 -- Default language, defaults to "en"
   113 -- ------------------------------------------------------------------------
   114 -- config.default_lang = "en"
   117 -- after how long is a user considered inactive and the trustee will see warning,
   118 -- notation is according to postgresql intervals, default: no warning at all
   119 -- ------------------------------------------------------------------------
   120 -- config.delegation_warning_time = '6 months'
   123 -- after which time a user is advised (_soft) or forced (_hard) to check
   124 -- unit and area delegations. default: no check at all
   125 -- ------------------------------------------------------------------------
   126 -- config.check_delegations_interval_hard = "6 months"
   127 -- config.check_delegations_interval_soft = "3 months"
   130 -- default option when checking delegations
   131 -- available options: "confirm", "revoke" and "none", default: "confirm"
   132 -- ------------------------------------------------------------------------
   133 -- config.check_delegations_default = "confirm"
   136 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
   137 -- ------------------------------------------------------------------------
   138 -- config.mail_subject_prefix = "[LiquidFeedback] "
   141 -- Sender of all automatic mails, defaults to system defaults
   142 -- ------------------------------------------------------------------------
   143 -- config.mail_envelope_from = "liquidfeedback@example.com"
   144 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
   145 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
   148 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
   149 -- ------------------------------------------------------------------------
   150 -- config.password_hash_algorithm = "crypt_sha512"
   151 -- config.password_hash_algorithm = "crypt_sha256"
   152 -- config.password_hash_algorithm = "crypt_md5"
   155 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
   156 -- (defaults to minimum 10000 and maximum 20000)
   157 -- ------------------------------------------------------------------------
   158 -- config.password_hash_min_rounds = 10000
   159 -- config.password_hash_max_rounds = 20000
   162 -- Supply custom url for avatar/photo delivery
   163 -- ------------------------------------------------------------------------
   164 -- config.fastpath_url_func = nil
   167 -- Local directory for database dumps offered for download
   168 -- ------------------------------------------------------------------------
   169 -- config.download_dir = nil
   172 -- Special use terms for database dump download
   173 -- ------------------------------------------------------------------------
   174 -- config.download_use_terms = "=== Download use terms ===\n"
   177 -- Use custom image conversion, defaults to ImageMagick's convert
   178 -- ------------------------------------------------------------------------
   179 --config.member_image_content_type = "image/jpeg"
   180 --config.member_image_convert_func = {
   181 --  avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail",   "48x48", "jpeg:-") end,
   182 --  photo =  function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
   183 --}
   186 -- Display a html formatted public message of the day
   187 -- ------------------------------------------------------------------------
   188 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
   191 -- Display a html formatted internal message of the day
   192 -- ------------------------------------------------------------------------
   193 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
   196 -- Automatic issue related discussion URL
   197 -- ------------------------------------------------------------------------
   198 -- config.issue_discussion_url_func = function(issue)
   199 --   return "http://example.com/discussion/issue_" .. tostring(issue.id)
   200 -- end
   203 -- Integration of Etherpad, disabled by default
   204 -- ------------------------------------------------------------------------
   205 --config.etherpad = {
   206 --  base_url = "http://example.com:9001/",
   207 --  api_base = "http://localhost:9001/",
   208 --  api_key = "mysecretapikey",
   209 --  group_id = "mygroupname",
   210 --  cookie_path = "/"
   211 --}
   214 -- Free timings
   215 -- ------------------------------------------------------------------------
   216 -- This example expects a date string entered in the free timing field
   217 -- by the user creating a poll, interpreting it as target date for then
   218 -- poll and splits the remaining time at the ratio of 4:1:2
   219 -- Please note, polling policies never have an admission phase
   220 -- The available_func is optional, if not set any target date is allowed
   222 config.free_timing = {
   223   calculate_func = function(policy, timing_string)
   224     local function interval_by_seconds(secs)
   225       local secs_per_day = 60 * 60 * 24
   226       local days
   227       days = math.floor(secs / secs_per_day)
   228       secs = secs - days * secs_per_day
   229       return days .. " days " .. secs .. " seconds"
   230     end
   231     local target_date = parse.date(timing_string, atom.date)
   232     if not target_date then
   233       return false
   234     end
   235     local target_timestamp = target_date.midday
   236     local now = atom.timestamp:get_current()
   237     trace.debug(target_timestamp, now)
   238     local duration = target_timestamp - now
   239     if duration < 0 then
   240       return false
   241     end
   242     return {
   243       discussion = interval_by_seconds(duration / 7 * 4),
   244       verification = interval_by_seconds(duration / 7 * 1),
   245       voting = interval_by_seconds(duration / 7 * 2)
   246     }
   247   end,
   248   available_func = function(policy)
   249     return { 
   250       { name = "End of 2013", id = '2013-12-31' },
   251       { name = "End of 2014", id = '2014-12-31' },
   252       { name = "End of 2015", id = '2015-12-31' }
   253     }
   254   end
   255 }
   258 -- Admin logger
   259 -- ------------------------------------------------------------------------
   260 -- Logging administrative activities
   261 -- disabled by default
   263 --[[
   264 config.admin_logger = function(params)
   266   local adminid = app.session.member_id
   267   local adminname = app.session.member.name
   268   local url = params._webmcp_path
   270   -- do something (e.g. calling 'logger' via extos.pfilter)
   272 end
   273 --]]
   276 -- Network interface to bind to
   277 -- ------------------------------------------------------------------------
   278 -- Available options:
   279 -- true: bind to localhost (default)
   280 -- false: bind to all interface
   281 -- ------------------------------------------------------------------------
   282 -- config.localhost = true
   285 -- Network port to bind to
   286 -- ------------------------------------------------------------------------
   287 -- config.port = 8080
   290 -- Serving content via IPV6
   291 -- ------------------------------------------------------------------------
   292 -- Available options:
   293 -- nil or false: do not serve via IPv6 (default)
   294 -- true: serve via IPv6
   295 -- ------------------------------------------------------------------------
   296 -- config.ipv6 = false
   299 -- Application server fork configuration
   300 -- ------------------------------------------------------------------------
   301 -- config.fork = {
   302 --   pre = 2,            -- desired number of spare (idle) processes
   303 --   min = 4,            -- minimum number of processes
   304 --   max = 128,          -- maximum number of processes (hard limit)
   305 --   delay = 0.125,      -- delay (seconds) between creation of spare processes
   306 --   error_delay = 2,    -- delay (seconds) before retry of failed process creation
   307 --   exit_delay = 2,     -- delay (seconds) between destruction of excessive spare processes
   308 --   idle_timeout = 900, -- idle time (seconds) after a fork gets terminated (0 for no timeout)
   309 --   memory_limit = 0,   -- maximum memory consumption (bytes) before process gets terminated
   310 --   min_requests = 50,  -- minimum count of requests handled before fork is terminated
   311 --   max_requests = 100  -- maximum count of requests handled before fork is terminated
   312 -- }
   315 -- HTTP server options
   316 -- ------------------------------------------------------------------------
   317 -- http_options = {
   318 --   static_headers            = {}            -- string or table of static headers to be returned with every request
   319 --   request_header_size_limit = 1024*1024,    -- maximum size of request body sent by client
   320 --   request_body_size_limit   = 64*1024*1024, -- maximum size of request body sent by client
   321 --   idle_timeout              = 65,           -- maximum time until receiving the first byte of the request headera
   322 --   stall_timeout             = 60,           -- maximum time a client connection may be stalled
   323 --   request_header_timeout    = 120,          -- maximum time until receiving the remaining bytes of the request header
   324 --   response_timeout          = 3600,         -- time in which request body and response must be sent
   325 --   maximum_input_chunk_size  = 16384         -- tweaks behavior of request-body parser
   326 --   minimum_output_chunk_size = 1024          -- chunk size for chunked-transfer-encoding
   327 -- }
   330 -- WebMCP accelerator
   331 -- uncomment the following two lines to use C implementations of chosen
   332 -- functions and to disable garbage collection during the request, to
   333 -- increase speed:
   334 -- ------------------------------------------------------------------------
   335 -- require 'webmcp_accelerator'
   336 -- if cgi then collectgarbage("stop") end
   338 -- Trace debug
   339 -- uncomment the following line to enable debug trace
   340 -- config.enable_debug_trace = true
   342 -- ========================================================================
   343 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
   344 -- ========================================================================
   346 execute.config("init")
