Permissions

This commit is contained in:
Bob Mottram 2016-12-24 22:14:27 +00:00
parent 8575817867
commit 3adc321f47
1 changed files with 17 additions and 4 deletions

View File

@ -122,7 +122,9 @@ function remove_user_mediagoblin {
function reconfigure_mediagoblin {
MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
rm -f /var/lib/mediagoblin/*.db
rm -rf $MEDIAGOBLIN_BASE_DIR/user_dev
rm -rf /var/lib/mediagoblin/media/*
rm -f $MEDIAGOBLIN_BASE_DIR/user_dev
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && ln -s /var/lib/mediagoblin user_dev" - mediagoblin
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && ./bin/gmg dbupdate" - mediagoblin
}
@ -130,6 +132,7 @@ function upgrade_mediagoblin {
MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && ./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate" - mediagoblin
mediagoblin_fix_email
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && ./bin/gmg dbupdate" - mediagoblin
echo "0"
}
@ -172,8 +175,9 @@ function restore_local_mediagoblin {
fi
rm -rf ${temp_restore_dir}
rm -rf ${temp_restore_dir}2
chown -hR mediagoblin:www-data /var/lib/mediagoblin
chown -hR mediagoblin:www-data $MEDIAGOBLIN_BASE_DIR
chown -hR mediagoblin:www-data /var/lib/mediagoblin
chmod -R g+wx /var/lib/mediagoblin
fi
}
@ -204,8 +208,9 @@ function restore_remote_mediagoblin {
fi
rm -rf /root/tempmediagoblin
rm -rf /root/tempmediagoblin2
chown -hR mediagoblin:www-data /var/lib/mediagoblin
chown -hR mediagoblin:www-data $MEDIAGOBLIN_BASE_DIR
chown -hR mediagoblin:www-data /var/lib/mediagoblin
chmod -R g+wx /var/lib/mediagoblin
fi
}
@ -257,9 +262,10 @@ function install_mediagoblin {
useradd -c "GNU MediaGoblin system account" -d /var/lib/mediagoblin -m -r -g www-data mediagoblin
usermod --append -G mediagoblin mediagoblin
mkdir -p /var/lib/mediagoblin
chown -hR mediagoblin:www-data /var/lib/mediagoblin
mkdir -p $MEDIAGOBLIN_BASE_DIR
chown -hR mediagoblin:www-data $MEDIAGOBLIN_BASE_DIR
chown -hR mediagoblin:www-data /var/lib/mediagoblin
chmod -R g+wx /var/lib/mediagoblin
su -c "cd $MEDIAGOBLIN_BASE_DIR && git clone $MEDIAGOBLIN_REPO $MEDIAGOBLIN_BASE_DIR/mediagoblin" - mediagoblin
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && git checkout $MEDIAGOBLIN_COMMIT -b $MEDIAGOBLIN_COMMIT" - mediagoblin
su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && git submodule sync" - mediagoblin
@ -465,6 +471,10 @@ function install_mediagoblin {
mediagoblin_fix_email
if [ -d /var/lib/mediagoblin/media ]; then
chmod -R +x /var/lib/mediagoblin/media
fi
function_check create_site_certificate
create_site_certificate $MEDIAGOBLIN_DOMAIN_NAME
@ -479,6 +489,9 @@ function install_mediagoblin {
function_check add_ddns_domain
add_ddns_domain $MEDIAGOBLIN_DOMAIN_NAME
chown -hR mediagoblin:www-data /var/lib/mediagoblin
chmod -R g+wx /var/lib/mediagoblin
APP_INSTALLED=1
}