Decouple 'uploaded/images' location from MEDIA_ROOT setting
Discarded
Updated 1 week ago
| Chris Lamb | Reviewers | ||
| reviewboard | |||
| None | Review Board SVN | ||
Adds 'UPLOADS_ROOT' configuration variable which decouples the 'uploaded/images' location from a being a suffix of MEDIA_ROOT. This allows the upload directory to be overridden in local_settings.py, allowing multiple instances of Review Board on a system to share a system-wide installation containing the htdocs and media directories (ie. in the context of distributor packages). For example, HTDOCS_ROOT and MEDIA_ROOT may point somewhere within /var/lib/ or /usr/share/, whilst a particular instance's UPLOAD_ROOT would point to (say) /srv/mysite.tld/uploads/ This change does not affect existing installations. This diff additionally modifies the "chown" call to use ":" (colon) as the USER:GROUP seperator over the deprecated "." (period).
Tested locally with my (draft) Debian packages.
Posted 3 months ago (August 19th, 2008, 6:46 p.m.)
This looks good. There's a little bit more I'd like to see before this goes in. I'd like to see an UPLOADS_URL as well so that if people have some custom path for all uploaded files, they can say where it is. This will be important down the road if we support, say, Amazon S3 as a destination for uploads. Also not sure if I'd prefer UPLOAD_* or UPLOADS_*. I almost like UPLOAD_* better but I'm okay with either.
-
/trunk/reviewboard/templates/admin/manual-updates/media-upload-dir.html (Diff revision 2) 6 Your Review Board installation does not have a {{MEDIA_ROOT}}/uploaded/images directory.6 Your Review Board installation does not have a {{UPLOAD_ROOT}}/images directory.7 {% endblocktrans %}7 {% endblocktrans %}8 </p>8 </p>9 <h3>{% trans "If this is a new installation..." %}</h3>
9 <h3>{% trans "If this is a new installation..." %}</h3>
10 <p>10 <p>11 {% blocktrans %}11 {% blocktrans %}12 Create both <tt>{{MEDIA_ROOT}}/uploaded</tt> and
12 Create both <tt>{{UPLOAD_ROOT}}</tt> and
13 <tt>{{MEDIA_ROOT}}/uploaded/images</tt> on the server and make both directories writable by the web
13 <tt>{{UPLOAD_ROOT}}/images</tt> on the server and make both directories writable by the web
14 server. You can do so with the following commands:
14 server. You can do so with the following commands:
15 {% endblocktrans %}15 {% endblocktrans %}16 </p>16 </p>17 <pre>17 <pre>18 $ cd {{MEDIA_ROOT}}18 $ mkdir -p {{UPLOAD_ROOT}}/images19 $ mkdir -p uploaded/images
19 $ sudo chown -R www-data:www-data {{UPLOAD_ROOT}} -
Should be UPLOADS_ROOT.