configuration.rst 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. .. MediaGoblin Documentation
  2. Written in 2011, 2012 by MediaGoblin contributors
  3. To the extent possible under law, the author(s) have dedicated all
  4. copyright and related and neighboring rights to this software to
  5. the public domain worldwide. This software is distributed without
  6. any warranty.
  7. You should have received a copy of the CC0 Public Domain
  8. Dedication along with this software. If not, see
  9. <http://creativecommons.org/publicdomain/zero/1.0/>.
  10. .. _configuration-chapter:
  11. ========================
  12. Configuring MediaGoblin
  13. ========================
  14. So! You've got MediaGoblin up and running, but you need to adjust
  15. some configuration parameters. Well you've come to the right place!
  16. MediaGoblin's config files
  17. ==========================
  18. When configuring MediaGoblin, there are two files you might want to
  19. make local modified versions of, and one extra file that might be
  20. helpful to look at. Let's examine these.
  21. mediagoblin.ini
  22. This is the config file for MediaGoblin, the application. If you want to
  23. tweak settings for MediaGoblin, you'll usually tweak them here.
  24. paste.ini
  25. This is primarily a server configuration file, on the Python side
  26. (specifically, on the WSGI side, via `paste deploy
  27. <http://pythonpaste.org/deploy/>`_ / `paste script
  28. <http://pythonpaste.org/script/>`_). It also sets up some
  29. middleware that you can mostly ignore, except to configure
  30. sessions... more on that later. If you are adding a different
  31. Python server other than fastcgi / plain HTTP, you might configure
  32. it here. You probably won't need to change this file very much.
  33. There's one more file that you certainly won't change unless you're
  34. making coding contributions to mediagoblin, but which can be useful to
  35. read and reference:
  36. mediagoblin/config_spec.ini
  37. This file is actually a specification for mediagoblin.ini itself, as
  38. a config file! It defines types and defaults. Sometimes it's a
  39. good place to look for documentation... or to find that hidden
  40. option that we didn't tell you about. :)
  41. Making local copies
  42. ===================
  43. Let's assume you're doing the virtualenv setup described elsewhere in this
  44. manual, and you need to make local tweaks to the config files. How do you do
  45. that? Let's see.
  46. To make changes to mediagoblin.ini ::
  47. cp mediagoblin.ini mediagoblin_local.ini
  48. To make changes to paste.ini ::
  49. cp paste.ini paste_local.ini
  50. From here you should be able to make direct adjustments to the files,
  51. and most of the commands described elsewhere in this manual will "notice"
  52. your local config files and use those instead of the non-local version.
  53. .. note::
  54. Note that all commands provide a way to pass in a specific config
  55. file also, usually by a ``-cf`` flag.
  56. Common changes
  57. ==============
  58. Enabling email notifications
  59. ----------------------------
  60. You'll almost certainly want to enable sending email. By default,
  61. MediaGoblin doesn't really do this... for the sake of developer
  62. convenience, it runs in "email debug mode".
  63. To make MediaGoblin send email, you need a mailer daemon.
  64. Change this in your ``mediagoblin.ini`` file::
  65. email_debug_mode = false
  66. You should also change the "from" email address by setting
  67. ``email_sender_address``. For example::
  68. email_sender_address = "foo@example.com"
  69. If you have more custom SMTP settings, you also have the following
  70. options at your disposal, which are all optional, and do exactly what
  71. they sound like.
  72. - email_smtp_host
  73. - email_smtp_port
  74. - email_smtp_user
  75. - email_smtp_pass
  76. Changing data directory
  77. -----------------------
  78. MediaGoblin by default stores your data in wherever ``data_basedir``.
  79. This can be changed by changing the value in your ``mediagoblin.ini`` file
  80. for example::
  81. [DEFAULT]
  82. data_basedir = "/var/mediagoblin/user_data"
  83. For efficiency reasons MediaGoblin doesn't serve these files itself and
  84. instead leaves that to the webserver. You will have to alter the location
  85. to match the path in ``data_basedir``.
  86. If you use ``lazyserver.sh`` you need to change the ``paste.ini`` file::
  87. [app:mediagoblin]
  88. /mgoblin_media = /var/mediagoblin/user_data
  89. If you use nginx you need to change the config::
  90. # Instance specific media:
  91. location /mgoblin_media/ {
  92. alias /var/mediagoblin/user_data;
  93. }
  94. Once you have done this you will need to move any existing media you had in the
  95. old directory to the new directory so existing media still can be displayed.
  96. All other configuration changes
  97. -------------------------------
  98. To be perfectly honest, there are quite a few options and we haven't had
  99. time to document them all.
  100. So here's a cop-out section saying that if you get into trouble, hop
  101. onto IRC and we'll help you out. Details for the IRC channel is on the
  102. `join page`_ of the website.
  103. .. _join page: http://mediagoblin.org/join/
  104. Celery
  105. ======
  106. FIXME: List Celery configuration here.