Configure MediaGoblin: Difference between revisions

From GNU MediaGoblin Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(29 intermediate revisions by 10 users not shown)
Line 17: Line 17:
# copy the config files
# copy the config files
$ cp paste.ini paste_local.ini
$ cp paste.ini paste_local.ini
$ cp mediagoblin.ini mediagoblin_local.ini
$ cp mediagoblin.example.ini mediagoblin.ini


lazyserver.sh defaults to using paste_local.ini if it is present; you can also specify a config file like this:
# edit paste_local.ini to know where mediagoblin_local.ini is
$ editor mediagoblin_local.ini
</pre>

Find the line marked "config =" under [app:mediagoblin]; change to:

<pre>
[app:mediagoblin]
use = egg:mediagoblin#app
filter-with = beaker
config = %(here)s/mediagoblin_local.ini
</pre>

If you want to use lazyserver.sh, you can run it like:


<pre>
<pre>
Line 41: Line 28:


<pre>
<pre>
./bin/gmg shell -cf mediagoblin_local.ini
./bin/gmg shell -cf mediagoblin.ini
</pre>
</pre>


Line 53: Line 40:


for more info.
for more info.

= Setting up Cloud Files public storage =

In mediagoblin.ini, add this to the file and edit it to fit your needs.

<pre>
[storage:publicstore]
storage_class = mediagoblin.storage.cloudfiles:CloudFilesStorage
cloudfiles_user = user
cloudfiles_api_key = 1a2b3c4d5e6f7g8h9i
cloudfiles_container = mediagoblin

# Uncomment this and fill it in to set the API endpoint to anything other
# than Rackspace Cloud Files US
# cloudfiles_host = https://example.org/v1.0

# Only applicable if you run MediaGoblin on a Rackspace Cloud Server
# it routes traffic through the internal Rackspace network, this
# means that the bandwith is free.
cloudfiles_use_servicenet = false
</pre>

To make these settings work with OpenStack Object Storage (Swift) you will need to set the API endpoint (<code>cloudfiles_host</code>) to avoid it defaulting to Rackspace Cloud Files US.

*NOTE: cloudfiles_host does not appear to be honored by the cloudfiles plugin of MediaGoblin 0.9.0. It also specifically depends on the Rackspace CDN or at least the CDN endpoint headers returned by Swift. If you wish to use your own Swift cluster and serve the files out of Swift directly, or configure your own CDN endpoint, you'll need to modify this plugin or create a new/derived storage plugin.

= Attachments =

Attachment are arbitrary files that are associated to a media entry.

For example, it could be the GIMP .xcf file for an image, the .blend of a Blender render.

== Hazards ==

Attachments are not filtered or scanned and therefore present a security risk. They can be used to perform XSS attacks or to upload malicious content. Make sure your environment is safe before enabling it.

== Allow attachments ==

To allow attachments, add

allow_attachments = true

to your mediagoblin.ini

= Disable transcoding =

Transcoding means that your video is resized or converted to another format, which usually takes a lot of time and CPU power.

Currently transcoding is disabled for a video only if its mime-type, container, video and audio formats are all explicitly excluded at once in the configuration.

Add this section to your <code>mediagoblin.ini</code> video plugin config to disable transcoding of WebM and Ogg/Theora videos:

<pre>
[plugins]
[[mediagoblin.media_types.video]]
[[[skip_transcode]]]
mime_types = video/webm, video/ogg, application/ogg, application/x-annodex
container_formats = Matroska, Ogg
video_codecs = VP8 video, Theora
audio_codecs = Vorbis,
dimensions_match = false
</pre>

Or to support most of the major formats supported by browsers:
<pre>
[[[skip_transcode]]]
mime_types = video/webm, video/ogg, video/mp4, audio/ogg, application/ogg, application/x-annodex
container_formats = Matroska, Ogg, ISO MP4/M4A
video_codecs = VP8 video, VP9 video, Theora, H.264, H.264 / AVC, MPEG-4 video
audio_codecs = Vorbis, MPEG-4 AAC audio
dimensions_match = false
</pre>

Latest revision as of 03:51, 11 May 2020

The config files

So basically there are two config files (and one meta-config file).

  • mediagoblin.ini: Use this to configure MediaGoblin, the application. Want to use a different storage system? Configure it here!
  • paste.ini: This just actually configures the web server that launches the MediaGoblin application, and some other things (like actually sets up the applications that serve your static files).

And then there's the meta-config file:

  • mediagoblin/config_spec.ini: This sets the defaults for config file options and the type conversion for things in mediagoblin.ini. Developers who add new config options should probably register them and their types here (and set some good defaults, if applicable).

Changing config files

So you want to turn on (or off) all the bells and whistles, set up mediagoblin to use a storage system running out of a distributed cluster of Commodore 64s, change your email server configuration, etc. Where do you set all this stuff up?

You should do the following:

# copy the config files
$ cp paste.ini paste_local.ini
$ cp mediagoblin.example.ini mediagoblin.ini

lazyserver.sh defaults to using paste_local.ini if it is present; you can also specify a config file like this:

<pre>
./lazyserver.sh -c paste_local.ini

Also, all the ./bin/gmg commands have arguments to allow you to pass in the config file. For example:

./bin/gmg shell -cf mediagoblin.ini

(It's important to note that the ./bin/gmg commands don't care about the paster file, they just care about the mediagoblin config file.)

BTW, all these ./bin/gmg subcommands have help. You can check them like:

./bin/gmg shell --help

for more info.

Setting up Cloud Files public storage

In mediagoblin.ini, add this to the file and edit it to fit your needs.

[storage:publicstore]
storage_class = mediagoblin.storage.cloudfiles:CloudFilesStorage
cloudfiles_user = user
cloudfiles_api_key = 1a2b3c4d5e6f7g8h9i
cloudfiles_container = mediagoblin

# Uncomment this and fill it in to set the API endpoint to anything other
# than Rackspace Cloud Files US
# cloudfiles_host = https://example.org/v1.0 

# Only applicable if you run MediaGoblin on a Rackspace Cloud Server
# it routes traffic through the internal Rackspace network, this
# means that the bandwith is free.
cloudfiles_use_servicenet = false

To make these settings work with OpenStack Object Storage (Swift) you will need to set the API endpoint (cloudfiles_host) to avoid it defaulting to Rackspace Cloud Files US.

  • NOTE: cloudfiles_host does not appear to be honored by the cloudfiles plugin of MediaGoblin 0.9.0. It also specifically depends on the Rackspace CDN or at least the CDN endpoint headers returned by Swift. If you wish to use your own Swift cluster and serve the files out of Swift directly, or configure your own CDN endpoint, you'll need to modify this plugin or create a new/derived storage plugin.

Attachments

Attachment are arbitrary files that are associated to a media entry.

For example, it could be the GIMP .xcf file for an image, the .blend of a Blender render.

Hazards

Attachments are not filtered or scanned and therefore present a security risk. They can be used to perform XSS attacks or to upload malicious content. Make sure your environment is safe before enabling it.

Allow attachments

To allow attachments, add

 allow_attachments = true

to your mediagoblin.ini

Disable transcoding

Transcoding means that your video is resized or converted to another format, which usually takes a lot of time and CPU power.

Currently transcoding is disabled for a video only if its mime-type, container, video and audio formats are all explicitly excluded at once in the configuration.

Add this section to your mediagoblin.ini video plugin config to disable transcoding of WebM and Ogg/Theora videos:

[plugins]
[[mediagoblin.media_types.video]]
[[[skip_transcode]]]
mime_types = video/webm, video/ogg, application/ogg, application/x-annodex
container_formats = Matroska, Ogg
video_codecs = VP8 video, Theora
audio_codecs = Vorbis,
dimensions_match = false

Or to support most of the major formats supported by browsers:

[[[skip_transcode]]]
mime_types = video/webm, video/ogg, video/mp4, audio/ogg, application/ogg, application/x-annodex
container_formats = Matroska, Ogg, ISO MP4/M4A 
video_codecs = VP8 video, VP9 video, Theora, H.264, H.264 / AVC, MPEG-4 video
audio_codecs = Vorbis, MPEG-4 AAC audio
dimensions_match = false