rmails 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/Gemfile +24 -0
  4. data/Gemfile.lock +167 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.markdown +9 -0
  7. data/Rakefile +31 -0
  8. data/Rakefile1 +9 -0
  9. data/Vagrantfile +51 -0
  10. data/app/assets/images/arrow_bottom.gif +0 -0
  11. data/app/assets/images/arrow_right.gif +0 -0
  12. data/app/assets/images/at-sign.png +0 -0
  13. data/app/assets/images/checkerboard.gif +0 -0
  14. data/app/assets/images/glyphicons-halflings-white.png +0 -0
  15. data/app/assets/images/glyphicons-halflings.png +0 -0
  16. data/app/assets/images/icon_draft.gif +0 -0
  17. data/app/assets/images/icon_layout.gif +0 -0
  18. data/app/assets/images/icon_move.gif +0 -0
  19. data/app/assets/images/icon_regular.gif +0 -0
  20. data/app/assets/images/icon_snippet.gif +0 -0
  21. data/app/assets/images/nav_arrow.png +0 -0
  22. data/app/assets/images/x.png +0 -0
  23. data/app/assets/javascripts/application.coffee.erb +27 -0
  24. data/app/assets/javascripts/canjs/can.construct.proxy.js +60 -0
  25. data/app/assets/javascripts/canjs/can.construct.super.js +44 -0
  26. data/app/assets/javascripts/canjs/can.control.plugin.js +245 -0
  27. data/app/assets/javascripts/canjs/can.control.view.js +88 -0
  28. data/app/assets/javascripts/canjs/can.dojo.js +3669 -0
  29. data/app/assets/javascripts/canjs/can.dojo.min.js +66 -0
  30. data/app/assets/javascripts/canjs/can.fixture.js +1020 -0
  31. data/app/assets/javascripts/canjs/can.jquery.js +2995 -0
  32. data/app/assets/javascripts/canjs/can.jquery.min.js +52 -0
  33. data/app/assets/javascripts/canjs/can.mootools.js +3462 -0
  34. data/app/assets/javascripts/canjs/can.mootools.min.js +63 -0
  35. data/app/assets/javascripts/canjs/can.observe.attributes.js +293 -0
  36. data/app/assets/javascripts/canjs/can.observe.backup.js +368 -0
  37. data/app/assets/javascripts/canjs/can.observe.delegate.js +359 -0
  38. data/app/assets/javascripts/canjs/can.observe.setter.js +58 -0
  39. data/app/assets/javascripts/canjs/can.observe.validations.js +374 -0
  40. data/app/assets/javascripts/canjs/can.view.modifiers.js +292 -0
  41. data/app/assets/javascripts/canjs/can.yui.js +3530 -0
  42. data/app/assets/javascripts/canjs/can.yui.min.js +65 -0
  43. data/app/assets/javascripts/canjs/can.zepto.js +3426 -0
  44. data/app/assets/javascripts/canjs/can.zepto.min.js +62 -0
  45. data/app/assets/javascripts/controls/admins.coffee.erb +105 -0
  46. data/app/assets/javascripts/controls/aliases.coffee.erb +91 -0
  47. data/app/assets/javascripts/controls/domains.coffee.erb +115 -0
  48. data/app/assets/javascripts/controls/settings.coffee.erb +47 -0
  49. data/app/assets/javascripts/controls/users.coffee.erb +94 -0
  50. data/app/assets/javascripts/lib/facebox.js +311 -0
  51. data/app/assets/javascripts/lib/html5.js +2 -0
  52. data/app/assets/javascripts/lib/jquery.js +9301 -0
  53. data/app/assets/javascripts/lib/jquery_formparams.js +108 -0
  54. data/app/assets/javascripts/lib/jquery_input_hint.js +20 -0
  55. data/app/assets/javascripts/lib/jquery_paginate.js +120 -0
  56. data/app/assets/javascripts/lib/jquery_ui_custom.js +6 -0
  57. data/app/assets/javascripts/lib/json2.js +487 -0
  58. data/app/assets/javascripts/lib/utils.coffee.erb +48 -0
  59. data/app/assets/javascripts/models/admin.coffee.erb +42 -0
  60. data/app/assets/javascripts/models/alias.coffee.erb +28 -0
  61. data/app/assets/javascripts/models/domain.coffee.erb +39 -0
  62. data/app/assets/javascripts/models/property.coffee.erb +18 -0
  63. data/app/assets/javascripts/models/user.coffee.erb +29 -0
  64. data/app/assets/stylesheets/application.sass +156 -0
  65. data/app/assets/stylesheets/base.css.sass +243 -0
  66. data/app/assets/stylesheets/facebox.css +80 -0
  67. data/app/assets/stylesheets/lib/bootstrap.css +9 -0
  68. data/app/assets/stylesheets/twitter/bootstrap-responsive.scss +1 -0
  69. data/app/assets/stylesheets/twitter/bootstrap.scss +63 -0
  70. data/app/assets/stylesheets/twitter/bootstrap/_accordion.scss +34 -0
  71. data/app/assets/stylesheets/twitter/bootstrap/_alerts.scss +79 -0
  72. data/app/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +24 -0
  73. data/app/assets/stylesheets/twitter/bootstrap/_button-groups.scss +229 -0
  74. data/app/assets/stylesheets/twitter/bootstrap/_buttons.scss +228 -0
  75. data/app/assets/stylesheets/twitter/bootstrap/_carousel.scss +158 -0
  76. data/app/assets/stylesheets/twitter/bootstrap/_close.scss +32 -0
  77. data/app/assets/stylesheets/twitter/bootstrap/_code.scss +61 -0
  78. data/app/assets/stylesheets/twitter/bootstrap/_component-animations.scss +22 -0
  79. data/app/assets/stylesheets/twitter/bootstrap/_dropdowns.scss +237 -0
  80. data/app/assets/stylesheets/twitter/bootstrap/_forms.scss +689 -0
  81. data/app/assets/stylesheets/twitter/bootstrap/_grid.scss +21 -0
  82. data/app/assets/stylesheets/twitter/bootstrap/_hero-unit.scss +25 -0
  83. data/app/assets/stylesheets/twitter/bootstrap/_labels-badges.scss +83 -0
  84. data/app/assets/stylesheets/twitter/bootstrap/_layouts.scss +16 -0
  85. data/app/assets/stylesheets/twitter/bootstrap/_media.scss +55 -0
  86. data/app/assets/stylesheets/twitter/bootstrap/_mixins.scss +690 -0
  87. data/app/assets/stylesheets/twitter/bootstrap/_modals.scss +95 -0
  88. data/app/assets/stylesheets/twitter/bootstrap/_navbar.scss +497 -0
  89. data/app/assets/stylesheets/twitter/bootstrap/_navs.scss +409 -0
  90. data/app/assets/stylesheets/twitter/bootstrap/_pager.scss +43 -0
  91. data/app/assets/stylesheets/twitter/bootstrap/_pagination.scss +123 -0
  92. data/app/assets/stylesheets/twitter/bootstrap/_popovers.scss +133 -0
  93. data/app/assets/stylesheets/twitter/bootstrap/_progress-bars.scss +122 -0
  94. data/app/assets/stylesheets/twitter/bootstrap/_reset.scss +216 -0
  95. data/app/assets/stylesheets/twitter/bootstrap/_responsive-1200px-min.scss +28 -0
  96. data/app/assets/stylesheets/twitter/bootstrap/_responsive-767px-max.scss +193 -0
  97. data/app/assets/stylesheets/twitter/bootstrap/_responsive-768px-979px.scss +19 -0
  98. data/app/assets/stylesheets/twitter/bootstrap/_responsive-navbar.scss +189 -0
  99. data/app/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +74 -0
  100. data/app/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +53 -0
  101. data/app/assets/stylesheets/twitter/bootstrap/_sprites.scss +197 -0
  102. data/app/assets/stylesheets/twitter/bootstrap/_tables.scss +235 -0
  103. data/app/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +53 -0
  104. data/app/assets/stylesheets/twitter/bootstrap/_tooltip.scss +70 -0
  105. data/app/assets/stylesheets/twitter/bootstrap/_type.scss +247 -0
  106. data/app/assets/stylesheets/twitter/bootstrap/_utilities.scss +45 -0
  107. data/app/assets/stylesheets/twitter/bootstrap/_variables.scss +301 -0
  108. data/app/assets/stylesheets/twitter/bootstrap/_wells.scss +29 -0
  109. data/app/assets/stylesheets/twitter/bootstrap/responsive.scss +48 -0
  110. data/app/controllers/admin_users_controller.rb +62 -0
  111. data/app/controllers/aliases_controller.rb +35 -0
  112. data/app/controllers/application_controller.rb +20 -0
  113. data/app/controllers/domains_controller.rb +48 -0
  114. data/app/controllers/server_controller.rb +28 -0
  115. data/app/controllers/users_controller.rb +35 -0
  116. data/app/helpers/admin_users_helper.rb +11 -0
  117. data/app/helpers/application_helper.rb +2 -0
  118. data/app/helpers/domains_helper.rb +25 -0
  119. data/app/helpers/server_helper.rb +30 -0
  120. data/app/mailers/.gitkeep +0 -0
  121. data/app/models/.gitkeep +0 -0
  122. data/app/models/admin_user.rb +54 -0
  123. data/app/models/certificate_manager.rb +46 -0
  124. data/app/models/property.rb +103 -0
  125. data/app/models/property/awstats.rb +15 -0
  126. data/app/models/property/dovecot.rb +61 -0
  127. data/app/models/property/dspam.rb +45 -0
  128. data/app/models/property/nginx.rb +47 -0
  129. data/app/models/property/postfix.rb +64 -0
  130. data/app/models/property_value_validator.rb +41 -0
  131. data/app/models/system_manager.rb +88 -0
  132. data/app/models/virtual_alias.rb +13 -0
  133. data/app/models/virtual_domain.rb +15 -0
  134. data/app/models/virtual_user.rb +51 -0
  135. data/app/views/admin_users/_form.html.haml +21 -0
  136. data/app/views/admin_users/first.html.haml +12 -0
  137. data/app/views/admin_users/index.html.haml +61 -0
  138. data/app/views/aliases/_form.html.haml +11 -0
  139. data/app/views/aliases/_list.html.haml +0 -0
  140. data/app/views/devise/confirmations/new.html.haml +9 -0
  141. data/app/views/devise/mailer/confirmation_instructions.html.haml +4 -0
  142. data/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
  143. data/app/views/devise/mailer/unlock_instructions.html.haml +5 -0
  144. data/app/views/devise/passwords/edit.html.haml +14 -0
  145. data/app/views/devise/passwords/new.html.haml +12 -0
  146. data/app/views/devise/registrations/edit.html.haml +18 -0
  147. data/app/views/devise/registrations/new.html.haml +10 -0
  148. data/app/views/devise/sessions/new.html.haml +16 -0
  149. data/app/views/devise/shared/_links.haml +17 -0
  150. data/app/views/devise/unlocks/new.html.haml +11 -0
  151. data/app/views/domains/_fields.html.haml +0 -0
  152. data/app/views/domains/_form.html.haml +7 -0
  153. data/app/views/domains/index.html.haml +133 -0
  154. data/app/views/domains/show.html.haml +1 -0
  155. data/app/views/layouts/_nav.html.haml +3 -0
  156. data/app/views/layouts/application.html.haml +29 -0
  157. data/app/views/server/_certificates.html.haml +10 -0
  158. data/app/views/server/_dovecot.html.haml +27 -0
  159. data/app/views/server/_dspam.html.haml +9 -0
  160. data/app/views/server/_postfix_info.html.haml +5 -0
  161. data/app/views/server/_postfix_test.html.haml +5 -0
  162. data/app/views/server/_status.html.haml +11 -0
  163. data/app/views/server/index.html.haml +36 -0
  164. data/app/views/users/_form.html.haml +11 -0
  165. data/app/views/users/_list.html.haml +0 -0
  166. data/bin/rmails +43 -0
  167. data/config.ru +4 -0
  168. data/config/application.rb +62 -0
  169. data/config/boot.rb +6 -0
  170. data/config/environment.rb +5 -0
  171. data/config/environments/development.rb +37 -0
  172. data/config/environments/production.rb +67 -0
  173. data/config/environments/test.rb +37 -0
  174. data/config/initializers/backtrace_silencers.rb +7 -0
  175. data/config/initializers/devise.rb +240 -0
  176. data/config/initializers/devise_encryptable.rb +37 -0
  177. data/config/initializers/devise_models.rb +86 -0
  178. data/config/initializers/inflections.rb +15 -0
  179. data/config/initializers/mime_types.rb +5 -0
  180. data/config/initializers/secret_token.rb +7 -0
  181. data/config/initializers/session_store.rb +8 -0
  182. data/config/initializers/simple_form.rb +142 -0
  183. data/config/initializers/simple_form_bootstrap.rb +45 -0
  184. data/config/initializers/wrap_parameters.rb +14 -0
  185. data/config/locales/cz.yml +45 -0
  186. data/config/locales/devise.cz.yml +47 -0
  187. data/config/locales/devise.en.yml +60 -0
  188. data/config/locales/en.yml +5 -0
  189. data/config/locales/server/cz.yml +14 -0
  190. data/config/locales/server/en.yml +7 -0
  191. data/config/locales/server/help/dovecot/cz.yml +21 -0
  192. data/config/locales/server/help/dovecot/en.yml +18 -0
  193. data/config/locales/server/help/dspam/cz.yml +10 -0
  194. data/config/locales/server/help/dspam/en.yml +4 -0
  195. data/config/locales/server/key/dovecot/cz.yml +23 -0
  196. data/config/locales/server/key/dovecot/en.yml +20 -0
  197. data/config/locales/server/key/dspam/cz.yml +10 -0
  198. data/config/locales/server/key/dspam/en.yml +4 -0
  199. data/config/locales/simple_form.en.yml +26 -0
  200. data/config/locales/views/admin_users/cz.yml +25 -0
  201. data/config/locales/views/admin_users/en.yml +5 -0
  202. data/config/locales/views/aliases/cz.yml +17 -0
  203. data/config/locales/views/aliases/en.yml +1 -0
  204. data/config/locales/views/devise/cz.yml +26 -0
  205. data/config/locales/views/devise/en.yml +13 -0
  206. data/config/locales/views/domains/cz.yml +15 -0
  207. data/config/locales/views/domains/en.yml +15 -0
  208. data/config/locales/views/server/cz.yml +19 -0
  209. data/config/locales/views/server/en.yml +3 -0
  210. data/config/locales/views/users/cz.yml +18 -0
  211. data/config/locales/views/users/en.yml +1 -0
  212. data/config/routes.rb +80 -0
  213. data/db/migrate/20121112201233_virtual_domain.rb +11 -0
  214. data/db/migrate/20121112201247_virtual_alias.rb +10 -0
  215. data/db/migrate/20121112201341_virtual_user.rb +34 -0
  216. data/db/migrate/20121112201359_create_admin_user.rb +30 -0
  217. data/db/migrate/20121112201411_server_configuration.rb +13 -0
  218. data/db/migrate/20130304083938_join_domains_users.rb +12 -0
  219. data/db/migrate/20130311214040_create_versions.rb +18 -0
  220. data/db/seeds.rb +45 -0
  221. data/lib/devise-encryptable.rb +1 -0
  222. data/lib/rmails.rb +5 -0
  223. data/lib/rmails/installer.rb +37 -0
  224. data/lib/rmails/version.rb +3 -0
  225. data/lib/tasks/.gitkeep +0 -0
  226. data/lib/templates/haml/scaffold/_form.html.haml +10 -0
  227. data/locals +0 -0
  228. data/log/.gitkeep +0 -0
  229. data/public/404.html +26 -0
  230. data/public/422.html +26 -0
  231. data/public/500.html +25 -0
  232. data/public/favicon.ico +0 -0
  233. data/public/fonts/London.eot +0 -0
  234. data/public/fonts/London.otf +0 -0
  235. data/public/fonts/London.woff +0 -0
  236. data/public/fonts/LondonBold.otf +0 -0
  237. data/public/robots.txt +5 -0
  238. data/rmails.gemspec +35 -0
  239. data/script/prepflog.pl +576 -0
  240. data/script/rails +6 -0
  241. data/system/config/automateit_env.rb +16 -0
  242. data/system/config/fields.yml +48 -0
  243. data/system/config/tags.yml +39 -0
  244. data/system/dist/README_AutomateIt_dist.txt +20 -0
  245. data/system/dist/amavis/spamassassin.cf.erb +85 -0
  246. data/system/dist/amavis/user.erb +33 -0
  247. data/system/dist/awstats/awstats.mail.conf.erb +41 -0
  248. data/system/dist/awstats/prepflog.pl +576 -0
  249. data/system/dist/dovecot/dovecot-sql.conf.ext.erb +14 -0
  250. data/system/dist/dovecot/dovecot.conf.erb +297 -0
  251. data/system/dist/dovecot/old_dovecot.conf.erb +63 -0
  252. data/system/dist/dspam/conf.erb +96 -0
  253. data/system/dist/dspam/pgsql.conf +33 -0
  254. data/system/dist/nginx/awstats.erb +17 -0
  255. data/system/dist/nginx/rmails.erb +40 -0
  256. data/system/dist/postfix/email2email.cf.erb +5 -0
  257. data/system/dist/postfix/main.cf.erb +118 -0
  258. data/system/dist/postfix/master.cf.erb +74 -0
  259. data/system/dist/postfix/sasl.conf.erb +3 -0
  260. data/system/dist/postfix/sender_login_maps.cf.erb +5 -0
  261. data/system/dist/postfix/virtual_alias_maps.cf.erb +5 -0
  262. data/system/dist/postfix/virtual_mailbox_domains.cf.erb +5 -0
  263. data/system/dist/postfix/virtual_mailbox_maps.cf.erb +5 -0
  264. data/system/dist/postgresql/postgresql.conf.erb +54 -0
  265. data/system/dist/rmails/Gemfile.1 +8 -0
  266. data/system/dist/rmails/Gemfile.2 +24 -0
  267. data/system/dist/rmails/database.yml.erb +15 -0
  268. data/system/dist/sudoers +37 -0
  269. data/system/lib/README_AutomateIt_lib.txt +22 -0
  270. data/system/lib/dkim_key.rb +9 -0
  271. data/system/lib/smtpd_key.rb +39 -0
  272. data/system/lib/ssl.rb +23 -0
  273. data/system/recipes/01_prepare_server.rb +84 -0
  274. data/system/recipes/02_setup_database.rb +65 -0
  275. data/system/recipes/03_setup_postfix.rb +124 -0
  276. data/system/recipes/04_setup_dovecot.rb +78 -0
  277. data/system/recipes/05_setup_nginx.rb +29 -0
  278. data/system/recipes/06_setup_dspam.rb +24 -0
  279. data/system/recipes/07_setup_amavis.rb +16 -0
  280. data/system/recipes/08_setup_spamassassin.rb +22 -0
  281. data/system/recipes/09_setup_awstats.rb +49 -0
  282. data/system/recipes/XX_start_services.rb +5 -0
  283. data/test/fixtures/.gitkeep +0 -0
  284. data/test/functional/.gitkeep +0 -0
  285. data/test/functional/aliases_controller_test.rb +7 -0
  286. data/test/functional/domains_controller_test.rb +7 -0
  287. data/test/functional/users_controller_test.rb +7 -0
  288. data/test/integration/.gitkeep +0 -0
  289. data/test/performance/browsing_test.rb +12 -0
  290. data/test/test_helper.rb +13 -0
  291. data/test/unit/.gitkeep +0 -0
  292. data/test/unit/helpers/aliases_helper_test.rb +4 -0
  293. data/test/unit/helpers/domains_helper_test.rb +4 -0
  294. data/test/unit/helpers/users_helper_test.rb +4 -0
  295. data/vendor/assets/javascripts/.gitkeep +0 -0
  296. data/vendor/assets/javascripts/canjs/can.construct.proxy.js +60 -0
  297. data/vendor/assets/javascripts/canjs/can.construct.super.js +44 -0
  298. data/vendor/assets/javascripts/canjs/can.control.plugin.js +245 -0
  299. data/vendor/assets/javascripts/canjs/can.control.view.js +88 -0
  300. data/vendor/assets/javascripts/canjs/can.dojo.js +3669 -0
  301. data/vendor/assets/javascripts/canjs/can.dojo.min.js +66 -0
  302. data/vendor/assets/javascripts/canjs/can.fixture.js +1020 -0
  303. data/vendor/assets/javascripts/canjs/can.jquery.js +2995 -0
  304. data/vendor/assets/javascripts/canjs/can.jquery.min.js +52 -0
  305. data/vendor/assets/javascripts/canjs/can.mootools.js +3462 -0
  306. data/vendor/assets/javascripts/canjs/can.mootools.min.js +63 -0
  307. data/vendor/assets/javascripts/canjs/can.observe.attributes.js +293 -0
  308. data/vendor/assets/javascripts/canjs/can.observe.backup.js +368 -0
  309. data/vendor/assets/javascripts/canjs/can.observe.delegate.js +359 -0
  310. data/vendor/assets/javascripts/canjs/can.observe.setter.js +58 -0
  311. data/vendor/assets/javascripts/canjs/can.observe.validations.js +374 -0
  312. data/vendor/assets/javascripts/canjs/can.view.modifiers.js +292 -0
  313. data/vendor/assets/javascripts/canjs/can.yui.js +3530 -0
  314. data/vendor/assets/javascripts/canjs/can.yui.min.js +65 -0
  315. data/vendor/assets/javascripts/canjs/can.zepto.js +3426 -0
  316. data/vendor/assets/javascripts/canjs/can.zepto.min.js +62 -0
  317. data/vendor/assets/javascripts/twitter/bootstrap-affix.js +104 -0
  318. data/vendor/assets/javascripts/twitter/bootstrap-alert.js +90 -0
  319. data/vendor/assets/javascripts/twitter/bootstrap-button.js +96 -0
  320. data/vendor/assets/javascripts/twitter/bootstrap-carousel.js +176 -0
  321. data/vendor/assets/javascripts/twitter/bootstrap-collapse.js +158 -0
  322. data/vendor/assets/javascripts/twitter/bootstrap-dropdown.js +150 -0
  323. data/vendor/assets/javascripts/twitter/bootstrap-modal.js +239 -0
  324. data/vendor/assets/javascripts/twitter/bootstrap-popover.js +103 -0
  325. data/vendor/assets/javascripts/twitter/bootstrap-scrollspy.js +151 -0
  326. data/vendor/assets/javascripts/twitter/bootstrap-tab.js +135 -0
  327. data/vendor/assets/javascripts/twitter/bootstrap-tooltip.js +275 -0
  328. data/vendor/assets/javascripts/twitter/bootstrap-transition.js +60 -0
  329. data/vendor/assets/javascripts/twitter/bootstrap-typeahead.js +300 -0
  330. data/vendor/assets/javascripts/twitter/my/bootstrap-typeahead.js +311 -0
  331. data/vendor/assets/stylesheets/.gitkeep +0 -0
  332. metadata +470 -0
