# HG changeset patch # User jbe # Date 1330448382 -3600 # Node ID 75ce928990497a2be401c08c20d545e62030e0fd # Parent 07dc88da30cb9c005c77be3f8836bcec84d2549a Work on "config/example.lua" as complete example configuration; Removed config.absolute_base_url diff -r 07dc88da30cb -r 75ce92899049 app/main/_filter_view/34_stylesheet.lua --- a/app/main/_filter_view/34_stylesheet.lua Tue Feb 28 16:38:54 2012 +0100 +++ b/app/main/_filter_view/34_stylesheet.lua Tue Feb 28 17:59:42 2012 +0100 @@ -8,11 +8,11 @@ if value then slot.put_into("stylesheet_url", value) else - slot.put_into("stylesheet_url", config.absolute_base_url .. "static/style.css") + slot.put_into("stylesheet_url", request.get_relative_baseurl() .. "static/style.css") end execute.inner() if config.footer_html then slot.put_into("footer", config.footer_html) -end \ No newline at end of file +end diff -r 07dc88da30cb -r 75ce92899049 app/main/index/_action/reset_password.lua --- a/app/main/index/_action/reset_password.lua Tue Feb 28 16:38:54 2012 +0100 +++ b/app/main/index/_action/reset_password.lua Tue Feb 28 17:59:42 2012 +0100 @@ -22,9 +22,9 @@ local content = slot.use_temporary(function() slot.put(_"Hello " .. member.name .. ",\n\n") slot.put(_"to reset your password please click on the following link:\n\n") - slot.put(config.absolute_base_url .. "index/reset_password.html?secret=" .. member.password_reset_secret .. "\n\n") + slot.put(request.get_absolute_baseurl() .. "index/reset_password.html?secret=" .. member.password_reset_secret .. "\n\n") slot.put(_"If this link is not working, please open following url in your web browser:\n\n") - slot.put(config.absolute_base_url .. "index/reset_password.html\n\n") + slot.put(request.get_absolute_baseurl() .. "index/reset_password.html\n\n") slot.put(_"On that page please enter the reset code:\n\n") slot.put(member.password_reset_secret .. "\n\n") end) @@ -73,4 +73,4 @@ slot.put_into("notice", _"Password has been reset successfully") -end \ No newline at end of file +end diff -r 07dc88da30cb -r 75ce92899049 app/main/initiative/_action/create.lua --- a/app/main/initiative/_action/create.lua Tue Feb 28 16:38:54 2012 +0100 +++ b/app/main/initiative/_action/create.lua Tue Feb 28 17:59:42 2012 +0100 @@ -94,7 +94,7 @@ .. "api/1/createGroupPad?apikey=" .. config.etherpad.api_key .. "&groupID=" .. config.etherpad.group_id .. "&padName=Issue" .. tostring(issue.id) - .. "&text=" .. config.absolute_base_url .. "issue/show/" .. tostring(issue.id) .. ".html" + .. "&text=" .. request.get_absolute_baseurl() .. "issue/show/" .. tostring(issue.id) .. ".html" ) end end @@ -129,4 +129,4 @@ module = "initiative", view = "show", id = initiative.id -} \ No newline at end of file +} diff -r 07dc88da30cb -r 75ce92899049 config/example.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/example.lua Tue Feb 28 17:59:42 2012 +0100 @@ -0,0 +1,127 @@ +request.set_absolute_baseurl(request.get_relative_baseurl()) +-- request.set_absolute_baseurl("http://www.example.com/lf/") + +config.app_name = "LiquidFeedback" +config.app_version = "2.beta1" + +config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" + +config.app_logo = nil + +config.app_service_provider = "Snake Oil
10000 Berlin
Germany" + +--config.footer_html = 'some link' + +config.use_terms = "=== Terms of Use ===\nNothing is allowed." +--config.use_terms_html = "" + +config.use_terms_checkboxes = { + { + name = "terms_of_use_v1", + html = "I accept the terms of use.", + not_accepted_error = "You have to accept the terms of use to be able to register." + } +} + +config.locked_profile_fields = { + login = false, + notify_email = false, + name = false, + organizational_unit = false, + internal_posts = false, + realname = false, + birthday = false, + address = false, + email = false +} + +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 +} + +config.member_image_default_file = { + avatar = "avatar.jpg", + photo = nil +} + +config.default_lang = "en" + +-- after how long is a user considered inactive and the trustee will see warning +-- notation is according to postgresql intervals +config.delegation_warning_time = '6 months' + +config.mail_subject_prefix = "[LiquidFeedback] " + +config.fastpath_url_func = nil + +config.download_dir = nil + +config.download_use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten" + +config.public_access = false -- Available options: "anonymous", "pseudonym" + +config.api_enabled = true + +config.feature_rss_enabled = false -- feature is broken + +config.single_unit_id = false + +-- 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_404_route{ module = 'index', view = '404' } + +-- 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") + +-- open and set default database handle +db = assert(mondelefant.connect{ + engine='postgresql', + dbname='liquid_feedback_p' +}) +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 + +config.formatting_engine_executeables = { + rocketwiki= "/opt/rocketwiki-lqfb/rocketwiki-lqfb", + compat = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat" +} + +config.fastpath_url_func = function(member_id, image_type) + return request.get_absolute_baseurl() .. "fastpath/getpic?" .. tostring(member_id) .. "+" .. tostring(image_type) +end + diff -r 07dc88da30cb -r 75ce92899049 model/member.lua --- a/model/member.lua Tue Feb 28 16:38:54 2012 +0100 +++ b/model/member.lua Tue Feb 28 17:59:42 2012 +0100 @@ -334,9 +334,9 @@ local content = slot.use_temporary(function() slot.put(_"Hello\n\n") slot.put(_"You are invited to LiquidFeedback. To register please click the following link:\n\n") - slot.put(config.absolute_base_url .. "index/register.html?invite_key=" .. self.invite_code .. "\n\n") + slot.put(request.get_absolute_baseurl() .. "index/register.html?invite_key=" .. self.invite_code .. "\n\n") slot.put(_"If this link is not working, please open following url in your web browser:\n\n") - slot.put(config.absolute_base_url .. "index/register.html\n\n") + slot.put(request.get_absolute_baseurl() .. "index/register.html\n\n") slot.put(_"On that page please enter the invite key:\n\n") slot.put(self.invite_code .. "\n\n") end) @@ -361,9 +361,9 @@ local content = slot.use_temporary(function() slot.put(_"Hello " .. self.name .. ",\n\n") slot.put(_"Please confirm your email address by clicking the following link:\n\n") - slot.put(config.absolute_base_url .. "index/confirm_notify_email.html?secret=" .. self.notify_email_secret .. "\n\n") + slot.put(request.get_absolute_baseurl() .. "index/confirm_notify_email.html?secret=" .. self.notify_email_secret .. "\n\n") slot.put(_"If this link is not working, please open following url in your web browser:\n\n") - slot.put(config.absolute_base_url .. "index/confirm_notify_email.html\n\n") + slot.put(request.get_absolute_baseurl() .. "index/confirm_notify_email.html\n\n") slot.put(_"On that page please enter the confirmation code:\n\n") slot.put(self.notify_email_secret .. "\n\n") end) @@ -479,4 +479,4 @@ :optional_object_mode() :for_share() :exec()) and true or false -end \ No newline at end of file +end