LQPP/Installation/piraten-pp-config
< LQPP | Installation
-- GENERAL -----------------------------------------------------
config.instance_name = "Piratenpartei"
config.instance_prefix = "pp"
config.absolute_base_url = "https://lqfb.piratenpartei.de/".. config.instance_prefix .. "/"
config.app_logo = "logo.png"
config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
config.mail_subject_prefix = "[lqfb.piratenpartei.de] " config.mail_from = { name = "lqfb.piratenpartei.de", address = "support@lqfb.piratenpartei.de" }
request.set_404_route{ module = 'index', view = '404' }
config.member_image_default_file = { avatar = "avatar.jpg", photo = nil }
config.member_image_content_type = "image/jpeg" config.member_image_convert_func = { avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "- thumbnail", "48x48", "jpeg:-") end, photo = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end }
----------------------------------------------------- -- DATABASE -----------------------------------------------------
db = assert(mondelefant.connect{ engine='postgresql', dbname='liquid_feedback_' .. config.instance_prefix })
at_exit(function() db:close() end)
function mondelefant.class_prototype:get_db_conn() return db end
-- enable output of SQL commands in trace system function db:sql_tracer(command) return function(error_info) local error_info = error_info or {} trace.sql{ command = command, error_position = error_info.position } end end
-- TODO abstraction -- get record by id function mondelefant.class_prototype:by_id(id) local selector = self:new_selector() selector:add_where{ 'id = ?', id } selector:optional_object_mode() return selector:exec() end
----------------------------------------------------- -- FEATURES -----------------------------------------------------
config.issue_discussion_url_func = function(issue) return "http://piratenpad.de/" .. string.upper(config.instance_prefix) .. ":LiquidFeedback_Themendiskussion/" .. issue.id end
config.formatting_engine_executeables = { rocketwiki= "/opt/liquid_feedback/rocketwiki/rocketwiki-lqfb", compat = "/opt/liquid_feedback/rocketwiki/rocketwiki-lqfb-compat" }
config.public_access = pseudonym -- Available options: "anonymous", "pseudonym"
config.api_enabled = true
config.feature_rss_enabled = true
config.download_dir = "/opt/liquid_feedback/download/pp/"
----------------------------------------------------- -- LEGAL STUFF -----------------------------------------------------
config.app_service_provider = "Piratenpartei Deutschland (PIRATEN)
Pflugstr. 9a
10115 Berlin
E-Mail Support: <a href='mailto:support@lqfb.piratenpartei.de'>support@lqfb.piratenpartei.de</a>
E-Mail Administratoren: <a href='mailto:admins@lqfb.piratenpartei.de'>admins@lqfb.piratenpartei.de</a>
Diskussion, Support & FAQ: <a href='BE:Liquid_Democracy_Test'>[[BE:Liquid_Democracy_Test</a>"]]
config.use_terms = "=== Nutzungsbedingungen ===\n1. Wenn man keine Ahnung hat, einfach mal Kresse halten."
config.download_use_terms = "Es gelten die Nutzungsbedingungen, insbesondere Punkt 1 ist zu beachten:\n\n"
----------------------------------------------------- -- PERFORMANCE -----------------------------------------------------
config.fastpath_url_func = function(member_id, image_type) return "https://lqfb.piratenpartei.de/" .. config.instance_prefix .. "/fastpath/getpic?" .. tostring(member_id) .. "+" .. tostring(image_type) end
-- uncomment the following two lines to use C implementations of chosen -- functions and to disable garbage collection during the request, to -- increase speed: -- -- require 'webmcp_accelerator' -- collectgarbage("stop")
----------------------------------------------------- -- What's that -----------------------------------------------------
config.app_name = "LiquidFeedback" config.app_version = "beta18"
-- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED! config.auth_openid_enabled = false config.auth_openid_https_as_default = true config.auth_openid_identifier_check_func = function(uri) return false end
request.set_allowed_json_request_slots{ "title", "actions", "support", "default", "trace", "system_error" }
if request.get_json_request_slots() then request.force_absolute_baseurl() end
request.set_absolute_baseurl(config.absolute_base_url)