X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcustomize%2Ffred%2Fscripts%2Fcakelampvm%2Frevamp_web_permissions.sh;h=837cf3c7477294525beba78c5f32e63267f1faf1;hb=3edc98168f6cfbe234a430fb283eb928877f1397;hp=af9693f076f5653eb20f824797a44ff3049d5f52;hpb=7b39f7e279005c8466ef508220a532ce2aa4abf8;p=feisty_meow.git diff --git a/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh b/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh old mode 100755 new mode 100644 index af9693f0..837cf3c7 --- a/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh +++ b/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh @@ -1,21 +1,42 @@ +#!/bin/bash -# change the owner for the web roots to the apache user, www-data. -sudo chown -R www-data:www-data /var/www +# fixes the cakelampvm permissions according to the way. -# make sure we have the appropriate access on a few key folders. -sudo chmod u+rwx,g+rx /var/www +############## -# put a couple specific ownerships into play so the appropriate user has full access. -sudo chown -R developer:developer /var/www/defaultcake.cakelampvm.com -sudo chown -R fred:fred /var/www/webwork.repository -## add others here for your own projects. +if [[ $EUID != 0 ]]; then + echo "This script must be run as root or sudo." + exit 1 +fi -# these directories will be given group permissons that enable web server access. -DIR_LIST="/var/www/defaultcake.cakelampvm.com /var/www/webwork.repository" +############## -# add in group permissions to allow the web server to serve the pages properly. -for currdir in $DIR_LIST; do - sudo find $currdir -type d -exec chmod -R u+rwx,g+rwx,o-rwx {} ';' - sudo find $currdir -type f -exec chmod -R u+rw,g+rw,o-rwx {} ';' -done +export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. +export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../../../../.." && \pwd )" + +source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh" + +############## + +# fix up the main web storage. +chown -R www-data:www-data /var/www +group_perm /var/www + +############## + +# set up access on some important folders for the developer user. +chown -R developer:developer /home/developer /opt/feistymeow.org /etc/apache2 /etc/bind +normal_perm /opt/feistymeow.org +# don't want others trying to check feisty meow in. +harsh_perm /opt/feistymeow.org/feisty_meow/.git +harsh_perm /home/developer/.ssh +group_perm /etc/apache2 /etc/bind + +############## + +# fix perms for fred user. +chown -R fred:fred /home/fred /home/archives/stuffing +harsh_perm /home/fred/.ssh + +##############