| OLD | NEW |
| (Empty) |
| 1 node 'issues1' { | |
| 2 | |
| 3 include private::trac | |
| 4 | |
| 5 class {'trac': | |
| 6 domain => 'issues.adblockplus.org', | |
| 7 certificate => 'issues.adblockplus.org_sslcert.pem', | |
| 8 private_key => 'issues.adblockplus.org_sslcert.key', | |
| 9 is_default => true, | |
| 10 } | |
| 11 | |
| 12 trac::instance {'issues': | |
| 13 config => 'trac/trac.ini.erb', | |
| 14 description => 'Adblock Plus Issue Tracker', | |
| 15 location => '/', | |
| 16 logo => 'puppet:///modules/trac/adblockplus_logo.png', | |
| 17 database => 'trac', | |
| 18 permissions => "puppet:///modules/trac/permissions.csv", | |
| 19 } | |
| 20 | |
| 21 trac::instance {'orders': | |
| 22 config => 'trac/orders.ini.erb', | |
| 23 description => 'Eyeo Order System', | |
| 24 location => '/orders', | |
| 25 logo => 'puppet:///modules/trac/eyeo_logo.png', | |
| 26 database => 'trac_orders', | |
| 27 permissions => "puppet:///modules/trac/order-permissions.csv", | |
| 28 } | |
| 29 | |
| 30 # Transforming the auth_cookie table of the "new" Trac project into an | |
| 31 # insertable view for the "old" project's table of the same name avoids | |
| 32 # the need to convert the entire auth to htpasswd-file handling, which | |
| 33 # would be the official way to go for achieving a shared authentication. | |
| 34 exec { 'trac_auth_cookie_view': | |
| 35 command => "mysql -utrac -p'${private::trac::database_password}' trac_orders
--execute ' | |
| 36 DROP TABLE IF EXISTS auth_cookie; | |
| 37 CREATE VIEW auth_cookie AS SELECT * FROM trac.auth_cookie;'", | |
| 38 unless => "mysql -utrac -p'${private::trac::database_password}' trac_orders
--execute ' | |
| 39 SHOW CREATE VIEW auth_cookie'", | |
| 40 path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin", | |
| 41 require => [ | |
| 42 Exec["deploy_issues"], | |
| 43 Exec["deploy_orders"], | |
| 44 ], | |
| 45 } | |
| 46 | |
| 47 $mysql = "mysql -utrac -p'${private::trac::database_password}'" | |
| 48 | |
| 49 # Synchronizing e-mail and password information between the project | |
| 50 # allows for logging in from any entry point - whilst maintaining a | |
| 51 # registration form (and process) in one project only. | |
| 52 cron {'trac_session_attribute_sync': | |
| 53 ensure => present, | |
| 54 user => trac, | |
| 55 minute => '*/30', | |
| 56 command => "$mysql trac_orders --execute ' \ | |
| 57 INSERT INTO session_attribute (sid, authenticated, name, value) SELECT sid
, authenticated, name, value \ | |
| 58 FROM trac.session_attribute WHERE authenticated = 1 AND name IN (\"email\"
, \"password\") \ | |
| 59 ON DUPLICATE KEY UPDATE value=VALUES(value) ' >/dev/null | |
| 60 ", | |
| 61 require => Exec['trac_auth_cookie_view'], | |
| 62 } | |
| 63 | |
| 64 cron {'trac_session_cleanup': | |
| 65 command => "$mysql trac --execute ' \ | |
| 66 DELETE session, session_attribute FROM session \ | |
| 67 JOIN session_attribute ON session.sid = session_attribute.sid \ | |
| 68 AND session.authenticated = session_attribute.authenticated \ | |
| 69 WHERE session.authenticated = 0 AND \ | |
| 70 session.last_visit < UNIX_TIMESTAMP(NOW() - INTERVAL 10 DAY)' >/dev/null", | |
| 71 ensure => present, | |
| 72 hour => 1, | |
| 73 minute => 15, | |
| 74 require => Trac::Instance['issues'], | |
| 75 user => trac, | |
| 76 } | |
| 77 | |
| 78 cron {'trac_account_cleanup': | |
| 79 command => "$mysql trac --execute ' \ | |
| 80 DELETE session, session_attribute FROM session \ | |
| 81 JOIN session_attribute AS session_data ON session.sid = session_data.sid \ | |
| 82 AND session.authenticated = session_data.authenticated \ | |
| 83 JOIN session_attribute ON session.sid = session_attribute.sid \ | |
| 84 AND session.authenticated = session_attribute.authenticated \ | |
| 85 WHERE session_data.name = \"email_verification_token\" AND \ | |
| 86 session.last_visit < UNIX_TIMESTAMP(NOW() - INTERVAL 5 DAY)' >/dev/null", | |
| 87 ensure => present, | |
| 88 hour => 2, | |
| 89 minute => 15, | |
| 90 require => Trac::Instance['issues'], | |
| 91 user => trac, | |
| 92 } | |
| 93 | |
| 94 # https://issues.adblockplus.org/ticket/3787 | |
| 95 customservice::supervisor {"spawn-fcgi": | |
| 96 ensure => 'present', | |
| 97 pidfile => "/var/run/500-tracd_issues_spawn-fcgi.pid", | |
| 98 } | |
| 99 } | |
| OLD | NEW |