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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 class trac( 1 class trac(
2 $domain, 2 $domain,
3 $certificate, 3 $certificate,
4 $private_key, 4 $private_key,
5 $fcgi_config_dir = '/etc/nginx/trac.d', 5 $fcgi_config_dir = '/etc/nginx/trac.d',
6 $is_default = false) inherits private::trac { 6 $is_default = false) inherits private::trac {
7 7
8 package {['python-mysqldb','python-pip','subversion', 'tofrodos', 'graphviz']: 8 package {['python-mysqldb','python-pip','subversion', 'tofrodos', 'graphviz']:
9 ensure => present 9 ensure => present
10 } 10 }
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 Exec['install_TicketTemplate'], 226 Exec['install_TicketTemplate'],
227 Exec['install_NeverNotifyUpdater'], 227 Exec['install_NeverNotifyUpdater'],
228 Exec['install_MasterTickets'], 228 Exec['install_MasterTickets'],
229 Exec['install_ThemeEngine'], 229 Exec['install_ThemeEngine'],
230 Exec['install_Tractags'], 230 Exec['install_Tractags'],
231 Exec['install_TracSpamFilter'], 231 Exec['install_TracSpamFilter'],
232 Exec['install_PrivateTickets'], 232 Exec['install_PrivateTickets'],
233 Exec['install_TracXMLRPC'], 233 Exec['install_TracXMLRPC'],
234 Exec['install_TracHTTPAuth']], 234 Exec['install_TracHTTPAuth']],
235 } 235 }
236 236
237 # Ref https://issues.adblockplus.org/ticket/4641
238 $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.
239 ### Local modifications to the trac.fcgi file
240 from trac.web.session import Session
241 orig_get = Session.get
242 def patched_get(self, key, default=None):
243 if key == 'accesskeys':
244 return '1'
245 return orig_get(self, key, default)
246 Session.get = patched_get
247 ### End of local modifications
248 "
249
237 exec {"deploy_$name": 250 exec {"deploy_$name":
238 command => "trac-admin /home/trac/$environment \ 251 command => "trac-admin /home/trac/$environment \
239 deploy /home/trac/htdocs-$name \ 252 deploy /home/trac/htdocs-$name \
240 && fromdos /home/trac/htdocs-$name/cgi-bin/trac.fcgi \ 253 && fromdos /home/trac/htdocs-$name/cgi-bin/trac.fcgi \
241 && chmod 755 /home/trac/htdocs-$name/cgi-bin/trac.fcgi", 254 && chmod 755 /home/trac/htdocs-$name/cgi-bin/trac.fcgi",
242 user => trac, 255 user => trac,
243 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', 256 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
244 require => [ 257 require => [
245 Exec["update_env_$name"], 258 Exec["update_env_$name"],
246 Package["tofrodos"]], 259 Package["tofrodos"]],
260 } ->
261 exec {"append_cgi_config_to_$name":
262 command => "echo \"$cgi_performance_fix\" >> /home/trac/htdocs-$name/cgi-b in/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.
263 user => trac,
264 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
247 } 265 }
248 266
249 file {"/home/trac/htdocs-$name/htdocs/common/logo.png": 267 file {"/home/trac/htdocs-$name/htdocs/common/logo.png":
250 ensure => present, 268 ensure => present,
251 source => $logo, 269 source => $logo,
252 owner => trac, 270 owner => trac,
253 require => Exec["deploy_$name"], 271 require => Exec["deploy_$name"],
254 } 272 }
255 273
256 spawn-fcgi::pool {"tracd_${name}": 274 spawn-fcgi::pool {"tracd_${name}":
257 ensure => present, 275 ensure => present,
258 fcgi_app => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi", 276 fcgi_app => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi",
(...skipping 13 matching lines...) Expand all
272 # Daily restart required for log rotation of all instances at once 290 # Daily restart required for log rotation of all instances at once
273 cron {'restart-trac-daily': 291 cron {'restart-trac-daily':
274 command => 'service spawn-fcgi restart >/tmp/spawn-fcgi-restart.log', 292 command => 'service spawn-fcgi restart >/tmp/spawn-fcgi-restart.log',
275 environment => hiera('cron::environment', []), 293 environment => hiera('cron::environment', []),
276 hour => '1', 294 hour => '1',
277 minute => '0', 295 minute => '0',
278 user => 'root', 296 user => 'root',
279 } 297 }
280 } 298 }
281 299
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld