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