| rev | 
   line source | 
| 
bsw@1045
 | 
     1 -- ========================================================================
 | 
| 
bsw@1045
 | 
     2 -- MANDATORY (MUST BE CAREFULLY CHECKED AND PROPERLY SET!)
 | 
| 
bsw@1045
 | 
     3 -- ========================================================================
 | 
| 
bsw@1045
 | 
     4 
 | 
| 
bsw@1045
 | 
     5 -- Name of this instance, defaults to name of config file
 | 
| 
bsw@1045
 | 
     6 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
     7 config.instance_name = "Public Software Group e.V."
 | 
| 
bsw@1045
 | 
     8 
 | 
| 
bsw@1045
 | 
     9 
 | 
| 
bsw@1045
 | 
    10 -- Information about service provider (HTML)
 | 
| 
bsw@1045
 | 
    11 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
    12 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
 | 
| 
bsw@1045
 | 
    13 
 | 
| 
bsw@1045
 | 
    14 
 | 
| 
bsw@1045
 | 
    15 -- A HTML formatted text the user has to accept while registering
 | 
| 
bsw@1045
 | 
    16 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
    17 config.use_terms = "<h1>Terms of Use</h1><p>Insert terms here</p>"
 | 
| 
bsw@1045
 | 
    18 
 | 
| 
bsw@1045
 | 
    19 
 | 
| 
bsw@1045
 | 
    20 -- Checkbox(es) the user has to accept while registering
 | 
| 
bsw@1045
 | 
    21 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
    22 config.use_terms_checkboxes = {
 | 
| 
bsw@1045
 | 
    23   {
 | 
| 
bsw@1045
 | 
    24     name = "terms_of_use_v1",
 | 
| 
bsw@1045
 | 
    25     html = "I accept the terms of use.",
 | 
| 
bsw@1045
 | 
    26     not_accepted_error = "You have to accept the terms of use to be able to register."
 | 
| 
bsw@1045
 | 
    27   },
 | 
| 
bsw@1045
 | 
    28 --  {
 | 
| 
bsw@1045
 | 
    29 --    name = "extra_terms_of_use_v1",
 | 
| 
bsw@1045
 | 
    30 --    html = "I accept the extra terms of use.",
 | 
| 
bsw@1045
 | 
    31 --    not_accepted_error = "You have to accept the extra terms of use to be able to register."
 | 
| 
bsw@1045
 | 
    32 --  }
 | 
| 
bsw@1045
 | 
    33 }
 | 
| 
bsw@1045
 | 
    34 
 | 
| 
bsw@1045
 | 
    35   
 | 
| 
bsw@1045
 | 
    36 -- Absolute base url of application
 | 
| 
bsw@1045
 | 
    37 -- ------------------------------------------------------------------------
 | 
| 
bsw@1139
 | 
    38 config.absolute_base_url = "http://127.0.0.1:8080/"
 | 
| 
bsw@1045
 | 
    39 
 | 
| 
bsw@1045
 | 
    40 
 | 
| 
bsw@1045
 | 
    41 -- Connection information for the LiquidFeedback database
 | 
| 
bsw@1045
 | 
    42 -- ------------------------------------------------------------------------
 | 
| 
bsw@1139
 | 
    43 config.database = { engine='postgresql', dbname='lf3' }
 | 
| 
bsw@1045
 | 
    44 
 | 
| 
bsw@1045
 | 
    45 
 | 
| 
bsw@1045
 | 
    46 -- Location of the rocketwiki binaries
 | 
| 
bsw@1045
 | 
    47 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
    48 config.enforce_formatting_engine = "markdown2"
 | 
| 
bsw@1045
 | 
    49 
 | 
| 
bsw@1045
 | 
    50 config.formatting_engines = {
 | 
| 
bsw@1045
 | 
    51   { id = "markdown2",
 | 
| 
bsw@1045
 | 
    52     name = "python-markdown2",
 | 
| 
bsw@1045
 | 
    53     executable = "markdown2",
 | 
| 
bsw@1052
 | 
    54     args = {'-s', 'escape', '-x', 'nofollow,wiki-tables'},
 | 
| 
bsw@1045
 | 
    55     remove_images = true
 | 
| 
bsw@1045
 | 
    56   },
 | 
| 
bsw@1045
 | 
    57   { id = "markdown_py",
 | 
| 
bsw@1045
 | 
    58     name = "Python Markdown",
 | 
| 
bsw@1045
 | 
    59     executable = "markdown_py",
 | 
| 
bsw@1045
 | 
    60     args = {'-s', 'escape', '-x', 'extra', '-x', 'nl2br', '-x', 'sane_lists'},
 | 
| 
bsw@1045
 | 
    61     remove_images = true
 | 
| 
bsw@1045
 | 
    62   },
 | 
| 
bsw@1045
 | 
    63   { id = "rocketwiki",
 | 
| 
bsw@1045
 | 
    64     name = "RocketWiki",
 | 
| 
bsw@1045
 | 
    65     executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb",
 | 
| 
bsw@1045
 | 
    66     remove_images = false
 | 
| 
bsw@1045
 | 
    67   },
 | 
| 
bsw@1045
 | 
    68   { id = "compat",
 | 
| 
bsw@1045
 | 
    69     name = "Traditional WIKI syntax",
 | 
| 
bsw@1045
 | 
    70     executable = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat",
 | 
| 
bsw@1045
 | 
    71     remove_images = false
 | 
| 
bsw@1045
 | 
    72   }
 | 
| 
bsw@1045
 | 
    73 }
 | 
| 
bsw@1045
 | 
    74 
 | 
| 
bsw@1045
 | 
    75 -- Public access level
 | 
| 
bsw@1045
 | 
    76 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
    77 -- Available options:
 | 
| 
bsw@1045
 | 
    78 -- "none" 
 | 
| 
bsw@1045
 | 
    79 --     -> Closed user group, no public access at all
 | 
| 
bsw@1045
 | 
    80 --        (except login/registration/password reset)
 | 
| 
bsw@1045
 | 
    81 -- "anonymous"
 | 
| 
bsw@1045
 | 
    82 --     -> Shows only initiative/suggestions texts and aggregated
 | 
| 
bsw@1045
 | 
    83 --        supporter/voter counts
 | 
| 
bsw@1045
 | 
    84 -- "authors_pseudonymous" 
 | 
| 
bsw@1045
 | 
    85 --     -> Like anonymous, but shows screen names of authors
 | 
| 
bsw@1045
 | 
    86 -- "all_pseudonymous" 
 | 
| 
bsw@1045
 | 
    87 --     -> Show everything a member can see, except profile pages
 | 
| 
bsw@1045
 | 
    88 -- "everything"
 | 
| 
bsw@1045
 | 
    89 --     -> Show everything a member can see, including profile pages
 | 
| 
bsw@1045
 | 
    90 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
    91 config.public_access = "all_pseudonymous"
 | 
| 
bsw@1045
 | 
    92 
 | 
| 
bsw@1045
 | 
    93 
 | 
| 
bsw@1045
 | 
    94 
 | 
| 
bsw@1045
 | 
    95 -- ========================================================================
 | 
| 
bsw@1045
 | 
    96 -- OPTIONAL
 | 
| 
bsw@1045
 | 
    97 -- Remove leading -- to use a option
 | 
| 
bsw@1045
 | 
    98 -- ========================================================================
 | 
| 
bsw@1045
 | 
    99 
 | 
| 
bsw@1045
 | 
   100 -- List of enabled languages, defaults to available languages
 | 
| 
bsw@1045
 | 
   101 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   102 -- config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'nl', 'zh-TW' }
 | 
| 
bsw@1045
 | 
   103 
 | 
| 
bsw@1045
 | 
   104 -- Default language, defaults to "en"
 | 
| 
bsw@1045
 | 
   105 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   106 -- config.default_lang = "de"
 | 
| 
bsw@1045
 | 
   107 
 | 
| 
bsw@1045
 | 
   108 -- after how long is a user considered inactive and the trustee will see warning,
 | 
| 
bsw@1045
 | 
   109 -- notation is according to postgresql intervals, default: no warning at all
 | 
| 
bsw@1045
 | 
   110 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   111 config.delegation_warning_time = '1 hour'
 | 
| 
bsw@1045
 | 
   112 
 | 
| 
bsw@1045
 | 
   113 -- after which time a user is suggested to (_soft) or forced to (_hard) 
 | 
| 
bsw@1045
 | 
   114 -- confirm unit and area delegations. default: no confirmation at all
 | 
| 
bsw@1045
 | 
   115 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   116 -- config.check_delegations_interval_hard = "1 day"
 | 
| 
bsw@1045
 | 
   117 -- config.check_delegations_interval_soft = "3 seconds"
 | 
| 
bsw@1045
 | 
   118 
 | 
| 
bsw@1045
 | 
   119 -- default options should be checked when confirming delegations
 | 
| 
bsw@1045
 | 
   120 -- options: "confirm", "revoke" and "none"
 | 
| 
bsw@1045
 | 
   121 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   122 -- config.check_delegations_default = "confirm"
 | 
| 
bsw@1045
 | 
   123 
 | 
| 
bsw@1045
 | 
   124 -- Prefix of all automatic mails, defaults to "[Liquid Feedback] "
 | 
| 
bsw@1045
 | 
   125 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   126 -- config.mail_subject_prefix = "[LiquidFeedback] "
 | 
| 
bsw@1045
 | 
   127 
 | 
| 
bsw@1045
 | 
   128 -- Sender of all automatic mails, defaults to system defaults
 | 
| 
bsw@1045
 | 
   129 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   130 -- config.mail_envelope_from = "liquidfeedback@example.com"
 | 
| 
bsw@1045
 | 
   131 -- config.mail_from = { name = "LiquidFeedback", address = "liquidfeedback@example.com" }
 | 
| 
bsw@1045
 | 
   132 -- config.mail_reply_to = { name = "Support", address = "support@example.com" }
 | 
| 
bsw@1045
 | 
   133 
 | 
| 
bsw@1045
 | 
   134 -- Configuration of password hashing algorithm (defaults to "crypt_sha512")
 | 
| 
bsw@1045
 | 
   135 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   136 -- config.password_hash_algorithm = "crypt_sha512"
 | 
| 
bsw@1045
 | 
   137 -- config.password_hash_algorithm = "crypt_sha256"
 | 
| 
bsw@1045
 | 
   138 -- config.password_hash_algorithm = "crypt_md5"
 | 
| 
bsw@1045
 | 
   139 
 | 
| 
bsw@1045
 | 
   140 -- Number of rounds for crypt_sha* algorithms, minimum and maximum
 | 
| 
bsw@1045
 | 
   141 -- (defaults to minimum 10000 and maximum 20000)
 | 
| 
bsw@1045
 | 
   142 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   143 -- config.password_hash_min_rounds = 10000
 | 
| 
bsw@1045
 | 
   144 -- config.password_hash_max_rounds = 20000
 | 
| 
bsw@1045
 | 
   145 
 | 
| 
bsw@1045
 | 
   146 -- Supply custom url for avatar/photo delivery
 | 
| 
bsw@1045
 | 
   147 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   148 -- config.fastpath_url_func = nil
 | 
| 
bsw@1045
 | 
   149 
 | 
| 
bsw@1045
 | 
   150 -- Local directory for database dumps offered for download
 | 
| 
bsw@1045
 | 
   151 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   152 -- config.download_dir = nil
 | 
| 
bsw@1045
 | 
   153 
 | 
| 
bsw@1045
 | 
   154 -- Special use terms for database dump download
 | 
| 
bsw@1045
 | 
   155 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   156 -- config.download_use_terms = "=== Download use terms ===\n"
 | 
| 
bsw@1045
 | 
   157 
 | 
| 
bsw@1045
 | 
   158 -- Use custom image conversion, defaults to ImageMagick's convert
 | 
| 
bsw@1045
 | 
   159 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   160 --config.member_image_content_type = "image/jpeg"
 | 
| 
bsw@1045
 | 
   161 --config.member_image_convert_func = {
 | 
| 
bsw@1045
 | 
   162 --  avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail",   "48x48", "jpeg:-") end,
 | 
| 
bsw@1045
 | 
   163 --  photo =  function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
 | 
| 
bsw@1045
 | 
   164 --}
 | 
| 
bsw@1045
 | 
   165 
 | 
| 
bsw@1045
 | 
   166 config.member_image_content_type = "image/jpeg"
 | 