@@ -0,0 +1,29 @@
1
+
2
+ etc_nginx = '/etc/nginx'
3
+
4
+ if tagged?('debian|ubuntu')
5
+ sites_available = 'sites-available'
6
+ sites_enabled = 'sites-enabled'
7
+ end
8
+
9
+
10
+ site_path = "#{etc_nginx}/#{sites_available}/rmails"
11
+ locals = {
12
+ :hostnames => lookup('hostname')
13
+ }
14
+ render(
15
+ :file => "#{dist}nginx/rmails.erb",
16
+ :to => site_path,
17
+ :mode => 0664,
18
+ :locals => locals
19
+ )
20
+ shell_manager.chown('root', 'rmails', site_path)
21
+ # make path for access.log
22
+ shell_manager.mkdir_p "/var/log/nginx/#{lookup('hostname')}"
23
+
24
+
25
+ unless File.symlink? "#{etc_nginx}/#{sites_enabled}/0_rmails"
26
+ shell_manager.ln_s "#{etc_nginx}/#{sites_available}/rmails",
27
+ "#{etc_nginx}/#{sites_enabled}/0_rmails"
28
+ end
29
+
@@ -0,0 +1,24 @@
1
+
2
+ etc_dspam = '/etc/dspam'
3
+
4
+
5
+ locals = {
6
+ :database_port => lookup('database#port'),
7
+ :database_user => lookup('dspam#database#user'),
8
+ :database_pass => lookup('dspam#database#password'),
9
+ :database => lookup('dspam#database#name'),
10
+ :hostname => lookup('postfix#myhostname')
11
+ }
12
+ render(
13
+ :file => "#{dist}dspam/conf.erb",
14
+ :to => "#{etc_dspam}/dspam.conf",
15
+ :mode => 0660,
16
+ :locals => locals
17
+ )
18
+ shell_manager.chown('root', 'rmails', "#{etc_dspam}/dspam.conf")
19
+
20
+
21
+ shell_manager.chown_R('dspam', 'www', "/var/spool/dspam")
22
+ #shell_manager.chmod_R('4555', "/var/spool/dspam")
23
+
24
+
@@ -0,0 +1,16 @@
1
+
2
+ etc_amavis = '/etc/amavis'
3
+
4
+ locals = {
5
+ :mydomain => lookup('postfix#mydomain')
6
+ }
7
+ render(
8
+ :file => "#{dist}amavis/user.erb",
9
+ :to => "#{etc_amavis}/conf.d/50-user",
10
+ :mode => 0660,
11
+ :owner => 'root',
12
+ :group => 'rmails',
13
+ :locals => locals
14
+ )
15
+
16
+
@@ -0,0 +1,22 @@
1
+
2
+ etc_sa = '/etc/spamassassin'
3
+
4
+
5
+
6
+ locals = {
7
+ :hostname => lookup('postfix#myhostname')
8
+ }
9
+ render(
10
+ :file => "#{dist}amavis/spamassassin.cf.erb",
11
+ :to => "#{etc_sa}/local.cf",
12
+ :mode => 0660,
13
+ :owner => 'root',
14
+ :group => 'rmails',
15
+ :locals => locals
16
+ )
17
+
18
+ if tagged?('ubuntu')
19
+ edit "/etc/default/spamassassin" do
20
+ replace /^ENABLED\s*=\s*0\s*$/, 'ENABLED=1'
21
+ end
22
+ end
@@ -0,0 +1,49 @@
1
+ etc_awstats = '/etc/awstats'
2
+ log_awstats = '/var/log/mail.log'
3
+ awstats_tools = '/usr/share/awstats/tools'
4
+ awstats_out = '/var/lib/awstats/outputs'
5
+ bin = '/usr/bin'
6
+
7
+ render(
8
+ :file => "#{dist}awstats/prepflog.pl",
9
+ :to => "#{bin}/prepflog.pl",
10
+ :mode => 400,
11
+ :owner => 'root',
12
+ :group => 'rmails'
13
+ )
14
+ unless File.symlink?("#{bin}/maillogconvert.pl")
15
+ shell_manager.ln_s "#{awstats_tools}/maillogconvert.pl", "#{bin}/maillogconvert.pl"
16
+ end
17
+ unless File.symlink?("#{bin}/awstats_buildstaticpages.pl")
18
+ shell_manager.ln_s "#{awstats_tools}/awstats_buildstaticpages.pl", "#{bin}/awstats_buildstaticpages.pl"
19
+ end
20
+
21
+ locals = {
22
+ :logfile => log_awstats,
23
+ :domain => lookup('hostname'),
24
+ :outputs => awstats_out
25
+
26
+ }
27
+ render(
28
+ :file => "#{dist}awstats/awstats.mail.conf.erb",
29
+ :to => "#{etc_awstats}/awstats.mail.conf",
30
+ :locals => locals,
31
+ :mode => 400,
32
+ :owner => 'root',
33
+ :group => 'rmails'
34
+ )
35
+
36
+
37
+
38
+
39
+ #shell_manager.chmod '400', "#{etc_awstats}/*.conf"
40
+
41
+ #sudo /usr/local/awstats/tools/awstats_buildstaticpages.pl -update -config=www.example.com -dir=/home/demo/public_html/example.com/public/webstats -awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl
42
+
43
+ #shell_manager.sh "(crontab -l; echo '00 1 * * * /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -update -config=mail') | crontab -"
44
+
45
+ #shell_manager.sh "(crontab -l; echo '00 1 * * * /usr/bin/perl #{bin}/awstats_buildstaticpages.pl -update -config=mail' -dir=/var/www/mailstats -awstatsprog=/usr/lib/cgi-bin/awstats.pl) | crontab -"
46
+
47
+
48
+ shell_manager.sh "(echo '00 1 * * * /usr/bin/perl #{bin}/awstats_buildstaticpages.pl -update -config=mail -dir=/var/www/mailstats -awstatsprog=/usr/lib/cgi-bin/awstats.pl
49
+ 00 1 * * * /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -update -config=mail') | crontab -"
@@ -0,0 +1,5 @@
1
+ service_manager.start("nginx")
2
+ service_manager.start("postfix")
3
+ service_manager.start("postgresql-8.4")
4
+ service_manager.start("dovecot")
5
+
File without changes
File without changes
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class AliasesControllerTest < ActionController::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class DomainsControllerTest < ActionController::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class UsersControllerTest < ActionController::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
File without changes
@@ -0,0 +1,12 @@
1
+ require 'test_helper'
2
+ require 'rails/performance_test_help'
3
+
4
+ class BrowsingTest < ActionDispatch::PerformanceTest
5
+ # Refer to the documentation for all available options
6
+ # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
7
+ # :output => 'tmp/performance', :formats => [:flat] }
8
+
9
+ def test_homepage
10
+ get '/'
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
7
+ #
8
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
9
+ # -- they do not yet inherit this setting
10
+ fixtures :all
11
+
12
+ # Add more helper methods to be used by all tests here...
13
+ end
File without changes
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class AliasesHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class DomainsHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class UsersHelperTest < ActionView::TestCase
4
+ end
File without changes
@@ -0,0 +1,60 @@
1
+ (function(can, window, undefined){
2
+ var isFunction = can.isFunction,
3
+ isArray = can.isArray,
4
+ makeArray = can.makeArray,
5
+
6
+ proxy = function( funcs ) {
7
+
8
+ //args that should be curried
9
+ var args = makeArray(arguments),
10
+ self;
11
+
12
+ // get the functions to callback
13
+ funcs = args.shift();
14
+
15
+ // if there is only one function, make funcs into an array
16
+ if (!isArray(funcs) ) {
17
+ funcs = [funcs];
18
+ }
19
+
20
+ // keep a reference to us in self
21
+ self = this;
22
+
23
+
24
+ return function class_cb() {
25
+ // add the arguments after the curried args
26
+ var cur = args.concat(makeArray(arguments)),
27
+ isString,
28
+ length = funcs.length,
29
+ f = 0,
30
+ func;
31
+
32
+ // go through each function to call back
33
+ for (; f < length; f++ ) {
34
+ func = funcs[f];
35
+ if (!func ) {
36
+ continue;
37
+ }
38
+
39
+ // set called with the name of the function on self (this is how this.view works)
40
+ isString = typeof func == "string";
41
+
42
+ // call the function
43
+ cur = (isString ? self[func] : func).apply(self, cur || []);
44
+
45
+ // pass the result to the next function (if there is a next function)
46
+ if ( f < length - 1 ) {
47
+ cur = !isArray(cur) || cur._use_call ? [cur] : cur
48
+ }
49
+ }
50
+ return cur;
51
+ }
52
+ }
53
+ can.Construct.proxy = can.Construct.prototype.proxy = proxy;
54
+
55
+
56
+
57
+
58
+
59
+
60
+ })(this.can, this )
@@ -0,0 +1,44 @@
1
+ (function(can, window, undefined){
2
+
3
+ // tests if we can get super in .toString()
4
+ var isFunction = can.isFunction,
5
+
6
+ fnTest = /xyz/.test(function() {
7
+ xyz;
8
+ }) ? /\b_super\b/ : /.*/;
9
+
10
+ // overwrites a single property so it can still call super
11
+ can.Construct._overwrite = function(addTo, base, name, val){
12
+ // Check if we're overwriting an existing function
13
+ addTo[name] = isFunction(val) &&
14
+ isFunction(base[name]) &&
15
+ fnTest.test(val) ? (function( name, fn ) {
16
+ return function() {
17
+ var tmp = this._super,
18
+ ret;
19
+
20
+ // Add a new ._super() method that is the same method
21
+ // but on the super-class
22
+ this._super = base[name];
23
+
24
+ // The method only need to be bound temporarily, so we
25
+ // remove it when we're done executing
26
+ ret = fn.apply(this, arguments);
27
+ this._super = tmp;
28
+ return ret;
29
+ };
30
+ })(name, val) : val;
31
+ }
32
+ // overwrites an object with methods, sets up _super
33
+ // newProps - new properties
34
+ // oldProps - where the old properties might be
35
+ // addTo - what we are adding to
36
+ can.Construct._inherit = function( newProps, oldProps, addTo ) {
37
+ addTo = addTo || newProps
38
+ for ( var name in newProps ) {
39
+ can.Construct._overwrite(addTo, oldProps, name, newProps[name]);
40
+ }
41
+ }
42
+
43
+
44
+ })(this.can, this )
@@ -0,0 +1,245 @@
1
+ (function(can, window, undefined){
2
+
3
+
4
+
5
+ //used to determine if a control instance is one of controllers
6
+ //controllers can be strings or classes
7
+ var i,
8
+ isAControllerOf = function( instance, controllers ) {
9
+ for ( i = 0; i < controllers.length; i++ ) {
10
+ if ( typeof controllers[i] == 'string' ? instance.constructor._shortName == controllers[i] : instance instanceof controllers[i] ) {
11
+ return true;
12
+ }
13
+ }
14
+ return false;
15
+ },
16
+ data = function(el, data){
17
+ return $el.data('controls');
18
+ },
19
+ makeArray = can.makeArray,
20
+ old = can.Control.setup;
21
+
22
+ /*
23
+ * static
24
+ */
25
+ can.Control.setup = function() {
26
+ // if you didn't provide a name, or are control, don't do anything
27
+ if ( this !== can.Control ) {
28
+
29
+ /**
30
+ * @attribute can.Control.plugin.static.pluginName
31
+ * @parent can.Control.plugin
32
+ *
33
+ * Setting the static `pluginName` property allows you to override the default name
34
+ * with your own.
35
+ *
36
+ * var Filler = can.Control({
37
+ * pluginName: 'fillWith'
38
+ * },{});
39
+ *
40
+ * $("#foo").fillWith();
41
+ *
42
+ * If you don't provide a `pluginName`, the control falls back to the
43
+ * [can.Construct.fullName fullName] attribute:
44
+ *
45
+ * can.Control('Ui.Layout.FillWith', {}, {});
46
+ * $("#foo").ui_layout_fill_with();
47
+ *
48
+ */
49
+ var pluginName = this.pluginName || this._fullName;
50
+
51
+ // create jQuery plugin
52
+ if(pluginName !== 'can_control'){
53
+ this.plugin(pluginName);
54
+ }
55
+
56
+ old.apply(this, arguments);
57
+ }
58
+ };
59
+
60
+ /*
61
+ * prototype
62
+ */
63
+ $.fn.extend({
64
+
65
+ /**
66
+ * @function jQuery.fn.controls
67
+ * @parent can.Control.plugin
68
+ *
69
+ * When the widget is initialized, the plugin control creates an array
70
+ * of control instance(s) with the DOM element it was initialized on using
71
+ * [can.data] method.
72
+ *
73
+ * The `controls` method allows you to get the control instance(s) for any element.
74
+ *
75
+ * //- Inits the widgets
76
+ * $('.widgets:eq(0)').my_box();
77
+ * $('.widgets:eq(1)').my_clock();
78
+ *
79
+ * <div class="widgets my_box" />
80
+ * <div class="widgets my_clock" />
81
+ *
82
+ * $('.widgets').controls() //-> [ MyBox, MyClock ]
83
+ *
84
+ * Additionally, you can invoke it passing the name of a control
85
+ * to fetch a specific instance(s).
86
+ *
87
+ * //- Inits the widgets
88
+ * $('.widgets:eq(0)').my_box();
89
+ * $('.widgets:eq(1)').my_clock();
90
+ *
91
+ * <div class="widgets my_box" />
92
+ * <div class="widgets my_clock" />
93
+ *
94
+ * $('.widgets').controls('MyBox') //-> [ MyBox ]
95
+ *
96
+ * @param {Object} control (optional) if exists the control instance(s) with that constructor function or type will be returned.
97
+ * @return {Array} an array of control instance(s).
98
+ */
99
+ controls: function() {
100
+ var controllerNames = makeArray(arguments),
101
+ instances = [],
102
+ controls, c, cname;
103
+ //check if arguments
104
+ this.each(function() {
105
+
106
+ controls = can.$(this).data("controls");
107
+ if(!controls){
108
+ return;
109
+ }
110
+ for(var i=0; i<controls.length; i++){
111
+ c = controls[i];
112
+ if (!controllerNames.length || isAControllerOf(c, controllerNames) ) {
113
+ instances.push(c);
114
+ }
115
+ }
116
+ });
117
+ return instances;
118
+ },
119
+
120
+ /**
121
+ * @function jQuery.fn.control
122
+ * @parent can.Control.plugin
123
+ *
124
+ * The `control` does the same as [jQuery.fn.controls controls] execept it only
125
+ * returns the first instance found.
126
+ *
127
+ * //- Init MyBox widget
128
+ * $('.widgets').my_box();
129
+ *
130
+ * <div class="widgets my_box" />
131
+ *
132
+ * $('.widgets').controls() //-> MyBox
133
+ *
134
+ * @param {Object} control (optional) if exists the first control instance with that constructor function or type will be returned.
135
+ * @return {can.Control} the first control.
136
+ */
137
+ control: function( control ) {
138
+ return this.controls.apply(this, arguments)[0];
139
+ }
140
+ });
141
+
142
+ can.Control.plugin = function(pluginname){
143
+ var control = this;
144
+
145
+ if (!$.fn[pluginname]) {
146
+ $.fn[pluginname] = function(options){
147
+
148
+ var args = makeArray(arguments), //if the arg is a method on this control
149
+ isMethod = typeof options == "string" && $.isFunction(control.prototype[options]), meth = args[0];
150
+ return this.each(function(){
151
+ //check if created
152
+ var plugin = can.$(this).control(control);
153
+
154
+ if (plugin) {
155
+ if (isMethod) {
156
+ // call a method on the control with the remaining args
157
+ plugin[meth].apply(plugin, args.slice(1));
158
+ }
159
+ else {
160
+ // call the plugin's update method
161
+ plugin.update.apply(plugin, args);
162
+ }
163
+ }
164
+ else {
165
+ //create a new control instance
166
+ control.newInstance.apply(control, [this].concat(args));
167
+ }
168
+ });
169
+ };
170
+ }
171
+ }
172
+
173
+ /**
174
+ * @function can.Control.prototype.update
175
+ * @parent can.Control.plugin
176
+ *
177
+ * Update extends [can.Control.prototype.options options]
178
+ * with the `options` argument and rebinds all events. It
179
+ * re-configures the control.
180
+ *
181
+ * For example, the following control wraps a recipe form. When the form
182
+ * is submitted, it creates the recipe on the server. When the recipe
183
+ * is `created`, it resets the form with a new instance.
184
+ *
185
+ * var Creator = can.Control({
186
+ * "{recipe} created" : function(){
187
+ * this.update({recipe : new Recipe()});
188
+ * this.element[0].reset();
189
+ * this.element.find("[type=submit]").val("Create Recipe")
190
+ * },
191
+ * "submit" : function(el, ev){
192
+ * ev.preventDefault();
193
+ * var recipe = this.options.recipe;
194
+ * recipe.attrs( this.element.formParams() );
195
+ * this.element.find("[type=submit]").val("Saving...")
196
+ * recipe.save();
197
+ * }
198
+ * });
199
+ *
200
+ * $('#createRecipes').creator({ recipe : new Recipe() })
201
+ *
202
+ * *Update* is called if a control's plugin helper is called with the plugin options on an element
203
+ * that already has a control instance of the same type. If you want to implement your
204
+ * own update method make sure to call the old one either using the [can.Construct.super super] plugin or
205
+ * by calling `can.Control.prototype.update.apply(this, arguments);`.
206
+ * For example, you can change the content of the control element every time the options change:
207
+ *
208
+ * var Plugin = can.Control({
209
+ * pluginName: 'myPlugin'
210
+ * }, {
211
+ * init : function(el, options) {
212
+ * this.updateCount = 0;
213
+ * this.update({
214
+ * text : 'Initialized'
215
+ * });
216
+ * },
217
+ * update : function(options) {
218
+ * // Call the can.Control update first.
219
+ * // Use this._super when using can/construct/super
220
+ * can.Control.prototype.update.call(this, options);
221
+ * this.element.html(this.options.text + ' ' +
222
+ * (++this.updateCount) + ' times');
223
+ * }
224
+ * });
225
+ *
226
+ * $('#control').myPlugin();
227
+ * $('#control').html();
228
+ * // Initialized. Updated 1 times
229
+ *
230
+ * $('#control').myPlugin({ text : 'Calling update. Updated' });
231
+ * $('#control').html();
232
+ * // Calling update. Updated 2 times
233
+ *
234
+ * @demo can/control/plugin/demo-update.html
235
+ *
236
+ * @param {Object} options A list of options to merge with
237
+ * [can.Control.prototype.options this.options]. Often this method
238
+ * is called by the [can.Control.plugin jQuery helper function].
239
+ */
240
+ can.Control.prototype.update = function( options ) {
241
+ can.extend(this.options, options);
242
+ this.on();
243
+ };
244
+
245
+ })(this.can, this )