PageRenderTime 33ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/disabling-sites.txt

https://bitbucket.org/ianb/silverlining/
Plain Text | 63 lines | 50 code | 13 blank | 0 comment | 0 complexity | 8220904c2219da81257e80e00994b132 MD5 | raw file
Possible License(s): GPL-2.0
  1. .. -*- mode: rst -*-
  2. =================
  3. Disabling Sites
  4. =================
  5. When hosting a site it's likely that from time to time it will be
  6. necessary to make it unavailable to the general public while some
  7. maintenance is carried out. Silver Lining provides a mechanism for
  8. allowing this. It is important to recognise that it is *applications*
  9. that are disabled via this mechanism, rather than locations, so if the
  10. same application is accessible via two different locations (even if it
  11. is two different *deployments* of the application), and it is
  12. disabled, then it will appear to be disabled at both locations. This
  13. is because if your application uses a database, then all different
  14. deployments of the application will share the database, and cleaning
  15. up databases is one of the key use-cases for this feature.
  16. Disabling an application
  17. ========================
  18. The following command will disable an application called blog::
  19. $ silver disable --by-name blog
  20. You can also disable the application by giving a path that it appears
  21. at::
  22. silver disable --by-location www.example.com/blog
  23. Enabling an application
  24. =======================
  25. To re-enable an application you use the ``silver enable`` command,
  26. which takes the same options as silver disable command.
  27. The disabled special location
  28. =============================
  29. When an application is disabled, visitors to it will be shown a page
  30. explaining that the site is unavailable (similarly there is a
  31. not-found location which is shown when a URL is not resolved). It is
  32. possible to replace this page by uploading a new WSGI application to
  33. the special location "disabled". To restore the default application,
  34. use the ``silver activate`` command to point the disabled location to
  35. "default-disabled".
  36. Headers for disabled apps
  37. -------------------------
  38. It is sensible to return a "503 Service Unavailable" response from a
  39. disabled app and use the following headers:
  40. :Cache-Control: no-store, no-cache, max-age=0
  41. :Pragma: no-cache
  42. Access To disabled apps
  43. =======================
  44. While an application is disabled, it is still possible to access it
  45. via the command line tools. ``silver backup``, ``restore``, ``run``
  46. etc. will all work as usual. It's also possible to access the site
  47. through a web browser. At present the application is only made
  48. available to clients connecting from localhost, so to view the site
  49. and access management facilities you will probably need to set up an
  50. SSH tunnel and manually update ``/etc/hosts`` on your own machine.