Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/trac/manifests/init.pp

Issue 29362580: Issue 4641 - Append performance fix to trac cgi file (Closed)
Patch Set: Created Nov. 15, 2016, 6:42 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/trac/manifests/init.pp
===================================================================
--- a/modules/trac/manifests/init.pp
+++ b/modules/trac/manifests/init.pp
@@ -233,7 +233,20 @@
Exec['install_TracXMLRPC'],
Exec['install_TracHTTPAuth']],
}
-
+
+# Ref https://issues.adblockplus.org/ticket/4641
+$cgi_performance_fix = "
Wladimir Palant 2016/11/16 09:26:18 Nit: This isn't really related to CGI in any way,
f.nicolaisen 2016/11/16 15:01:28 Acknowledged.
+### Local modifications to the trac.fcgi file
+from trac.web.session import Session
+orig_get = Session.get
+def patched_get(self, key, default=None):
+ if key == 'accesskeys':
+ return '1'
+ return orig_get(self, key, default)
+Session.get = patched_get
+### End of local modifications
+"
+
exec {"deploy_$name":
command => "trac-admin /home/trac/$environment \
deploy /home/trac/htdocs-$name \
@@ -244,8 +257,13 @@
require => [
Exec["update_env_$name"],
Package["tofrodos"]],
+ } ->
+ exec {"append_cgi_config_to_$name":
+ command => "echo \"$cgi_performance_fix\" >> /home/trac/htdocs-$name/cgi-bin/trac.fcgi",
Wladimir Palant 2016/11/16 09:26:18 Actually, this needs to be added at the top of the
f.nicolaisen 2016/11/16 15:01:28 Acknowledged.
+ user => trac,
+ path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
Wladimir Palant 2016/11/16 09:26:18 The way I see it, this command will run every time
f.nicolaisen 2016/11/16 15:01:28 Won't it only run after the "deploy_$name" exec is
Wladimir Palant 2016/11/16 15:16:44 Given that deploy_$name runs every time - sure. No
}
-
+
file {"/home/trac/htdocs-$name/htdocs/common/logo.png":
ensure => present,
source => $logo,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld