Configure MediaGoblin: Difference between revisions

From GNU MediaGoblin Wiki
Jump to navigation Jump to search
Line 64: Line 64:
=== Working example ===
=== Working example ===
<pre>
<pre>
[storage:publicstore]
##
storage_class = mediagoblin.storage:CloudFilesStorage
# BEGIN CloudFiles public storage
cloudfiles_user = user
##
cloudfiles_api_key = 1a2b3c4d5e6f7g8h9i
# Uncomment the following line and fill in your details to enable Cloud Files
cloudfiles_container = mediagoblin
# (or OpenStack Object Storage [Swift])
# -
publicstore_storage_class = mediagoblin.storage:CloudFilesStorage
publicstore_cloudfiles_user = user
publicstore_cloudfiles_api_key = 1a2b3c4d5e6f7g8h9i
publicstore_cloudfiles_container = mediagoblin


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


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



Revision as of 19:41, 11 September 2011

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.ini mediagoblin_local.ini

# edit paste_local.ini to know where mediagoblin_local.ini is
$ editor paste_local.ini

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

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

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

./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_local.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

These settings also work with OpenStack Object Storage (Swift), but you will need to set the API endpoint to avoid it defaulting to Rackspace Cloud Files US.

Setting it up

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

Working example

[storage:publicstore]
storage_class = mediagoblin.storage: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 betis free.
cloudfiles_use_servicenet = false

Options

publicstore_storage_class

Default: mediagoblin.storage:BasicFileStorage
This is used internally in mediagoblin to decide which kind the public_store storage object should be. (BasicFileStorage/CloudFilesStorage)

publicstore_cloudfiles_user

The user account that you use for authentication with the Cloud Files API.

publicstore_cloudfiles_api_key

The API key for the Cloud Files API

publicstore_cloudfiles_container

The container on your Cloud Files account in which the MediaGoblin public storage should be stored.

publicstore_cloudfiles_host

Default: Your current version of python-cloudfiles's Rackspace Cloud Files US host.
The API endpoint of the Cloud Files (Swift, OpenStack Object Storage) provider.

publicstore_cloudfiles_use_servicenet

Default: false
User the RackSpace internal network when transferring data between the MediaGoblin server and the Cloud Files provider. This only works when running MediaGoblin on Rackspace Cloud Servers.

Attachments

As of 6th of August `attachments` are not yet in mediagoblin master. Dev branch can be found at https://gitorious.org/~jwandborg/mediagoblin/jwandborgs-mediagoblin/commits/f482_media_attachments

Attachment are files that are associated to a media entry.

For example, it could be the GIMP .xcf file for the image. So that others can inspect the source of your work.

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 (or mediagoblin_local.ini)