liquid_feedback_frontend
view config/example.lua @ 1057:6f3e01b266b3
Removed not needed check
| author | bsw | 
|---|---|
| date | Wed Jul 16 21:47:34 2014 +0200 (2014-07-16) | 
| parents | 66da54c0ae6c | 
| children | 58f48a8a202a | 
 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   },
    71 }
    74 -- Public access level
    75 -- ------------------------------------------------------------------------
    76 -- Available options:
    77 -- "none" 
    78 --     -> Closed user group, no public access at all
    79 --        (except login/registration/password reset)
    80 -- "anonymous"
    81 --     -> Shows only initiative/suggestions texts and aggregated
    82 --        supporter/voter counts
    83 -- "authors_pseudonymous" 
    84 --     -> Like anonymous, but shows screen names of authors
    85 -- "all_pseudonymous" 
    86 --     -> Show everything a member can see, except profile pages
    87 -- "everything"
    88 --     -> Show everything a member can see, including profile pages
    89 -- ------------------------------------------------------------------------
    90 config.public_access = "none"
    94 -- ========================================================================
    95 -- OPTIONAL
    96 -- Remove leading -- to use a option
    97 -- ========================================================================
    99 -- List of enabled languages, defaults to available languages
   100 -- ------------------------------------------------------------------------
   101 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'nl', 'zh-Hans', 'zh-TW' }
   103 -- Default language, defaults to "en"
   104 -- ------------------------------------------------------------------------
   105 -- config.default_lang = "en"
   107 -- after how long is a user considered inactive and the trustee will see warning,
   108 -- notation is according to postgresql intervals, default: no warning at all
   109 -- ------------------------------------------------------------------------
   110 -- config.delegation_warning_time = '6 months'
   112 -- after which time a user is advised (_soft) or forced (_hard) to check
   113 -- unit and area delegations. default: no check at all
   114 -- ------------------------------------------------------------------------
   115 -- config.check_delegations_interval_hard = "6 months"
   116 -- config.check_delegations_interval_soft = "3 months"
   118 -- default option when checking delegations
   119 -- available options: "confirm", "revoke" and "none", default: "confirm"
   120 -- ------------------------------------------------------------------------
   121 -- config.check_delegations_default = "confirm"
   123 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
   124 -- ------------------------------------------------------------------------
   125 -- config.mail_subject_prefix = "[LiquidFeedback] "
   127 -- Sender of all automatic mails, defaults to system defaults
   128 -- ------------------------------------------------------------------------
   129 -- config.mail_envelope_from = "liquidfeedback@example.com"
   130 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
   131 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
   133 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
   134 -- ------------------------------------------------------------------------
   135 -- config.password_hash_algorithm = "crypt_sha512"
   136 -- config.password_hash_algorithm = "crypt_sha256"
   137 -- config.password_hash_algorithm = "crypt_md5"
   139 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
   140 -- (defaults to minimum 10000 and maximum 20000)
   141 -- ------------------------------------------------------------------------
   142 -- config.password_hash_min_rounds = 10000
   143 -- 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 -- Display a html formatted public message of the day
   167 -- ------------------------------------------------------------------------
   168 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
   170 -- Display a html formatted internal message of the day
   171 -- ------------------------------------------------------------------------
   172 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
   174 -- Automatic issue related discussion URL
   175 -- ------------------------------------------------------------------------
   176 -- config.issue_discussion_url_func = function(issue)
   177 --   return "http://example.com/discussion/issue_" .. tostring(issue.id)
   178 -- end
   180 -- Integration of Etherpad, disabled by default
   181 -- ------------------------------------------------------------------------
   182 --config.etherpad = {
   183 --  base_url = "http://example.com:9001/",
   184 --  api_base = "http://localhost:9001/",
   185 --  api_key = "mysecretapikey",
   186 --  group_id = "mygroupname",
   187 --  cookie_path = "/"
   188 --}
   190 -- Free timings
   191 -- ------------------------------------------------------------------------
   192 -- This example expects a date string entered in the free timing field
   193 -- by the user creating a poll, interpreting it as target date for then
   194 -- poll and splits the remaining time at the ratio of 4:1:2
   195 -- Please note, polling policies never have an admission phase
   196 -- The available_func is optional, if not set any target date is allowed
   198 config.free_timing = {
   199   calculate_func = function(policy, timing_string)
   200     function interval_by_seconds(secs)
   201       local secs_per_day = 60 * 60 * 24
   202       local days
   203       days = math.floor(secs / secs_per_day)
   204       secs = secs - days * secs_per_day
   205       return days .. " days " .. secs .. " seconds"
   206     end
   207     local target_date = parse.date(timing_string, atom.date)
   208     if not target_date then
   209       return false
   210     end
   211     local target_timestamp = target_date.midday
   212     local now = atom.timestamp:get_current()
   213     trace.debug(target_timestamp, now)
   214     local duration = target_timestamp - now
   215     if duration < 0 then
   216       return false
   217     end
   218     return {
   219       discussion = interval_by_seconds(duration / 7 * 4),
   220       verification = interval_by_seconds(duration / 7 * 1),
   221       voting = interval_by_seconds(duration / 7 * 2)
   222     }
   223   end,
   224   available_func = function(policy)
   225     return { 
   226       { name = "End of 2013", id = '2013-12-31' },
   227       { name = "End of 2014", id = '2014-12-31' },
   228       { name = "End of 2015", id = '2015-12-31' }
   229     }
   230   end
   231 }
   233 -- WebMCP accelerator
   234 -- uncomment the following two lines to use C implementations of chosen
   235 -- functions and to disable garbage collection during the request, to
   236 -- increase speed:
   237 -- ------------------------------------------------------------------------
   238 -- require 'webmcp_accelerator'
   239 -- if cgi then collectgarbage("stop") end
   241 -- Trace debug
   242 -- uncomment the following line to enable debug trace
   243 -- config.enable_debug_trace = true
   245 -- ========================================================================
   246 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
   247 -- ========================================================================
   249 execute.config("init")
