liquid_feedback_frontend
view config/example.lua @ 1660:cbce4491c93e
Redirect to login from index page when no access rights
| author | bsw | 
|---|---|
| date | Sun Feb 14 13:35:16 2021 +0100 (2021-02-14) | 
| parents | 3fb752f4afcb | 
| children | 36fb14503a84 | 
 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 = "Example Organisation"
    10 -- Connection information for the LiquidFeedback database
    11 -- ------------------------------------------------------------------------
    12 config.database = { engine='postgresql', dbname='liquid_feedback' }
    15 -- Absolute base url of application
    16 -- ------------------------------------------------------------------------
    17 config.absolute_base_url = "https://example.org/"
    20 -- Network interface to bind to
    21 -- ------------------------------------------------------------------------
    22 -- Available options:
    23 -- true: bind to localhost (default)
    24 -- false: bind to all interface
    25 -- ------------------------------------------------------------------------
    26 -- config.localhost = true
    29 -- Network port to bind to, default port 8080
    30 -- ------------------------------------------------------------------------
    31 -- config.port = 8080
    34 -- Serving content via IPV6
    35 -- ------------------------------------------------------------------------
    36 -- Available options:
    37 -- nil or false: do not serve via IPv6 (default)
    38 -- true: serve via IPv6
    39 -- ------------------------------------------------------------------------
    40 -- config.ipv6 = false
    43 -- Public access level
    44 -- ------------------------------------------------------------------------
    45 -- Available options:
    46 -- "none" 
    47 --     -> Closed user group, no public access at all
    48 --        (except login/registration/password reset)
    49 -- "anonymous"
    50 --     -> Shows only initiative/suggestions texts and aggregated
    51 --        supporter/voter counts
    52 -- "authors_pseudonymous" 
    53 --     -> Like anonymous, but shows screen names of authors
    54 -- "all_pseudonymous" 
    55 --     -> Show everything a member can see, except profile pages
    56 -- "everything"
    57 --     -> Show everything a member can see, including profile pages
    58 -- ------------------------------------------------------------------------
    59 config.public_access = "none"
    62 -- Information about service provider (HTML)
    63 -- ------------------------------------------------------------------------
    64 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
    68 -- ========================================================================
    69 -- OPTIONAL
    70 -- Remove leading -- to use a option
    71 -- ========================================================================
    73 -- List of enabled languages, defaults to available languages
    74 -- ------------------------------------------------------------------------
    75 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'ka', 'nl', 'zh-Hans', 'zh-TW' }
    78 -- Default language, defaults to "en"
    79 -- ------------------------------------------------------------------------
    80 -- config.default_lang = "en"
    83 -- Disable registration
    84 -- ------------------------------------------------------------------------
    85 -- Available options:
    86 -- false: registration is enabled (default)
    87 -- true: registration is disabled
    88 -- ------------------------------------------------------------------------
    89 -- config.disable_registration = true
    92 -- A HTML formatted text the user has to accept while registering
    93 -- ------------------------------------------------------------------------
    94 -- config.use_terms = "<h1>Terms of Use</h1><p>Insert terms here</p>"
    97 -- Checkbox(es) the user has to accept while registering
    98 -- ------------------------------------------------------------------------
    99 -- config.use_terms_checkboxes = {
   100 --   {
   101 --     name = "terms_of_use_v1",
   102 --     html = "I accept the terms of use.",
   103 --     not_accepted_error = "You have to accept the terms of use to be able to register."
   104 --   },
   105 --   {
   106 --     name = "extra_terms_of_use_v1",
   107 --     html = "I accept the extra terms of use.",
   108 --     not_accepted_error = "You have to accept the extra terms of use to be able to register."
   109 --   }
   110 -- }
   112 -- after how long is a user considered inactive and the trustee will see warning,
   113 -- notation is according to postgresql intervals, default: no warning at all
   114 -- ------------------------------------------------------------------------
   115 -- config.delegation_warning_time = '6 months'
   118 -- after which time a user is advised (_soft) or forced (_hard) to check
   119 -- unit and area delegations. default: no check at all
   120 -- ------------------------------------------------------------------------
   121 -- config.check_delegations_interval_soft = "3 months"
   122 -- config.check_delegations_interval_hard = "6 months"
   125 -- default option when checking delegations
   126 -- available options: "confirm", "revoke" and "none", default: "confirm"
   127 -- ------------------------------------------------------------------------
   128 -- config.check_delegations_default = "confirm"
   131 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
   132 -- ------------------------------------------------------------------------
   133 -- config.mail_subject_prefix = "[LiquidFeedback] "
   136 -- Sender of all automatic mails, defaults to system defaults
   137 -- ------------------------------------------------------------------------
   138 -- config.mail_envelope_from = "liquidfeedback@example.com"
   139 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
   140 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
   143 -- Template for digest emails
   144 -- #{name} will be replaced by member screen name
   145 -- #{digest} will be replaced with the digest content
   146 -- ------------------------------------------------------------------------
   147 -- config.notification_digest_template = [[
   148 -- Hello #{name},
   149 -- 
   150 -- this is your personal digest.
   151 -- 
   152 -- #{digest}
   153 -- ]]
   156 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
   157 -- ------------------------------------------------------------------------
   158 -- config.password_hash_algorithm = "crypt_sha512"
   159 -- config.password_hash_algorithm = "crypt_sha256"
   160 -- config.password_hash_algorithm = "crypt_md5"
   163 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
   164 -- (defaults to minimum 10000 and maximum 20000)
   165 -- ------------------------------------------------------------------------
   166 -- config.password_hash_min_rounds = 10000
   167 -- config.password_hash_max_rounds = 20000
   170 -- Local directory for database dumps offered for download
   171 -- ------------------------------------------------------------------------
   172 -- config.download_dir = nil
   175 -- Special use terms for database dump download
   176 -- ------------------------------------------------------------------------
   177 -- config.download_use_terms = "=== Download use terms ===\n"
   180 -- Use custom image conversion, defaults to ImageMagick's convert
   181 -- ------------------------------------------------------------------------
   182 --config.member_image_content_type = "image/jpeg"
   183 --config.member_image_convert_func = {
   184 --  avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail",   "48x48", "jpeg:-") end,
   185 --  photo =  function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
   186 --}
   188 -- Initiative attachments
   189 -- ------------------------------------------------------------------------
   190 -- config.attachments = {}
   192 -- Conversion function for recoding attachments
   193 -- ------------------------------------------------------------------------
   194 -- config.attachments.convert_func = function(data)
   195 --   return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-")
   196 -- end
   198 -- Custom UI colors, defaults to green/blue
   199 -- ------------------------------------------------------------------------
   200 -- config.style = {
   201 --   color_md = {
   202 --     primary = "green",
   203 --     primary_contrast = "dark",
   204 --     accent = "blue",
   205 --     accent_contrast = "dark"
   206 --   }
   207 -- }
   209 -- Member profile fields, defaults to no extra fields
   210 -- ------------------------------------------------------------------------
   211 -- config.member_profile_fields = {}
   215 -- Display a html formatted public message of the day
   216 -- ------------------------------------------------------------------------
   217 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
   220 -- Display a html formatted internal message of the day
   221 -- ------------------------------------------------------------------------
   222 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
   226 -- Free timings
   227 -- ------------------------------------------------------------------------
   228 -- This example expects a date string entered in the free timing field
   229 -- by the user creating a poll, interpreting it as target date for then
   230 -- poll and splits the remaining time at the ratio of 4:1:2
   231 -- Please note, polling policies never have an admission phase
   232 -- The available_func is optional, if not set any target date is allowed
   234 --[[
   235 config.free_timing = {
   236   calculate_func = function(policy, timing_string)
   237     local function interval_by_seconds(secs)
   238       local secs_per_day = 60 * 60 * 24
   239       local days
   240       days = math.floor(secs / secs_per_day)
   241       secs = secs - days * secs_per_day
   242       return days .. " days " .. secs .. " seconds"
   243     end
   244     local target_date = parse.date(timing_string, atom.date)
   245     if not target_date then
   246       return false
   247     end
   248     local target_timestamp = target_date.midday
   249     local now = atom.timestamp:get_current()
   250     trace.debug(target_timestamp, now)
   251     local duration = target_timestamp - now
   252     if duration < 0 then
   253       return false
   254     end
   255     return {
   256       discussion = interval_by_seconds(duration / 7 * 4),
   257       verification = interval_by_seconds(duration / 7 * 1),
   258       voting = interval_by_seconds(duration / 7 * 2)
   259     }
   260   end,
   261   available_func = function(policy)
   262     return { 
   263       { name = "End of 2013", id = '2013-12-31' },
   264       { name = "End of 2014", id = '2014-12-31' },
   265       { name = "End of 2015", id = '2015-12-31' }
   266     }
   267   end
   268 }
   269 --]]
   272 -- External references
   273 -- ------------------------------------------------------------------------
   274 -- Rendering of external references
   276 --[[
   277 config.render_external_reference = {
   278   draft = function(draft, wrapper)
   279     wrapper(function()
   280       ui.tag{ content = draft.external_reference)
   281     end)
   282   end,
   283   initiative = function(initiative, wrapper)
   284     wrapper(function()
   285       ui.tag{ content = initiative.external_reference)
   286     end)
   287   end
   288 end
   289 --]]
   292 -- Configuration of OAuth2 service, defaults to OAuth2 disabled
   293 -- ------------------------------------------------------------------------
   294 -- config.oauth2 = {}
   296 -- Additional scopes
   297 -- config.oauth2.available_scopes = {
   298 --   { scope = "privA", name = { de = "Beispielprivileg A", en = "Example privilege A" } },
   299 --   { scope = "privB", name = { de = "Beispielprivileg B", en = "Example privilege B" } }
   300 -- }
   302 -- OAuth2 endpoint magic string for dynamic app registration
   303 -- ------------------------------------------------------------------------
   304 -- config.oauth2.endpoint_magic = "liquidfeedback_client_redirection_endpoint"
   306 -- OAuth2 Token lifetime and timings
   307 -- ------------------------------------------------------------------------
   308 -- config.oauth2.authorization_code_lifetime = 5 * 60
   309 -- config.oauth2.refresh_token_lifetime = 60 * 60 * 24 * 30 * 3
   310 -- config.oauth2.refresh_pause = 60
   311 -- config.oauth2.refresh_grace_period = 60
   312 -- config.oauth2.access_token_lifetime = 60 * 60
   316 -- Admin logger
   317 -- ------------------------------------------------------------------------
   318 -- Logging administrative activities
   319 -- disabled by default
   321 -- config.admin_logger = function(params)
   322 --   local adminid = app.session.member_id
   323 --   local adminname = app.session.member.name
   324 --   local url = params._webmcp_path
   325 --   -- do something (e.g. calling 'logger' via extos.pfilter)
   326 -- end
   331 -- Application server fork configuration
   332 -- ------------------------------------------------------------------------
   333 -- config.fork = {
   334 --   pre = 2,            -- desired number of spare (idle) processes
   335 --   min = 4,            -- minimum number of processes
   336 --   max = 128,          -- maximum number of processes (hard limit)
   337 --   delay = 0.125,      -- delay (seconds) between creation of spare processes
   338 --   error_delay = 2,    -- delay (seconds) before retry of failed process creation
   339 --   exit_delay = 2,     -- delay (seconds) between destruction of excessive spare processes
   340 --   idle_timeout = 900, -- idle time (seconds) after a fork gets terminated (0 for no timeout)
   341 --   memory_limit = 0,   -- maximum memory consumption (bytes) before process gets terminated
   342 --   min_requests = 50,  -- minimum count of requests handled before fork is terminated
   343 --   max_requests = 100  -- maximum count of requests handled before fork is terminated
   344 -- }
   347 -- HTTP server options
   348 -- ------------------------------------------------------------------------
   349 -- http_options = {
   350 --   static_headers            = {}            -- string or table of static headers to be returned with every request
   351 --   request_header_size_limit = 1024*1024,    -- maximum size of request body sent by client
   352 --   request_body_size_limit   = 64*1024*1024, -- maximum size of request body sent by client
   353 --   idle_timeout              = 65,           -- maximum time until receiving the first byte of the request headera
   354 --   stall_timeout             = 60,           -- maximum time a client connection may be stalled
   355 --   request_header_timeout    = 120,          -- maximum time until receiving the remaining bytes of the request header
   356 --   response_timeout          = 3600,         -- time in which request body and response must be sent
   357 --   maximum_input_chunk_size  = 16384         -- tweaks behavior of request-body parser
   358 --   minimum_output_chunk_size = 1024          -- chunk size for chunked-transfer-encoding
   359 -- }
   362 -- WebMCP accelerator
   363 -- ------------------------------------------------------------------------
   364 -- uncomment the following line to use C implementations of chosen
   365 -- functions:
   366 -- ------------------------------------------------------------------------
   367 -- require 'webmcp_accelerator'
   370 -- Trace debug
   371 -- ------------------------------------------------------------------------
   372 -- uncomment the following line to enable debug trace
   373 -- ------------------------------------------------------------------------
   374 -- config.enable_debug_trace = true
   377 -- Configuration of lf4rcs, disabled by default
   378 -- for example configration see _lf4rcs.lua
   379 -- ------------------------------------------------------------------------
   380 -- execute.config("_lf4rcs")
   383 -- Configuration of ldap authentication, disabled by default
   384 -- for example configration, see _ldap.lua
   385 -- for active directory example, see _ldap_ad.lua
   386 -- ------------------------------------------------------------------------
   387 -- execute.config("_ldap")
   388 -- execute.config("_ldap_ad")
   391 -- Integration of Etherpad, disabled by default
   392 -- ------------------------------------------------------------------------
   393 --config.etherpad = {
   394 --  base_url = "http://example.com:9001/",
   395 --  api_base = "http://localhost:9001/",
   396 --  api_key = "mysecretapikey",
   397 --  group_id = "mygroupname",
   398 --  cookie_path = "/"
   399 --}
   401 -- Integration of FirstLife
   402 -- ------------------------------------------------------------------------
   403 --[[
   404 config.firstlife = {
   405   coordinates = "",
   406   areaviewer_url = "about:blank",
   407   inputmap_url = "about:blank"
   408 }
   409 config.allow_new_draft_callback = true
   410 --]]