| 
bsw@1045
 | 
   167 config.member_image_convert_func = {
 | 
| 
bsw@1045
 | 
   168   avatar = function(data) return extos.pfilter(data, "convert",
 | 
| 
bsw@1045
 | 
   169     "jpeg:-",
 | 
| 
bsw@1045
 | 
   170     "-set", "option:distort:viewport", 
 | 
| 
bsw@1045
 | 
   171     "%[fx:min(w,h)]x%[fx:min(w,h)]+%[fx:max((w-h)/2,0)]+%[fx:max((h-w)/2,0)]",
 | 
| 
bsw@1045
 | 
   172     "-filter", "point",
 | 
| 
bsw@1045
 | 
   173     "-distort", "SRT", "0", 
 | 
| 
bsw@1045
 | 
   174     "+repage",
 | 
| 
bsw@1045
 | 
   175     "-define", "filter:filter=Sinc", 
 | 
| 
bsw@1045
 | 
   176     "-define", "filter:window=Jinc",
 | 
| 
bsw@1045
 | 
   177     "-define", "filter:lobes=3",
 | 
| 
bsw@1045
 | 
   178     "-thumbnail", "48x48",
 | 
| 
bsw@1045
 | 
   179     "jpeg:-"
 | 
| 
bsw@1045
 | 
   180   ) end,
 | 
| 
bsw@1045
 | 
   181   photo =  function(data) return extos.pfilter(data, "convert",
 | 
| 
bsw@1045
 | 
   182     "jpeg:-",
 | 
| 
bsw@1045
 | 
   183     "-define", "filter:filter=Sinc", 
 | 
| 
bsw@1045
 | 
   184     "-define", "filter:window=Jinc",
 | 
| 
bsw@1045
 | 
   185     "-define", "filter:lobes=3",
 | 
| 
bsw@1045
 | 
   186     "-thumbnail", "240x240",
 | 
| 
bsw@1045
 | 
   187     "jpeg:-"
 | 
| 
bsw@1045
 | 
   188   ) end
 | 
| 
bsw@1045
 | 
   189 }
 | 
| 
bsw@1045
 | 
   190 
 | 
| 
bsw@1045
 | 
   191 
 | 
| 
bsw@1045
 | 
   192 -- Display a html formatted public message of the day
 | 
| 
bsw@1045
 | 
   193 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   194 -- config.motd_public = "<h1>Message of the day (public)</h1><p>The MOTD is formatted with HTML</p>"
 | 
| 
bsw@1045
 | 
   195 
 | 
| 
bsw@1045
 | 
   196 -- Display a html formatted internal message of the day
 | 
| 
bsw@1045
 | 
   197 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   198 -- config.motd_intern = "<h1>Message of the day (intern)</h1><p>The MOTD is formatted with HTML</p>"
 | 
| 
bsw@1045
 | 
   199 
 | 
| 
bsw@1045
 | 
   200 -- Automatic issue related discussion URL
 | 
| 
bsw@1045
 | 
   201 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   202 -- config.issue_discussion_url_func = function(issue)
 | 
| 
bsw@1045
 | 
   203 --   return "http://example.com/discussion/issue_" .. tostring(issue.id)
 | 
| 
bsw@1045
 | 
   204 -- end
 | 
| 
bsw@1045
 | 
   205 
 | 
| 
bsw@1045
 | 
   206 -- Configuration of "tell others"
 | 
| 
bsw@1045
 | 
   207 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   208 config.tell_others = {
 | 
| 
bsw@1045
 | 
   209   initiative = function (initiative)
 | 
| 
bsw@1045
 | 
   210     local text = "i" .. initiative.id .. ": " .. initiative.name .. " " .. request.get_absolute_baseurl() .. "initiative/" .. initiative.id .. ".html"
 | 
| 
bsw@1045
 | 
   211     return {
 | 
| 
bsw@1045
 | 
   212       { content = "tweet this initiative", external = "https://twitter.com/intent/tweet?text=" .. encode.url_part(text) },
 | 
| 
bsw@1045
 | 
   213       { content = "send link with e-mail", external = "mailto:?subject=" .. encode.url_part(initiative.display_name) .. "&body=" .. encode.url_part(text) }
 | 
| 
bsw@1045
 | 
   214     }
 | 
| 
bsw@1045
 | 
   215   end
 | 
| 
bsw@1045
 | 
   216 }
 | 
| 
bsw@1045
 | 
   217 
 | 
| 
bsw@1045
 | 
   218 -- Integration of Etherpad, disabled by default
 | 
| 
bsw@1045
 | 
   219 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   220 --config.etherpad = {
 | 
| 
bsw@1045
 | 
   221 --  base_url = "http://example.com:9001/",
 | 
| 
bsw@1045
 | 
   222 --  api_base = "http://localhost:9001/",
 | 
| 
bsw@1045
 | 
   223 --  api_key = "mysecretapikey",
 | 
| 
bsw@1045
 | 
   224 --  group_id = "mygroupname",
 | 
| 
bsw@1045
 | 
   225 --  cookie_path = "/"
 | 
| 
bsw@1045
 | 
   226 --}
 | 
| 
bsw@1045
 | 
   227 
 | 
| 
bsw@1045
 | 
   228 -- Free timings, may be used together with polling policies
 | 
| 
bsw@1045
 | 
   229 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   230 -- This example expects a date string entered in the free timing field
 | 
| 
bsw@1045
 | 
   231 -- by the user creating a poll, interpreting it as target date for then
 | 
| 
bsw@1045
 | 
   232 -- poll and splits the remainig time at the ratio of 4:1:2
 | 
