of course that comes with great responsibility...
the site avenger scripts are configured by "app" files stored in the "config"
-directory (in $FEISTY_MEOW_SCRIPTS/scripts/site_avenger/config). the scripts
+directory (in $FEISTY_MEOW_SCRIPTS/site_avenger/config). the scripts
seek out a config file named after the application, e.g. they look for
"winterportlibrary.app" if the application name is "winterportlibrary".
the basic config file "default.app" is used for any application that is unknown
--- /dev/null
+
+# these variables are global for all sites.
+# you may want to override them in your specific site config file.
+
+SetEnv SSO_SANDBOX_USE_LOCAL 1
+
+SetEnv SSO_SERVER_LOCAL_URL "http://accounts.local"
+
+SetEnv SSO_UNIVERSAL_SECRET "jimmydodad"
+
+SetEnv SSO_SERVER_LOOKUP_BROKER 0
+
+SetEnv AVENGER_SANDBOX_MODE 1
+
+SetEnv AVENGER_AIRPLANE_MODE 0
+
+
echo "app dirname: The folder where the app will be stored."
echo "repository: The name of the git repository (short version, no URL)."
echo "theme name: The name to use for the cakephp theme."
-# echo "user name: The name of the user to chown the checkout to."
echo
exit 0
}
app_dirname="$1"; shift
repo_name="$1"; shift
theme_name="$1"; shift
-#user_name="$1"; shift
-
-#echo "*** user name is $user_name"
if [ "$app_dirname" == "-help" -o "$app_dirname" == "--help" ]; then
print_instructions
sep
-#if [ ! -z "$user_name" ]; then
-# echo "Chowning the apps folder to be owned by: $user_name"
-##hmmm: have to hope for now for standard group named after user
-# chown -R "$user_name:$user_name" "$BASE_APPLICATION_PATH"
-# test_or_die "Chowning $BASE_APPLICATION_PATH to be owned by $user_name"
-#fi
+# go with the default user running the script.
+user_name=$USER
+if [ ! -z "$user_name" -a "$user_name" != "root" ]; then
+ echo "Chowning the apps folder to be owned by: $user_name"
+#hmmm: have to hope for now for standard group named after user
+ chown -R "$user_name:$user_name" "$BASE_APPLICATION_PATH"
+ test_or_die "Chowning $BASE_APPLICATION_PATH to be owned by $user_name"
+
+else
+echo "user name failed checks for chowning, was '$user_name'"
+fi
sep
##############
+# new requirement is to get the sql root password, since we need to do some sql db configuration.
+echo -n "Please enter the MySQL root account password: "
+read mysql_passwd
+if [ -z "$mysql_passwd" ]; then
+ echo "This script must have the sql root password to proceed."
+ exit 1
+fi
+
+##############
+
echo "Regenerating feisty meow loading dock."
reconfigure_feisty_meow
rm -f /etc/apache2/sites-available/000-default.conf
test_or_die "removing old apache site"
- # copy in our new 000 version (which
- cp $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/default_page.001/* \
+ # copy in our new version of the default page.
+#hmmm: would be nice if this worked without mods for any new version, besides just 001. see apache env var file below for example implem.
+ cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/default_page.001/* \
/etc/apache2/sites-available
test_or_die "installing new apache default sites"
echo successfully patched the samba configuration to enable writes on user home directories. way cool.
fi
+##############
+
+# set up some crucial users in the mysql db that we seem to have missed previously.
+
+mysql -u root -p "$mysql_passwd" <<EOF
+ create user 'root'@'%' IDENTIFIED BY '$mysql_passwd';
+ grant all privileges on *.* TO 'root'@'%' with grant option;
+
+ create user 'wampcake'@'%' IDENTIFIED BY 'bakecamp';
+ grant all privileges on *.* TO 'wampcake'@'%' with grant option;
+
+ create user 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
+ grant all privileges on *.* TO 'lampcake'@'%' with grant option;
+EOF
+test_or_die "configuring root, wampcake and lampcake users on mysql"
+
+##############
+
+# add the latest version of the cakelampvm environment variables for apache.
+
+echo Setting up environment variables for apache2...
+
+# drop existing file, if already configured. ignore errors.
+a2disconf env_vars_cakelampvm
+
+# plug in the new version, just stomping anything there.
+# note: we only expect to have one version of the env_vars dir at a time in place in feisty...
+cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/env_vars.*/env_vars_cakelampvm.conf /etc/apache2/conf-available
+test_or_die "copying environment variables file into place"
+
+# enable the new version of the config file.
+a2enconf env_vars_cakelampvm
+test_or_die "enabling the new cakelampvm environment config for apache"
+
+echo Successfully configured the apache2 environment variables needed for cakelampvm.
+
##############
##############
sep
+# add the main website as specified by the domain name they gave us.
sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$DOMAIN_NAME"
test_or_die "Setting up apache site for: $APPLICATION_NAME"
+# make the shadow site also, which always ends in cakelampvm.com.
+shadow_domain="${APPLICATION_NAME}.cakelampvm.com"
+if [ "$shadow_domain" != "$DOMAIN_NAME" ]; then
+ sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$shadow_domain"
+ test_or_die "Setting up shadow apache site on '$shadow_domain'"
+fi
+
sep
#echo about to do powerup with: app="$APPLICATION_NAME" repo="$REPO_NAME" theme="$THEME_NAME"
sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$DOMAIN_NAME"
test_or_die "dropping apache site for: $DOMAIN_NAME"
+# drop the shadow site too.
+shadow_domain="${APPLICATION_NAME}.cakelampvm.com"
+if [ "$shadow_domain" != "$DOMAIN_NAME" ]; then
+ sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$shadow_domain"
+ test_or_die "dropping shadow apache site on '$shadow_domain'"
+fi
+
sep
#echo "!! domain being removed is: $DOMAIN_NAME"