From c1bf89f64e86c1fe04ad4f85e8fda3804af62dec Mon Sep 17 00:00:00 2001
From: saksham1115 <saksham115@gmail.com>
Date: Mon, 29 Feb 2016 18:30:33 +0530
Subject: [PATCH 2/3] Second fix for the issue #5429
---
docs/source/siteadmin/configuration.rst | 6 +-----
docs/source/siteadmin/deploying.rst | 26 ++++++++++++------------
docs/source/siteadmin/media-types.rst | 12 +++++------
docs/source/siteadmin/production-deployments.rst | 10 ++++-----
docs/source/siteadmin/relnotes.rst | 16 +++++----------
docs/source/siteadmin/theming.rst | 4 ++--
mediagoblin/plugins/piwigo/README.rst | 2 +-
mediagoblin/plugins/trim_whitespace/README.rst | 3 +--
8 files changed, 34 insertions(+), 45 deletions(-)
diff --git a/docs/source/siteadmin/configuration.rst b/docs/source/siteadmin/configuration.rst
index dd0d6cd..c2705b3 100644
a
|
b
|
Making local copies
|
58 | 58 | =================== |
59 | 59 | |
60 | 60 | Let's assume you're doing the virtualenv setup described elsewhere in this |
61 | | manual, and you need to make local tweaks to the config files. How do you do |
| 61 | manual, and you need to make local tweaks to the config files. How do you do |
62 | 62 | that? Let's see. |
63 | 63 | |
64 | | To make changes to mediagoblin.ini :: |
65 | | |
66 | | cp mediagoblin.ini mediagoblin_local.ini |
67 | | |
68 | 64 | To make changes to paste.ini :: |
69 | 65 | |
70 | 66 | cp paste.ini paste_local.ini |
diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst
index 47901da..5ba9b05 100644
a
|
b
|
approach, see our
|
43 | 43 | Throughout the documentation we use the ``sudo`` command to indicate that |
44 | 44 | an instruction requires elevated user privileges to run. You can issue |
45 | 45 | these commands as the ``root`` user if you prefer. |
46 | | |
| 46 | |
47 | 47 | If you need help configuring ``sudo``, see the |
48 | 48 | `Debian wiki <https://wiki.debian.org/sudo/>`_ or the |
49 | | `Fedora Project wiki <https://fedoraproject.org/wiki/Configuring_Sudo/>`_. |
| 49 | `Fedora Project wiki <https://fedoraproject.org/wiki/Configuring_Sudo/>`_. |
50 | 50 | |
51 | 51 | |
52 | 52 | Prepare System |
… |
… |
MediaGoblin does not require special permissions or elevated
|
161 | 161 | access to run. As such, the preferred way to run MediaGoblin is to |
162 | 162 | create a dedicated, unprivileged system user for the sole purpose of running |
163 | 163 | MediaGoblin. Running MediaGoblin processes under an unprivileged system user |
164 | | helps to keep it more secure. |
| 164 | helps to keep it more secure. |
165 | 165 | |
166 | 166 | The following command (entered as root or with sudo) will create a |
167 | 167 | system account with a username of ``mediagoblin``. You may choose a different |
… |
… |
read the media files (images, videos, etc.) that users upload.
|
181 | 181 | |
182 | 182 | We will also create a ``mediagoblin`` group and associate the mediagoblin |
183 | 183 | user with that group, as well:: |
184 | | |
| 184 | |
185 | 185 | sudo groupadd mediagoblin && sudo usermod --append -G mediagoblin mediagoblin |
186 | | |
| 186 | |
187 | 187 | No password will be assigned to this account, and you will not be able |
188 | 188 | to log in as this user. To switch to this account, enter:: |
189 | 189 | |
… |
… |
Create a MediaGoblin Directory
|
198 | 198 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
199 | 199 | |
200 | 200 | You should create a working directory for MediaGoblin. This document |
201 | | assumes your local git repository will be located at |
| 201 | assumes your local git repository will be located at |
202 | 202 | ``/srv/mediagoblin.example.org/mediagoblin/``. |
203 | 203 | Substitute your prefered local deployment path as needed. |
204 | 204 | |
… |
… |
your preferred method.
|
286 | 286 | |
287 | 287 | If you want to install all of MediaGoblin's libraries |
288 | 288 | independently, that's totally fine! You can pass the flag |
289 | | ``--without-virtualenv`` which will skip this step. |
| 289 | ``--without-virtualenv`` which will skip this step. |
290 | 290 | But you will need to install all those libraries manually and make |
291 | 291 | sure they are on your ``PYTHONPATH`` yourself! (You can still use |
292 | 292 | ``python setup.py develop`` to install some of those libraries, |
293 | 293 | but note that no ``./bin/python`` will be set up for you via this |
294 | 294 | method, since no virtualenv is set up for you!) |
295 | 295 | |
296 | | This concludes the initial configuration of the MediaGoblin |
| 296 | This concludes the initial configuration of the MediaGoblin |
297 | 297 | environment. In the future, when you update your |
298 | 298 | codebase, you should also run:: |
299 | 299 | |
… |
… |
Edit site configuration
|
314 | 314 | ~~~~~~~~~~~~~~~~~~~~~~~ |
315 | 315 | |
316 | 316 | A few basic properties must be set before MediaGoblin will work. First |
317 | | make a copy of ``mediagoblin.ini`` and ``paste.ini`` for editing so the original |
| 317 | make a copy of ``paste.ini`` for editing so the original |
318 | 318 | config files aren't lost (you likely won't need to edit the paste configuration, |
319 | 319 | but we'll make a local copy of it just in case):: |
320 | 320 | |
321 | | $ cp -av mediagoblin.ini mediagoblin_local.ini && cp -av paste.ini paste_local.ini |
| 321 | $ cp -av paste.ini paste_local.ini |
322 | 322 | |
323 | | Then edit mediagoblin_local.ini: |
| 323 | Then edit mediagoblin.ini: |
324 | 324 | - Set ``email_sender_address`` to the address you wish to be used as |
325 | 325 | the sender for system-generated emails |
326 | 326 | - Edit ``direct_remote_path``, ``base_dir``, and ``base_url`` if |
… |
… |
Configure MediaGoblin to use the PostgreSQL database
|
332 | 332 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
333 | 333 | |
334 | 334 | If you are using postgres, edit the ``[mediagoblin]`` section in your |
335 | | ``mediagoblin_local.ini`` and put in:: |
| 335 | ``mediagoblin.ini`` and put in:: |
336 | 336 | |
337 | 337 | sql_engine = postgresql:///mediagoblin |
338 | 338 | |
… |
… |
Visit the site you've set up in your browser by visiting
|
505 | 505 | smaller deployments. However, for larger production deployments |
506 | 506 | with larger processing requirements, see the |
507 | 507 | ":doc:`production-deployments`" documentation. |
508 | | |
| 508 | |
509 | 509 | |
510 | 510 | Apache |
511 | 511 | ~~~~~~ |
diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst
index 34faef1..712c5c4 100644
a
|
b
|
good/bad/ugly). On Debianoid systems
|
98 | 98 | |
99 | 99 | |
100 | 100 | Add ``[[mediagoblin.media_types.video]]`` under the ``[plugins]`` section in |
101 | | your ``mediagoblin_local.ini`` and restart MediaGoblin. |
| 101 | your ``mediagoblin.ini`` and restart MediaGoblin. |
102 | 102 | |
103 | 103 | Run |
104 | 104 | |
… |
… |
Then install ``scikits.audiolab`` for the spectrograms::
|
138 | 138 | ./bin/pip install scikits.audiolab |
139 | 139 | |
140 | 140 | Add ``[[mediagoblin.media_types.audio]]`` under the ``[plugins]`` section in your |
141 | | ``mediagoblin_local.ini`` and restart MediaGoblin. |
| 141 | ``mediagoblin.ini`` and restart MediaGoblin. |
142 | 142 | |
143 | 143 | Run |
144 | 144 | |
… |
… |
To enable raw image you need to install pyexiv2. On Debianoid systems
|
159 | 159 | sudo apt-get install python-pyexiv2 |
160 | 160 | |
161 | 161 | Add ``[[mediagoblin.media_types.raw_image]]`` under the ``[plugins]`` |
162 | | section in your ``mediagoblin_local.ini`` and restart MediaGoblin. |
| 162 | section in your ``mediagoblin.ini`` and restart MediaGoblin. |
163 | 163 | |
164 | 164 | Run |
165 | 165 | |
… |
… |
library, which is necessary for creating thumbnails of ascii art
|
184 | 184 | |
185 | 185 | |
186 | 186 | Next, modify (and possibly copy over from ``mediagoblin.ini``) your |
187 | | ``mediagoblin_local.ini``. In the ``[plugins]`` section, add |
| 187 | ``mediagoblin.ini``. In the ``[plugins]`` section, add |
188 | 188 | ``[[mediagoblin.media_types.ascii]]``. |
189 | 189 | |
190 | 190 | Run |
… |
… |
It may work on some earlier versions, but that is not guaranteed (and
|
206 | 206 | is surely not to work prior to Blender 2.5X). |
207 | 207 | |
208 | 208 | Add ``[[mediagoblin.media_types.stl]]`` under the ``[plugins]`` section in your |
209 | | ``mediagoblin_local.ini`` and restart MediaGoblin. |
| 209 | ``mediagoblin.ini`` and restart MediaGoblin. |
210 | 210 | |
211 | 211 | Run |
212 | 212 | |
… |
… |
This feature has been tested on Fedora with:
|
255 | 255 | It may work on some earlier versions, but that is not guaranteed. |
256 | 256 | |
257 | 257 | Add ``[[mediagoblin.media_types.pdf]]`` under the ``[plugins]`` section in your |
258 | | ``mediagoblin_local.ini`` and restart MediaGoblin. |
| 258 | ``mediagoblin.ini`` and restart MediaGoblin. |
259 | 259 | |
260 | 260 | Run |
261 | 261 | |
diff --git a/docs/source/siteadmin/production-deployments.rst b/docs/source/siteadmin/production-deployments.rst
index e65ac33..81938f1 100644
a
|
b
|
modify it to suit your environment's setup:
|
73 | 73 | ExecStartPre=/bin/mkdir -p /run/mediagoblin |
74 | 74 | ExecStartPre=/bin/chown -hR mediagoblin:mediagoblin /run/mediagoblin |
75 | 75 | # Celery process will run as the `mediagoblin` user after start. |
76 | | Environment=MEDIAGOBLIN_CONFIG=/srv/mediagoblin.example.org/mediagoblin/mediagoblin_local.ini \ |
| 76 | Environment=MEDIAGOBLIN_CONFIG=/srv/mediagoblin.example.org/mediagoblin/mediagoblin.ini \ |
77 | 77 | CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_celery |
78 | 78 | ExecStart=/srv/mediagoblin.example.org/mediagoblin/bin/celery worker \ |
79 | 79 | --logfile=/var/log/mediagoblin/celery.log \ |
80 | 80 | --loglevel=INFO |
81 | 81 | PIDFile=/run/mediagoblin/mediagoblin-celeryd.pid |
82 | | |
| 82 | |
83 | 83 | [Install] |
84 | 84 | WantedBy=multi-user.target |
85 | 85 | |
… |
… |
The second file should be named ``mediagoblin-paster.service``:
|
94 | 94 | # If using Fedora/CentOS/Red Hat, mkdir and chown are located in /usr/bin/mkdir and /usr/bin/chown, respectively. |
95 | 95 | [Unit] |
96 | 96 | Description=Mediagoblin |
97 | | |
| 97 | |
98 | 98 | [Service] |
99 | 99 | Type=forking |
100 | 100 | User=mediagoblin |
… |
… |
The second file should be named ``mediagoblin-paster.service``:
|
105 | 105 | PermissionsStartOnly=true |
106 | 106 | ExecStartPre=-/bin/mkdir -p /run/mediagoblin |
107 | 107 | ExecStartPre=/bin/chown -hR mediagoblin:mediagoblin /run/mediagoblin |
108 | | |
| 108 | |
109 | 109 | ExecStart=/srv/mediagoblin.example.org/mediagoblin/bin/paster serve \ |
110 | 110 | /srv/mediagoblin.example.org/mediagoblin/paste_local.ini \ |
111 | 111 | --pid-file=/var/run/mediagoblin/mediagoblin.pid \ |
… |
… |
The second file should be named ``mediagoblin-paster.service``:
|
116 | 116 | --pid-file=/var/run/mediagoblin/mediagoblin.pid \ |
117 | 117 | /srv/mediagoblin.example.org/mediagoblin/paste_local.ini stop |
118 | 118 | PIDFile=/var/run/mediagoblin/mediagoblin.pid |
119 | | |
| 119 | |
120 | 120 | [Install] |
121 | 121 | WantedBy=multi-user.target |
122 | 122 | |
diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst
index 41d8f62..957e264 100644
a
|
b
|
Additionally:
|
148 | 148 | future mitration work |
149 | 149 | - Automatically create a fresh mediagoblin.ini from |
150 | 150 | mediagoblin.ini.example |
151 | | - no more need for mediagoblin_local.ini (though it's still supported) |
152 | 151 | - Fix lowercasing of username in auth steps |
153 | 152 | - Slowly moving towards removing global state (a source of many bugs) |
154 | 153 | |
… |
… |
That's it, probably! If you run into problems, don't hesitate to
|
227 | 226 | (which will be the foundation for MediaGoblin's federation) |
228 | 227 | - New theme: Sandy 70s Speedboat! |
229 | 228 | |
230 | | - Metadata features! We also now have a json-ld context. |
| 229 | - Metadata features! We also now have a json-ld context. |
231 | 230 | |
232 | 231 | - Many improvements for archival institutions, including metadata |
233 | 232 | support and featuring items on the homepage. With the (new!) |
… |
… |
now. Otherwise, jump in and have fun! :)
|
397 | 396 | .. mention something about new, experimental configure && make support |
398 | 397 | |
399 | 398 | 2. Note that a couple of things have changed with ``mediagoblin.ini``. First |
400 | | we have a new Authentication System. You need to add |
401 | | ``[[mediagoblin.plugins.basic_auth]]`` under the ``[plugins]`` section of |
| 399 | we have a new Authentication System. You need to add |
| 400 | ``[[mediagoblin.plugins.basic_auth]]`` under the ``[plugins]`` section of |
402 | 401 | your config file. Second, media types are now plugins, so you need to add |
403 | 402 | each media type under the ``[plugins]`` section of your config file. |
404 | 403 | |
405 | 404 | |
406 | | 3. We have made a script to transition your ``mediagoblin_local.ini`` file for |
407 | | you. This script can be found at: |
408 | | |
409 | | http://mediagoblin.org/download/0.5.0_config_converter.py |
410 | | |
411 | 405 | If you run into problems, don't hesitate to |
412 | 406 | `contact us <http://mediagoblin.org/pages/join.html>`_ |
413 | 407 | (IRC is often best). |
… |
… |
If you run into problems, don't hesitate to
|
415 | 409 | **New features** |
416 | 410 | |
417 | 411 | * As mentioned above, we now have a plugable Authentication system. You can |
418 | | use any combination of the multiple authentication systems |
| 412 | use any combination of the multiple authentication systems |
419 | 413 | (:ref:`basic_auth-chapter`, :ref:`persona-chapter`, :ref:`openid-chapter`) |
420 | 414 | or write your own! |
421 | 415 | * Media types are now plugins! This means that new media types will |
… |
… |
MongoDB-based MediaGoblin instance to the newer SQL-based system.
|
612 | 606 | |
613 | 607 | # perform any needed database updates |
614 | 608 | bin/gmg dbupdate |
615 | | |
| 609 | |
616 | 610 | # restart your servers however you do that, e.g., |
617 | 611 | sudo service mediagoblin-paster restart |
618 | 612 | sudo service mediagoblin-celeryd restart |
diff --git a/docs/source/siteadmin/theming.rst b/docs/source/siteadmin/theming.rst
index 11ae387..a0ce126 100644
a
|
b
|
want to install this theme! Don't worry, it's fairly painless.
|
43 | 43 | 3. ``tar -xzvf <tar-archive>`` |
44 | 44 | |
45 | 45 | 4. Open your configuration file (probably named |
46 | | ``mediagoblin_local.ini``) and set the theme name:: |
| 46 | ``mediagoblin.ini``) and set the theme name:: |
47 | 47 | |
48 | 48 | [mediagoblin] |
49 | 49 | # ... |
… |
… |
Other variables you may consider setting:
|
104 | 104 | `theme_web_path` |
105 | 105 | When theme-specific assets are specified, this is where MediaGoblin |
106 | 106 | will set the urls. By default this is ``"/theme_static/"`` so in |
107 | | the case that your theme was trying to access its file |
| 107 | the case that your theme was trying to access its file |
108 | 108 | ``"images/shiny_button.png"`` MediaGoblin would link |
109 | 109 | to ``/theme_static/images/shiny_button.png``. |
110 | 110 | |
diff --git a/mediagoblin/plugins/piwigo/README.rst b/mediagoblin/plugins/piwigo/README.rst
index 0c71ffb..2d81666 100644
a
|
b
|
|
12 | 12 | It might even go away without any notice. |
13 | 13 | |
14 | 14 | Okay, so if you still want to test this plugin, |
15 | | add the following to your mediagoblin_local.ini: |
| 15 | add the following to your mediagoblin.ini: |
16 | 16 | |
17 | 17 | .. code-block:: ini |
18 | 18 | |
diff --git a/mediagoblin/plugins/trim_whitespace/README.rst b/mediagoblin/plugins/trim_whitespace/README.rst
index db9a0c5..e7947e3 100644
a
|
b
|
objects.
|
10 | 10 | |
11 | 11 | Simply enable this plugin by putting it somewhere where Python can reach |
12 | 12 | it and put it's path into the ``[plugins]`` section of your |
13 | | ``mediagoblin.ini`` or ``mediagoblin_local.ini`` like for example this: |
| 13 | ``mediagoblin.ini`` like for example this: |
14 | 14 | |
15 | 15 | .. code-block:: ini |
16 | 16 | |
… |
… |
other plugin writers.
|
27 | 27 | |
28 | 28 | It was originally conceived by Sebastian Spaeth. It is licensed under |
29 | 29 | the GNU AGPL v3 (or any later version) license. |
30 | | |