Permalink
Browse files

First release including minimum functionality. Pending final tests, c…

…ode review, etc.
  • Loading branch information...
1 parent 4a6af2c commit a65fe97a9893d15cb78ddbd83f65d47e1719ccd4 dot2code Technologies committed Dec 18, 2012
Showing with 34,100 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +15 −0 AUTHORS.txt
  3. +1 −0 CHANGES.txt
  4. +72 −0 DEVELOPERS.rst
  5. +674 −0 LICENSE.txt
  6. +6 −0 MANIFEST.in
  7. +41 −0 Makefile
  8. +109 −0 extras/init.d/varnish-bans-manager-celerybeat
  9. +95 −0 extras/init.d/varnish-bans-manager-celeryd
  10. +103 −0 extras/init.d/varnish-bans-manager-http
  11. +47 −0 extras/proxies/nginx
  12. +54 −0 setup.py
  13. +8 −0 varnish_bans_manager/__init__.py
  14. +18 −0 varnish_bans_manager/core/__init__.py
  15. +38 −0 varnish_bans_manager/core/backends.py
  16. +26 −0 varnish_bans_manager/core/context_processors.py
  17. +8 −0 varnish_bans_manager/core/forms/__init__.py
  18. +152 −0 varnish_bans_manager/core/forms/bans.py
  19. +75 −0 varnish_bans_manager/core/forms/base.py
  20. +62 −0 varnish_bans_manager/core/forms/settings.py
  21. +219 −0 varnish_bans_manager/core/forms/user.py
  22. +252 −0 varnish_bans_manager/core/forms/users.py
  23. +13 −0 varnish_bans_manager/core/helpers/__init__.py
  24. +131 −0 varnish_bans_manager/core/helpers/cli.py
  25. +144 −0 varnish_bans_manager/core/helpers/commands.py
  26. +41 −0 varnish_bans_manager/core/helpers/csv.py
  27. +36 −0 varnish_bans_manager/core/helpers/http.py
  28. +25 −0 varnish_bans_manager/core/helpers/paginator.py
  29. +56 −0 varnish_bans_manager/core/helpers/views.py
  30. +8 −0 varnish_bans_manager/core/management/__init__.py
  31. +8 −0 varnish_bans_manager/core/management/commands/__init__.py
  32. +96 −0 varnish_bans_manager/core/management/commands/caches.py
  33. +72 −0 varnish_bans_manager/core/management/commands/groups.py
  34. +33 −0 varnish_bans_manager/core/management/commands/start.py
  35. +50 −0 varnish_bans_manager/core/management/commands/users.py
  36. +291 −0 varnish_bans_manager/core/middleware.py
  37. +12 −0 varnish_bans_manager/core/models/__init__.py
  38. +302 −0 varnish_bans_manager/core/models/base.py
  39. +99 −0 varnish_bans_manager/core/models/cache.py
  40. +36 −0 varnish_bans_manager/core/models/group.py
  41. +70 −0 varnish_bans_manager/core/models/setting.py
  42. +92 −0 varnish_bans_manager/core/models/user_profile.py
  43. +8 −0 varnish_bans_manager/core/patches/__init__.py
  44. +20 −0 varnish_bans_manager/core/patches/base_management_command.py
  45. +17 −0 varnish_bans_manager/core/signals.py
  46. +26 −0 varnish_bans_manager/core/tasks/__init__.py
  47. +37 −0 varnish_bans_manager/core/tasks/bans.py
  48. +109 −0 varnish_bans_manager/core/tasks/base.py
  49. +18 −0 varnish_bans_manager/core/tasks/kombu.py
  50. +19 −0 varnish_bans_manager/core/tasks/sessions.py
  51. +63 −0 varnish_bans_manager/core/tasks/users.py
  52. +8 −0 varnish_bans_manager/core/templatetags/__init__.py
  53. +119 −0 varnish_bans_manager/core/templatetags/vbm_base_helpers.py
  54. +74 −0 varnish_bans_manager/core/templatetags/vbm_form_helpers.py
  55. +179 −0 varnish_bans_manager/core/templatetags/vbm_widget_helpers.py
  56. +30 −0 varnish_bans_manager/core/views/__init__.py
  57. +141 −0 varnish_bans_manager/core/views/bans.py
  58. +28 −0 varnish_bans_manager/core/views/caches.py
  59. +52 −0 varnish_bans_manager/core/views/settings.py
  60. +90 −0 varnish_bans_manager/core/views/task.py
  61. +210 −0 varnish_bans_manager/core/views/user.py
  62. +197 −0 varnish_bans_manager/core/views/users.py
  63. +166 −0 varnish_bans_manager/filesystem/__init__.py
  64. +62 −0 varnish_bans_manager/filesystem/forms.py
  65. +222 −0 varnish_bans_manager/filesystem/models.py
  66. +8 −0 varnish_bans_manager/filesystem/sendfile_backends/__init__.py
  67. +22 −0 varnish_bans_manager/filesystem/sendfile_backends/nginx.py
  68. +16 −0 varnish_bans_manager/filesystem/sendfile_backends/stream.py
  69. +15 −0 varnish_bans_manager/filesystem/sendfile_backends/xsendfile.py
  70. +11 −0 varnish_bans_manager/filesystem/signals.py
  71. +68 −0 varnish_bans_manager/filesystem/tasks.py
  72. +80 −0 varnish_bans_manager/filesystem/views.py
  73. +10 −0 varnish_bans_manager/locale/es/LC_MESSAGES/django.po
  74. +37 −0 varnish_bans_manager/locale/es/LC_MESSAGES/djangojs.po
  75. +112 −0 varnish_bans_manager/runner.py
  76. +552 −0 varnish_bans_manager/settings.py
  77. BIN varnish_bans_manager/static/favicon.ico
  78. +240 −0 varnish_bans_manager/static/varnish-bans-manager/css/_font-awesome.scss
  79. 0 varnish_bans_manager/static/varnish-bans-manager/css/_mixins.scss
  80. +59 −0 varnish_bans_manager/static/varnish-bans-manager/css/_pages.scss
  81. +1 −0 varnish_bans_manager/static/varnish-bans-manager/css/_variables.scss
  82. +34 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_accordion.scss
  83. +65 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_alerts.scss
  84. +24 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_breadcrumbs.scss
  85. +242 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_button-groups.scss
  86. +232 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_buttons.scss
  87. +131 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_carousel.scss
  88. +31 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_close.scss
  89. +58 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_code.scss
  90. +22 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_component-animations.scss
  91. +237 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_dropdowns.scss
  92. +682 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_forms.scss
  93. +21 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_grid.scss
  94. +25 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_hero-unit.scss
  95. +71 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_labels-badges.scss
  96. +16 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_layouts.scss
  97. +55 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_media.scss
  98. +684 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_mixins.scss
  99. +95 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_modals.scss
  100. +472 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_navbar.scss
  101. +385 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_navs.scss
  102. +41 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_pager.scss
  103. +121 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_pagination.scss
  104. +117 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_popovers.scss
  105. +122 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_progress-bars.scss
  106. +138 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_reset.scss
  107. +28 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_responsive-1200px-min.scss
  108. +193 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_responsive-767px-max.scss
  109. +19 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_responsive-768px-979px.scss
  110. +185 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_responsive-navbar.scss
  111. +58 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_responsive-utilities.scss
  112. +52 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_scaffolding.scss
  113. +193 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_sprites.scss
  114. +227 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_tables.scss
  115. +52 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_thumbnails.scss
  116. +70 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_tooltip.scss
  117. +227 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_type.scss
  118. +45 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_utilities.scss
  119. +302 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_variables.scss
  120. +29 −0 varnish_bans_manager/static/varnish-bans-manager/css/bootstrap/_wells.scss
  121. +959 −0 varnish_bans_manager/static/varnish-bans-manager/css/main.scss
  122. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/Ubuntu-Medium-webfont.eot
  123. +254 −0 varnish_bans_manager/static/varnish-bans-manager/fonts/Ubuntu-Medium-webfont.svg
  124. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/Ubuntu-Medium-webfont.ttf
  125. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/Ubuntu-Medium-webfont.woff
  126. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/Ubuntu-Regular-webfont.eot
  127. +254 −0 varnish_bans_manager/static/varnish-bans-manager/fonts/Ubuntu-Regular-webfont.svg
  128. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/Ubuntu-Regular-webfont.ttf
  129. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/Ubuntu-Regular-webfont.woff
  130. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/fontawesome-webfont.eot
  131. +255 −0 varnish_bans_manager/static/varnish-bans-manager/fonts/fontawesome-webfont.svg
  132. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/fontawesome-webfont.ttf
  133. BIN varnish_bans_manager/static/varnish-bans-manager/fonts/fontawesome-webfont.woff
  134. BIN varnish_bans_manager/static/varnish-bans-manager/images/background.jpg
  135. BIN varnish_bans_manager/static/varnish-bans-manager/images/breadcrumb.png
  136. BIN varnish_bans_manager/static/varnish-bans-manager/images/browsers/chrome.png
  137. BIN varnish_bans_manager/static/varnish-bans-manager/images/browsers/firefox.png
  138. BIN varnish_bans_manager/static/varnish-bans-manager/images/browsers/ie.png
  139. BIN varnish_bans_manager/static/varnish-bans-manager/images/browsers/opera.png
  140. BIN varnish_bans_manager/static/varnish-bans-manager/images/browsers/safari.png
  141. BIN varnish_bans_manager/static/varnish-bans-manager/images/default-user-photo-128.png
  142. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/header_bg.gif
  143. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/shadow_bl.gif
  144. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/shadow_bottom.gif
  145. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/shadow_br.gif
  146. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/shadow_left.gif
  147. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/shadow_right.gif
  148. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/shadow_tl.gif
  149. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/shadow_top.gif
  150. BIN varnish_bans_manager/static/varnish-bans-manager/images/emails/shadow_tr.gif
  151. BIN varnish_bans_manager/static/varnish-bans-manager/images/error-logo.png
  152. BIN varnish_bans_manager/static/varnish-bans-manager/images/glyphicons-halflings-white.png
  153. BIN varnish_bans_manager/static/varnish-bans-manager/images/glyphicons-halflings.png
  154. BIN varnish_bans_manager/static/varnish-bans-manager/images/header-logo.png
  155. BIN varnish_bans_manager/static/varnish-bans-manager/images/sidebar-active-item.png
  156. BIN varnish_bans_manager/static/varnish-bans-manager/images/sidebar-icons.png
  157. BIN varnish_bans_manager/static/varnish-bans-manager/images/throbber-button.gif
  158. BIN varnish_bans_manager/static/varnish-bans-manager/images/throbber-dialog.gif
  159. BIN varnish_bans_manager/static/varnish-bans-manager/images/throbber-global.gif
  160. +130 −0 varnish_bans_manager/static/varnish-bans-manager/js/ajax.js
  161. +360 −0 varnish_bans_manager/static/varnish-bans-manager/js/behaviors.js
  162. +263 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap.js
  163. +106 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-affix.js
  164. +88 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-alert.js
  165. +94 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-button.js
  166. +176 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-carousel.js
  167. +156 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-collapse.js
  168. +148 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-dropdown.js
  169. +234 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-modal.js
  170. +103 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-popover.js
  171. +151 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-scrollspy.js
  172. +133 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-tab.js
  173. +276 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-tooltip.js
  174. +60 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-transition.js
  175. +310 −0 varnish_bans_manager/static/varnish-bans-manager/js/bootstrap/bootstrap-typeahead.js
  176. +229 −0 varnish_bans_manager/static/varnish-bans-manager/js/commands.js
  177. +251 −0 varnish_bans_manager/static/varnish-bans-manager/js/main.js
  178. +207 −0 varnish_bans_manager/static/varnish-bans-manager/js/navigation.js
  179. +103 −0 varnish_bans_manager/static/varnish-bans-manager/js/notifications.js
  180. +131 −0 varnish_bans_manager/static/varnish-bans-manager/js/partials.js
  181. +77 −0 varnish_bans_manager/static/varnish-bans-manager/js/plugins/history/history.adapter.jquery.js
  182. +621 −0 varnish_bans_manager/static/varnish-bans-manager/js/plugins/history/history.html4.js
  183. +1,943 −0 varnish_bans_manager/static/varnish-bans-manager/js/plugins/history/history.js
  184. BIN ...ns-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
  185. BIN ...ns-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
  186. BIN ...varnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
  187. BIN ...arnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
  188. BIN ...arnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
  189. BIN ...varnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
  190. BIN ...-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
  191. BIN ...ns-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
  192. BIN ...ans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
  193. BIN ...tic/varnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png
  194. BIN ...tic/varnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png
  195. BIN ...tic/varnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
  196. BIN ...tic/varnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
  197. BIN ...tic/varnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png
  198. +302 −0 ...ger/static/varnish-bans-manager/js/plugins/jquery-ui/css/ui-lightness/jquery-ui-1.8.24.custom.css
  199. +125 −0 varnish_bans_manager/static/varnish-bans-manager/js/plugins/jquery-ui/jquery.ui.js
  200. +1,117 −0 varnish_bans_manager/static/varnish-bans-manager/js/plugins/jquery.form.js
  201. +9,440 −0 varnish_bans_manager/static/varnish-bans-manager/js/plugins/jquery.js
  202. +153 −0 varnish_bans_manager/static/varnish-bans-manager/js/plugins/jquery.notify.js
  203. +79 −0 varnish_bans_manager/static/varnish-bans-manager/js/plugins/jquery.once.js
  204. +6 −0 varnish_bans_manager/templates/403.html
  205. +6 −0 varnish_bans_manager/templates/404.html
  206. +6 −0 varnish_bans_manager/templates/500.html
  207. +9 −0 varnish_bans_manager/templates/ajax.html
  208. +18 −0 varnish_bans_manager/templates/anonymous.html
  209. +58 −0 varnish_bans_manager/templates/authenticated.html
  210. +102 −0 varnish_bans_manager/templates/base.html
  211. +85 −0 varnish_bans_manager/templates/emails/base.email
  212. +25 −0 varnish_bans_manager/templates/emails/varnish-bans-manager/core/user/password_reset.email
  213. +81 −0 varnish_bans_manager/templates/error.html
  214. +10 −0 varnish_bans_manager/templates/modal.html
  215. +106 −0 varnish_bans_manager/templates/varnish-bans-manager/core/bans/advanced.html
  216. +60 −0 varnish_bans_manager/templates/varnish-bans-manager/core/bans/basic.html
  217. +131 −0 varnish_bans_manager/templates/varnish-bans-manager/core/bans/expert.html
  218. +70 −0 varnish_bans_manager/templates/varnish-bans-manager/core/bans/layout.html
  219. +26 −0 varnish_bans_manager/templates/varnish-bans-manager/core/bans/status.html
  220. +26 −0 varnish_bans_manager/templates/varnish-bans-manager/core/bans/submissions.html
  221. +48 −0 varnish_bans_manager/templates/varnish-bans-manager/core/bans/submit_errors.html
  222. +24 −0 varnish_bans_manager/templates/varnish-bans-manager/core/caches/browse.html
  223. +34 −0 varnish_bans_manager/templates/varnish-bans-manager/core/caches/layout.html
  224. +87 −0 varnish_bans_manager/templates/varnish-bans-manager/core/settings/general.html
  225. +34 −0 varnish_bans_manager/templates/varnish-bans-manager/core/settings/layout.html
  226. +41 −0 varnish_bans_manager/templates/varnish-bans-manager/core/user/layout.html
  227. +41 −0 varnish_bans_manager/templates/varnish-bans-manager/core/user/login.html
  228. +71 −0 varnish_bans_manager/templates/varnish-bans-manager/core/user/password.html
  229. +33 −0 varnish_bans_manager/templates/varnish-bans-manager/core/user/password_reset.html
  230. +40 −0 varnish_bans_manager/templates/varnish-bans-manager/core/user/password_reset_confirm.html
  231. +76 −0 varnish_bans_manager/templates/varnish-bans-manager/core/user/profile.html
  232. +86 −0 varnish_bans_manager/templates/varnish-bans-manager/core/users/_edit_form.html
  233. +27 −0 varnish_bans_manager/templates/varnish-bans-manager/core/users/add.html
  234. +159 −0 varnish_bans_manager/templates/varnish-bans-manager/core/users/browse.html
  235. +41 −0 varnish_bans_manager/templates/varnish-bans-manager/core/users/layout.html
  236. +54 −0 varnish_bans_manager/templates/varnish-bans-manager/core/users/update.html
  237. +3 −0 varnish_bans_manager/templates/varnish-bans-manager/partials/_authenticated_footer.html
  238. +244 −0 varnish_bans_manager/templates/varnish-bans-manager/partials/_debug.html
  239. +7 −0 varnish_bans_manager/templates/varnish-bans-manager/partials/_debug.txt
  240. +197 −0 varnish_bans_manager/urls.py
  241. +21 −0 varnish_bans_manager/wsgi.py