| 
bsw@1045
 | 
   233 -- Please note, polling policies never have an admission phase
 | 
| 
bsw@1045
 | 
   234 
 | 
| 
bsw@1045
 | 
   235 
 | 
| 
bsw@1045
 | 
   236 config.free_timing = {
 | 
| 
bsw@1045
 | 
   237   calculate_func = function(policy, timing_string)
 | 
| 
bsw@1045
 | 
   238     function interval_by_seconds(secs)
 | 
| 
bsw@1045
 | 
   239       local secs_per_day = 60 * 60 * 24
 | 
| 
bsw@1045
 | 
   240       local days
 | 
| 
bsw@1045
 | 
   241       days = math.floor(secs / secs_per_day)
 | 
| 
bsw@1045
 | 
   242       secs = secs - days * secs_per_day
 | 
| 
bsw@1045
 | 
   243       return days .. " days " .. secs .. " seconds"
 | 
| 
bsw@1045
 | 
   244     end
 | 
| 
bsw@1045
 | 
   245     local target_date = parse.date(timing_string, atom.date)
 | 
| 
bsw@1045
 | 
   246     if not target_date then
 | 
| 
bsw@1045
 | 
   247       return false
 | 
| 
bsw@1045
 | 
   248     end
 | 
| 
bsw@1045
 | 
   249     local target_timestamp = target_date.midday
 | 
| 
bsw@1045
 | 
   250     local now = atom.timestamp:get_current()
 | 
| 
bsw@1045
 | 
   251     trace.debug(target_timestamp, now)
 | 
| 
bsw@1045
 | 
   252     local duration = target_timestamp - now
 | 
| 
bsw@1045
 | 
   253     if duration < 0 then
 | 
| 
bsw@1045
 | 
   254       return false
 | 
| 
bsw@1045
 | 
   255     end
 | 
| 
bsw@1045
 | 
   256     return {
 | 
| 
bsw@1045
 | 
   257       discussion = interval_by_seconds(duration / 7 * 4),
 | 
| 
bsw@1045
 | 
   258       verification = interval_by_seconds(duration / 7 * 1),
 | 
| 
bsw@1045
 | 
   259       voting = interval_by_seconds(duration / 7 * 2)
 | 
| 
bsw@1045
 | 
   260     }
 | 
| 
bsw@1045
 | 
   261   end,
 | 
| 
bsw@1045
 | 
   262   available_func = function(policy)
 | 
| 
bsw@1045
 | 
   263     return { 
 | 
| 
bsw@1045
 | 
   264       { name = "End of 2013", id = '2013-12-31' },
 | 
| 
bsw@1045
 | 
   265       { name = "End of 2014", id = '2014-12-31' },
 | 
| 
bsw@1045
 | 
   266       { name = "End of 2015", id = '2015-12-31' }
 | 
| 
bsw@1045
 | 
   267     }
 | 
| 
bsw@1045
 | 
   268   end
 | 
| 
bsw@1045
 | 
   269 }
 | 
| 
bsw@1045
 | 
   270 
 | 
| 
bsw@1045
 | 
   271 
 | 
| 
bsw@1045
 | 
   272 config.enable_debug_trace = true
 | 
| 
bsw@1045
 | 
   273 
 | 
| 
bsw@1158
 | 
   274 config.fork = { pre = 64, max = 256, delay = 0.01 }
 | 
| 
bsw@1158
 | 
   275 
 | 
| 
bsw@1158
 | 
   276 
 | 
| 
bsw@1045
 | 
   277 -- WebMCP accelerator
 | 
| 
bsw@1045
 | 
   278 -- uncomment the following two lines to use C implementations of chosen
 | 
| 
bsw@1045
 | 
   279 -- functions and to disable garbage collection during the request, to
 | 
| 
bsw@1045
 | 
   280 -- increase speed:
 | 
| 
bsw@1045
 | 
   281 -- ------------------------------------------------------------------------
 | 
| 
bsw@1045
 | 
   282 -- require 'webmcp_accelerator'
 | 
| 
bsw@1045
 | 
   283 -- if cgi then collectgarbage("stop") end
 | 
| 
bsw@1045
 | 
   284 
 | 
| 
bsw@1045
 | 
   285 
 | 
| 
bsw@1045
 | 
   286 -- ========================================================================
 | 
| 
bsw@1045
 | 
   287 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
 | 
| 
bsw@1045
 | 
   288 -- ========================================================================
 | 
| 
bsw@1045
 | 
   289 
 | 
| 
bsw@1045
 | 
   290 execute.config("init")
 |