allows scripts to be in top level of custom scripts folder now. also permission fixer script made official and used in different versions of user repermissioning.
@ALIAS_DEFINITION_FILES = ("$FEISTY_MEOW_SCRIPTS/core/common.alias");
# if custom aliases files exist, add them to the list.
+#hmmm: would be nice to have this name in a symbol somewhere instead of having "custom" or "customize" everywhere.
foreach $i (&glob_list("$FEISTY_MEOW_LOADING_DOCK/custom/*.alias")) {
if (-f $i) { push(@ALIAS_DEFINITION_FILES, $i); }
}
if (length($DEBUG_FEISTY_MEOW)) {
print "using these alias files:\n";
-print "HEY IS THIS PROBLEM CHILD?\n";
+#print "HEY IS THIS PROBLEM CHILD?\n";
foreach $i (@ALIAS_DEFINITION_FILES) {
local $base_of_dir = &basename(&dirname($i));
local $basename = &basename($i);
print " $base_of_dir/$basename\n";
}
-print "WAS PROBLEM CHILD ABOVE HERE?\n";
+#print "WAS PROBLEM CHILD ABOVE HERE?\n";
}
# write the aliases for sh and bash scripts.
# find the list of files in the scripts directory.
@shell_files = (find_files(recursive_find_directories("$FEISTY_MEOW_SCRIPTS")),
+ find_files("$FEISTY_MEOW_LOADING_DOCK/custom/scripts"),
find_files(recursive_find_directories("$FEISTY_MEOW_LOADING_DOCK/custom/scripts")));
# strip out the customization files, since they are added in on demand only.
|| $file =~ /\/\.\.$/
|| $file =~ /\/\.svn$/
|| $file =~ /\/\.git$/
- || $file =~ /\/custom\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_.]+$/
-#hmmm: would be nice to have this name in a symbol somewhere instead of having "customize" everywhere.
) {
# just skip this item; it's a special directory or a file we don't want to include.
-# print "skipping name: $file\n";
+ print "skipping name: $file\n";
} else {
&make_alias($file, "");
}
+++ /dev/null
-#!/bin/bash
-
-#source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
-# cleans up the ownership for all my files and dirs.
-function redeveloper()
-{
- # first build a list of dirs based on their location in /home/archives.
- local arch_builder="archons basement codebarn games imaginations musix pooling prewar_toaster stuffing toaster walrus"
- local ARCHIVE_HOME=/home/archives
- local dirname
- local arch_addin
- for dirname in $arch_builder; do
- arch_addin+="$ARCHIVE_HOME/$dirname "
- done
-#echo arch addin now is: $arch_addin
-
- # special case that makes our software hierarchy folder, if it doesn't exist.
- # everything else is only re-permed if it exists.
- if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
- sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
- test_or_die "making directory: $DEFAULT_FEISTYMEOW_ORG_DIR"
- fi
-
- # iterate across the list of dirs we want developer to own and change their ownership.
- for dirname in /home/developer $DEFAULT_FEISTYMEOW_ORG_DIR /usr/local/developer /home/games $arch_addin; do
- if [ -d "$dirname" ]; then
- echo "redeveloper on '$dirname'"
- sudo chown -R developer:developer "$dirname"
- test_or_die "chowning for developer: $dirname"
- fi
- done
-
- # special case for archives directory.
- if [ -d /z/stuffing -o -L /z/stuffing ]; then
- sudo chown developer:developer /z
- test_or_die "chowning /z for developer"
- sudo chmod g+rx,o+rx /z
- test_or_die "chmodding /z/ for developer"
- sudo chown developer:developer /z/stuffing
- test_or_die "chowning /z/stuffing for developer"
- sudo chmod g+rx,o-rwx /z/stuffing
- test_or_die "chmodding /z/stuffing for developer"
- pushd /z/stuffing &>/dev/null
- if [ -d archives -o -L archives ]; then
- sudo chown developer:developer archives
- test_or_die "chowning /z/stuffing/archives for developer"
- sudo chmod -R g+rwx archives
- test_or_die "chmodding /z/stuffing/archives for developer"
- fi
- popd &>/dev/null
- fi
-
- # make the logs readable by normal humans.
- sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
- test_or_die "setting normal perms on /var/log"
-}
-
-# this block should execute when the script is actually run, rather
-# than when it's just being sourced.
-if [[ $0 =~ .*redeveloper\.sh.* ]]; then
- THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"
- source "$THISDIR/../../core/launch_feisty_meow.sh"
- test_or_die "sourcing the feisty meow launcher"
- redeveloper
- test_or_die "redeveloperding process"
-fi
-
--- /dev/null
+#!/bin/bash
+
+function do_redeveloper()
+{
+ reapply_cool_permissions developer
+
+ # anything else specific to developer?
+}
+
+# this block should execute when the script is actually run, rather
+# than when it's just being sourced.
+if [[ $0 =~ .*redeveloper\.sh.* ]]; then
+ source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+ test_or_die "sourcing the feisty meow environment"
+ source "$FEISTY_MEOW_SCRIPTS/security/cool_permissionator.sh"
+ test_or_die "sourcing the permission script"
+ do_redeveloper
+ test_or_die "redevelopering process"
+fi
+
+++ /dev/null
-#!/bin/bash
-
-#source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
-# cleans up the ownership for all my files and dirs.
-function refred()
-{
- # first build a list of dirs based on their location in /home/archives.
- local arch_builder="archons basement codebarn games imaginations musix pooling prewar_toaster stuffing toaster walrus"
- local ARCHIVE_HOME=/home/archives
- local dirname
- local arch_addin
- for dirname in $arch_builder; do
- arch_addin+="$ARCHIVE_HOME/$dirname "
- done
-#echo arch addin now is: $arch_addin
-
- # special case that makes our software hierarchy folder, if it doesn't exist.
- # everything else is only re-permed if it exists.
- if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
- sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
- test_or_die "making directory: $DEFAULT_FEISTYMEOW_ORG_DIR"
- fi
-
- # iterate across the list of dirs we want fred to own and change their ownership.
- for dirname in /home/fred $DEFAULT_FEISTYMEOW_ORG_DIR /usr/local/fred /home/games $arch_addin; do
- if [ -d "$dirname" ]; then
- echo "refred on '$dirname'"
- sudo chown -R fred:fred "$dirname"
- test_or_die "chowning for fred: $dirname"
- fi
- done
-
- # special case for archives directory.
- if [ -d /z/stuffing -o -L /z/stuffing ]; then
- sudo chown fred:fred /z
- test_or_die "chowning /z for fred"
- sudo chmod g+rx,o+rx /z
- test_or_die "chmodding /z/ for fred"
- sudo chown fred:fred /z/stuffing
- test_or_die "chowning /z/stuffing for fred"
- sudo chmod g+rx,o-rwx /z/stuffing
- test_or_die "chmodding /z/stuffing for fred"
- pushd /z/stuffing &>/dev/null
- if [ -d archives -o -L archives ]; then
- sudo chown fred:fred archives
- test_or_die "chowning /z/stuffing/archives for fred"
- sudo chmod -R g+rwx archives
- test_or_die "chmodding /z/stuffing/archives for fred"
- fi
- popd &>/dev/null
- fi
-
- # make the logs readable by normal humans.
- sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
- test_or_die "setting normal perms on /var/log"
-}
-
-# this block should execute when the script is actually run, rather
-# than when it's just being sourced.
-if [[ $0 =~ .*refred\.sh.* ]]; then
- THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"
- source "$THISDIR/../../core/launch_feisty_meow.sh"
- test_or_die "sourcing the feisty meow launcher"
- refred
- test_or_die "refredding process"
-fi
-
--- /dev/null
+#!/bin/bash
+
+function do_refred()
+{
+ reapply_cool_permissions fred
+
+ # anything else specific to fred?
+}
+
+# this block should execute when the script is actually run, rather
+# than when it's just being sourced.
+if [[ $0 =~ .*refred\.sh.* ]]; then
+ source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+ test_or_die "sourcing the feisty meow environment"
+ source "$FEISTY_MEOW_SCRIPTS/security/cool_permissionator.sh"
+ test_or_die "sourcing the permission script"
+ do_refred
+ test_or_die "refredding process"
+fi
+
-this folder has some examples of how various people (or one person right now)
-do their custom scripts.
+customizations are cool
+=======================
-the folder can have alias files (ending in .alias) that are written in bash,
-and it can also have shell scripts that are sourced into the main-line of
-script initialization (any files ending in .sh).
+this folder has some examples of customizations that override the default
+feisty meow environment.
-when you have some custom scripts you want to use, copy them from your own
-folder to the $FEISTY_MEOW_LOADING_DOCK/custom directory.
+user customization folder organization
+======================================
+the user's optional custom folder is located at:
+echo $FEISTY_MEOW_SCRIPTS/customize/$(logname)
-(needs to talk about the scripts directory which is handled specially.
-are there any keyword matched filenames with special functions?)
+the top-level of the customization folder can store:
+
++ alias files (ending in .alias) that are written in bash; these are added
+ into the feisty meow environment as additional aliases.
+
++ sourceable bash scripts (ending in our bash extension of '.sh'); these
+ will be pulled into the main-line of the script initialization process
+ using the bash 'source' command. these scripts can change or add any
+ environment variables and aliases as needed, so be careful writing them.
+
+custom script aliases
+=====================
+
+there is also a facility for adding aliases automatically for any custom
+scripts that have been developed by the user. these join the other aliases
+provided by the feisty meow environment.
+
+store any custom scripts in the folder:
+$FEISTY_MEOW_SCRIPTS/customize/$(logname)/scripts
+
+any scripts in that folder (or in a directory under that folder) will
+automatically be turned into aliases.
--- /dev/null
+#!/bin/bash
+
+# a library file for redoing file ownership and permissions as we feel is
+# appropriate. this approach is a little bit specific to our way of doing
+# things, but it does handle a lot of important fixes everyone would want,
+# like making ~/.ssh really secure.
+
+# cleans up the ownership and permissions for all of the important files and dirs.
+function reapply_cool_permissions()
+{
+ local cooluser="$1"; shift
+
+ # first build a list of dirs based on their location in /home/archives.
+ local arch_builder="archons basement codebarn games imaginations musix pooling prewar_toaster stuffing toaster walrus"
+ local ARCHIVE_HOME=/home/archives
+ local dirname
+ local arch_addin
+ for dirname in $arch_builder; do
+ arch_addin+="$ARCHIVE_HOME/$dirname "
+ done
+#echo arch addin now is: $arch_addin
+
+ # special case that makes our software hierarchy folder, if it doesn't exist.
+ # everything else is only re-permed if it exists.
+ if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
+ sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
+ test_or_die "making directory: $DEFAULT_FEISTYMEOW_ORG_DIR"
+ fi
+
+ # fix some permissions for important security considerations.
+ harsh_perm $HOME/.ssh
+
+#hmmm: consider adding feisty meow apex to the list below.
+ # iterate across the list of dirs we want cooluser to own and change their ownership.
+ for dirname in $HOME $DEFAULT_FEISTYMEOW_ORG_DIR /usr/local/${cooluser} /home/games $arch_addin; do
+ if [ -d "$dirname" ]; then
+ echo "revising ownership on '$dirname'"
+ sudo chown -R ${cooluser}:${cooluser} "$dirname"
+ test_or_die "chowning for ${cooluser}: $dirname"
+ fi
+ done
+
+ # special case for archives directory.
+ if [ -d /z/stuffing -o -L /z/stuffing ]; then
+ sudo chown ${cooluser}:${cooluser} /z
+ test_or_die "chowning /z for ${cooluser}"
+ sudo chmod g+rx,o+rx /z
+ test_or_die "chmodding /z/ for ${cooluser}"
+ sudo chown ${cooluser}:${cooluser} /z/stuffing
+ test_or_die "chowning /z/stuffing for ${cooluser}"
+ sudo chmod g+rx,o-rwx /z/stuffing
+ test_or_die "chmodding /z/stuffing for ${cooluser}"
+ pushd /z/stuffing &>/dev/null
+ if [ -d archives -o -L archives ]; then
+ sudo chown ${cooluser}:${cooluser} archives
+ test_or_die "chowning /z/stuffing/archives for ${cooluser}"
+ sudo chmod -R g+rwx archives
+ test_or_die "chmodding /z/stuffing/archives for ${cooluser}"
+ fi
+ popd &>/dev/null
+ fi
+
+ # make the logs readable by normal humans.
+ sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
+ test_or_die "setting normal perms on /var/log"
+}
+
+# this block should execute when the script is actually run, rather
+# than when it's just being sourced.
+
+# this runs the cool permission applier on the current user.
+if [[ $0 =~ .*reapply_cool_permissions\.sh.* ]]; then
+ THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"
+ source "$THISDIR/../core/launch_feisty_meow.sh"
+ test_or_die "sourcing the feisty meow launcher"
+ reapply_cool_permissions $(logname)
+ test_or_die "reapplying cool permissions on $(logname)"
+fi
+
##############
# set up access on some important folders for the developer user.
-chown -R developer:developer /home/developer /home/developer/.[a-zA-Z0-9]*
-test_or_die "chown developer home"
+redeveloper
+test_or_die "running redeveloper to fix ownership"
+#chown -R developer:developer /home/developer /home/developer/.[a-zA-Z0-9]*
+#test_or_die "chown developer home"
harsh_perm /home/developer/.ssh
test_or_die "harsh_perm setting on developer .ssh"
chown -R developer:developer /etc/apache2 /etc/bind
# where we expect to find our checkout folder underneath.
full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
- cd $full_app_dir/$CHECKOUT_DIR_NAME
- pwd
+ pushd $full_app_dir/$CHECKOUT_DIR_NAME
+#redundant if pushd pwd
}