View
@@ -0,0 +1,2 @@
+.DS_Store
+*.pyc
View
@@ -0,0 +1,15 @@
+Varnish Bans Manager (VBM) developers are:
+
+ - Carlos Abalde <cabalde@dot2code.com>
+
+ - David Fuentes <davidfb@dot2code.com>
+
+
+VBM is sponsored by dot2code Technologies (http://dot2code.com) and
+Allenta Consulting (http://allenta.com).
+
+ - For general inquiries, please, contact us directly at
+ info@dot2code.com.
+
+ - For bug reports and feature suggestions, please, use GitHub's
+ issue tracker at https://github.com/dot2code/varnish-bans-manager/issues.
View
@@ -0,0 +1 @@
+v0.1, 12/20/2012 -- Initial release.
View
@@ -0,0 +1,72 @@
+General Tips
+============
+
+Next you can find some general Varnish Bans Manager (VBM) development
+tips. These are only useful for developers when setting up their
+development environment.
+
+- Check out setup.py and install all required dependencies.
+
+- Use ``VARNISH_BANS_MANAGER_CONF`` environment variable to point to
+ your personal settings file. Also remember to:
+
+ - Set ``development`` to true in your personal settings file.
+
+ - Disable ``http > daemon`` in your personal settings file if
+ developing using Gunicorn::
+
+ $ python varnish_bans_manager/runner.py start
+
+ - Use ``--nothreading`` if using Django embedded HTTP server::
+
+ $ python varnish_bans_manager/runner.py runserver 0.0.0.0:9000 --nothreading
+
+- Install `Sass <http://sass-lang.com>`_ and `Compass <http://compass-style.org>`_
+ in your development box (required by ``django-mediagenerator`` asset manager)::
+
+ $ sudo apt-get install rubygems
+ $ sudo gem install sass compass
+
+- Don't forget to manually launch celeryd/celerybeat in some available
+ term/screen while developing::
+
+ $ python varnish_bans_manager/runner.py celery worker --beat -s ~/varnish-bans-manager-celerybeat-schedule --loglevel=info
+
+- Remember to install the packages required by your relational database
+ backend. For example, for MySQL::
+
+ $ pip install MySQL-python
+
+- While developing, press ``CTRL+ALT+A`` in your browser to display the
+ VBM debug console.
+
+Source Distribution Package
+===========================
+
+VBM sources require a build step previous to the generation of the Python
+source distribution Package. During this phase SASS sources are compiled
+to CSS, some Javascript and CSS bundles are created, static contents are
+versioned, translation files are compiled, etc.
+
+In order to execute this site building phase and then generate the Python
+source distribution package, simply run the following command in the root
+folder of the VBM sources::
+
+ $ make sdist
+
+Note that the site building phase has some extra system requirements:
+
+- `YUI Compressor <http://developer.yahoo.com/yui/compressor/>`_ and some
+ Java Runtime Environment::
+
+ $ export YUICOMPRESSOR_PATH="/path/to/yuicompressor.jar"
+ $ sudo apt-get install openjdk-7-jre
+
+- GNU internationalization utilities. In Ubuntu::
+
+ $ sudo apt-get install gettext
+
+TODO
+====
+
+- Refactor ``varnish_bans_manager.filesystem.models``.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,6 @@
+include *.txt
+include *.rst
+recursive-include varnish_bans_manager/assets *
+recursive-include varnish_bans_manager/templates *
+recursive-include varnish_bans_manager/locale *
+global-exclude *~
View
@@ -0,0 +1,41 @@
+VBM_ROOT=.
+
+sdist: build
+ @echo
+ @echo "> Creating Python source distribution..."
+ cd $(VBM_ROOT)/build; python setup.py sdist
+
+ @echo
+ @echo "> Source distribution package successfully generated in $(VBM_ROOT)/build/dist/"
+ @echo
+
+build: clone
+ @echo
+ @echo "> Compiling .po files..."
+ python "$(VBM_ROOT)/build/varnish_bans_manager/runner.py" compilemessages
+
+ @echo
+ @echo "> Generating static media..."
+ python "$(VBM_ROOT)/build/varnish_bans_manager/runner.py" generatemedia
+
+ @echo
+ @echo "> Cleaning up..."
+ rm -rf "$(VBM_ROOT)/build/varnish_bans_manager/static"
+ find "$(VBM_ROOT)/build" \
+ -name "*.pyc" -o \
+ -name "*.po" -o \
+ -name ".svn" | xargs rm -f
+
+clone: clean
+ @echo
+ @echo "> Cloning VBM source files..."
+ mkdir -p "$(VBM_ROOT)/build/"
+ rsync -a --delete --delete-excluded \
+ --exclude="build" --exclude="extras" \
+ --exclude="Makefile" --exclude="DEVELOPERS.rst" \
+ --exclude="vbm.sublime-project" --exclude="vbm.sublime-workspace" \
+ --exclude="sftp-config.json" \
+ "$(VBM_ROOT)" "$(VBM_ROOT)/build/"
+
+clean:
+ rm -rf "$(VBM_ROOT)/build/"
@@ -0,0 +1,109 @@
+#!/bin/bash
+
+### BEGIN INIT INFO
+# Provides: varnish-bans-manager-celerybeat
+# Required-Start: $network $local_fs
+# Required-Stop: $network $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Varnish Bans Manager (VBM) Celery periodic task scheduler
+### END INIT INFO
+
+##
+## Configuration.
+##
+VIRTUALENV="/var/www/varnish-bans-manager"
+CELERYBEAT="varnish-bans-manager celerybeat"
+CELERYBEAT_PID_FILE="/var/run/varnish-bans-manager/celerybeat.pid"
+CELERYBEAT_LOG_FILE="/var/log/varnish-bans-manager/celerybeat.log"
+CELERYBEAT_LOG_LEVEL="WARNING"
+CELERYBEAT_SCHEDULE="/var/www/varnish-bans-manager/celerybeat-schedule"
+CELERYBEAT_DAEMON_OPTS="\
+ --pidfile="$CELERYBEAT_PID_FILE" \
+ --logfile="$CELERYD_LOG_FILE" \
+ --loglevel="$CELERYD_LOG_LEVEL" \
+ --schedule="$CELERYBEAT_SCHEDULE" \
+ --uid www-data \
+ --gid www-data \
+ --detach"
+
+##
+##
+##
+wait_pid () {
+ pid=$1
+ forever=1
+ i=0
+ while [ $forever -gt 0 ]; do
+ kill -0 $pid 1>/dev/null 2>&1
+ if [ $? -eq 1 ]; then
+ echo "OK"
+ forever=0
+ else
+ kill -TERM "$pid"
+ i=$((i + 1))
+ if [ $i -gt 60 ]; then
+ echo "ERROR" 1>&2
+ echo "Timed out while stopping (30s)" 1>&2
+ forever=0
+ else
+ sleep 0.5
+ fi
+ fi
+ done
+}
+
+##
+##
+##
+start_beat () {
+ echo "Starting celerybeat..."
+ $CELERYBEAT $CELERYBEAT_DAEMON_OPTS
+}
+
+##
+##
+##
+stop_beat () {
+ echo -n "Stopping celerybeat... "
+ if [ -f "$CELERYBEAT_PID_FILE" ]; then
+ wait_pid $(cat "$CELERYBEAT_PID_FILE")
+ else
+ echo "NOT RUNNING" 1>&2
+ fi
+}
+
+##
+##
+##
+source "$VIRTUALENV/bin/activate"
+
+##
+##
+##
+case "$1" in
+ start)
+ start_beat
+ ;;
+ stop)
+ stop_beat
+ ;;
+ reload|force-reload)
+ echo "Use start+stop"
+ ;;
+ restart)
+ echo "Restarting celery periodic task scheduler"
+ stop_beat
+ start_beat
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}" 1>&2
+ exit 64 # EX_USAGE
+ ;;
+esac
+
+##
+## Done!
+##
+deactivate
+exit 0
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+### BEGIN INIT INFO
+# Provides: varnish-bans-manager-celeryd
+# Required-Start: $network $local_fs
+# Required-Stop: $network $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Varnish Bans Manager (VBM) Celery worker daemon
+### END INIT INFO
+
+##
+## Configuration.
+##
+VIRTUALENV="/var/www/varnish-bans-manager"
+CELERYD_MULTI="varnish-bans-manager celeryd_multi"
+CELERYD_CTL="varnish-bans-manager celeryctl"
+CELERYD_PID_FILE="/var/run/varnish-bans-manager/celeryd.pid"
+CELERYD_LOG_FILE="/var/log/varnish-bans-manager/celeryd.log"
+CELERYD_LOG_LEVEL="WARNING"
+CELERYD_CMD="-m celery.bin.celeryd_detach"
+CELERYD_NODES="w1"
+CELERYD_DAEMON_OPTS="\
+ --pidfile="$CELERYD_PID_FILE" \
+ --logfile="$CELERYD_LOG_FILE" \
+ --loglevel="$CELERYD_LOG_LEVEL" \
+ --uid=www-data \
+ --gid=www-data \
+ --time-limit=300 \
+ --concurrency=2"
+
+##
+##
+##
+start_workers () {
+ $CELERYD_MULTI start $CELERYD_NODES $CELERYD_DAEMON_OPTS --cmd="$CELERYD_CMD"
+}
+
+##
+##
+##
+restart_workers () {
+ $CELERYD_MULTI restart $CELERYD_NODES $CELERYD_DAEMON_OPTS --cmd="$CELERYD_CMD"
+}
+
+##
+##
+##
+stop_workers () {
+ $CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE"
+}
+
+##
+##
+##
+source "$VIRTUALENV/bin/activate"
+
+##
+##
+##
+case "$1" in
+ start)
+ start_workers
+ ;;
+
+ stop)
+ stop_workers
+ ;;
+
+ reload|force-reload)
+ echo "Use restart"
+ ;;
+
+ status)
+ $CELERYD_CTL status $CELERYD_CTL_OPTS
+ ;;
+
+ restart)
+ restart_workers
+ ;;
+
+ try-restart)
+ restart_workers
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status}" 1>&2
+ exit 64 # EX_USAGE
+ ;;
+esac
+
+##
+## Done!
+##
+deactivate
+exit 0
Oops, something went wrong.

0 comments on commit a65fe97

Please sign in to comment.