Opened 10 years ago

Closed 10 years ago

#942 closed defect (fixed)

Think about changing default location of variable and user-uploaded content

Reported by: Simon Fondrie-Teitler Owned by:
Priority: major Milestone:
Component: programming Keywords:
Cc: Parent Tickets:

Description

Currently it is relative to paste.ini:
https://gitorious.org/mediagoblin/mediagoblin/source/3b104bbcefca052eb3814f015521b47d2fcbc0da:paste.ini#L47

This means that if paste.ini is moved into /etc/ or another location more suited for config files, the variable and user-uploaded content gets put in a bad place.

I'm planning on changing this to /var/lib/mediagoblin/ for the Debian package, but I don't think this is a good default for someone running mediagoblin in a virtualenv (it might be fine though, I don't have enough virtualenv experience).

Change History (4)

comment:1 by Christopher Allan Webber, 10 years ago

So, in the Glorious Future, probably 0.8.0, there won't be a mediagoblin.ini... there will be a mediagoblin.example.ini, and you'll copy that over (or MediaGoblin will do it for you) to wherever you want to run MediaGoblin from. You can set where the mediagoblin config is from the paste config that mediagoblin is ultimately run from, so in a debian package, you should never use the one that's sitting in mediagoblin's code directory anyway. We aren't clear on this in the docs though! My bad. In the ancient interest of getting development up and easy, we never got deployment and system packaging easy or clear.

Nonetheless, you have to change way too many config options, so I've added a branch for this: https://gitorious.org/mediagoblin/cwebbers-mediagoblin/commits/data_basedir

What this does is it supplies a variable you can put in mediagoblin.ini like so:

[DEFAULT]
data_basedir = /var/lib/mediagoblin/

Bam. Everything is now correctly set up to put files in the right place. (Well, except the database config that is... you'll have to correct that yourself if you don't want sqlite.)

Elrond has pointed out some issues though:

<Elrond> paroneayea - You have a bit of trailing whitespace in your branch. ;)
<Elrond> (git log -p marks them with red ;) )
<Elrond> paroneayea - Could you do me a favor and rename one config_spec  to
         config_spec_path?
<Elrond> +    config_spec = ConfigObj(
<Elrond> +        config_spec,
<Elrond> paroneayea - I'd move the "+    # temporary bootstrap, just setup
         here and __file__... we'll do this again","+
         _setup_defaults(config, config_path)"  a bit more up, straight after
         the PRE-READ.
<Elrond> paroneayea - mainconfig_defaults.update(config.get('DEFAULT', {})):
         You don't need .get('DEFAULT', {}), because the previsous
         _setup_defaults makes sure, that ["DEFAULTS"] will work always.
<Elrond>      plugins = config.get("plugins", {}).keys()
<Elrond>      plugin_configs = {}
<Elrond> paroneayea - Please move those two lines closer to the loop around
         the plugins.
<Elrond> paroneayea - Okay, could you add a commented out version of
         "[DEFAULT] data_basedir =" to mediagoblin.ini, so that people know,
         what to set?

Once those are resolved, I think we can merge this, and that indirectly fixes simonft's issue above. This would be awesome to have for 0.7.0 if it landed just in time.

I think Jessica is going to handle this now (Jess, please claim it if true).

comment:2 by Jessica Tallon, 10 years ago

Owner: set to Jessica Tallon
Status: newin_progress

comment:3 by Jessica Tallon, 10 years ago

This has been done. I have fixed the changes Elrond brought up. I have also documented the setting in configuration documentation including instructions to change the webserver settings if you change the data_basedir option.

You can find it on 942-default-location branch.

comment:4 by Jessica Tallon, 10 years ago

Owner: Jessica Tallon removed
Resolution: fixed
Status: in_progressclosed

This has been merged as of ffa9346. You can now change the setting in mediagoblin.ini and paste.ini and these changes are reflected. There is documentation to cover this change including changing the webserver settings.

Note: See TracTickets for help on using tickets.