Merge branch 'dev' of feistymeow.org:feisty_meow into dev
authorChris Koeritz <fred@gruntose.com>
Mon, 20 Nov 2017 21:59:23 +0000 (21:59 +0000)
committerChris Koeritz <fred@gruntose.com>
Mon, 20 Nov 2017 21:59:23 +0000 (21:59 +0000)
nucleus/tools/clam_tools/write_build_config.cpp
production/feisty_meow_config.ini
production/sites/cakelampvm.com/.gitignore [new file with mode: 0644]
production/sites/cakelampvm.com/hello.txt
production/sites/cakelampvm.com/rolling/default_page.001/001-default-http.conf [new file with mode: 0644]
production/sites/cakelampvm.com/rolling/default_page.001/001-default-ssl.conf [new file with mode: 0644]
scripts/clam/cpp/variables.def
scripts/rev_control/version_control.sh
scripts/site_avenger/clean_mapsdemo.sh [new file with mode: 0644]
scripts/site_avenger/revamp_cakelampvm.sh
scripts/system/common_sysadmin.sh

index 4afed778ac91223bc51ba5b1d1047a20bda871d4..b8bfd80c1ee8c8d647c0a3ffb16067fdf741bbca 100644 (file)
@@ -245,8 +245,8 @@ int write_build_config::execute()
   // find our storage area for the build headers.  we know a couple build
   // configurations by now, but this should really be coming out of a config
   // file instead.
-  astring library_directory = repodir + "/nucleus/library";
-  if (!filename(library_directory).good()) {
+  astring genstore_directory = environment::get("FEISTY_MEOW_GENERATED_STORE");
+  if (!filename(genstore_directory).good()) {
     non_continuable_error(static_class_name(), func,
         astring("failed to locate the library folder storing the generated files."));
   }
@@ -254,10 +254,8 @@ int write_build_config::execute()
   // these are very specific paths, but they really are where we expect to
   // see the headers.
 
-  astring cfg_header_filename = library_directory + "/"
-      "__build_configuration.h";
-  astring ver_header_filename = library_directory + "/"
-      "__build_version.h";
+  astring cfg_header_filename = genstore_directory + "/__build_configuration.h";
+  astring ver_header_filename = genstore_directory + "/__build_version.h";
 
   // open the ini file for reading.
   byte_filer ini(fname, "r");
@@ -380,6 +378,17 @@ int write_build_config::execute()
     LOG(astring("failed writing output file ") + ver_header_filename);
   }
 
+  // now make a copy into the library folder, for when we release a production version.
+  astring library_directory = repodir + "/nucleus/library";
+  astring cfg_header_copy = library_directory + "/__build_configuration.h";
+  astring ver_header_copy = library_directory + "/__build_version.h";
+  if (!write_output_file(cfg_header_copy, cfg_accumulator)) {
+    LOG(astring("skipping copy due to read-only issue on output file: ") + cfg_header_copy);
+  }
+  if (!write_output_file(ver_header_copy, ver_accumulator)) {
+    LOG(astring("skipping copy due to read-only issue on output file: ") + ver_header_copy);
+  }
+
   return 0;
 }
 
index 7abba84985ba34a03701cc1c71eb7d042579530e..e11b6d7ad89897ba76afb90265bdc1be559811bd 100644 (file)
@@ -3,7 +3,7 @@
 # specifies the version of the code that is being constructed here.
 major=2
 minor=140
-revision=100
+revision=102
 build=420
 
 # specifies the remainder of the version record info.
diff --git a/production/sites/cakelampvm.com/.gitignore b/production/sites/cakelampvm.com/.gitignore
new file mode 100644 (file)
index 0000000..114c763
--- /dev/null
@@ -0,0 +1 @@
+google*.html
index 7bf0d1b8669d4ffa78d2b9c93a7d0e30caf1c2fc..f430c4fb30e2cae13ac8a78abb50b6282db17925 100644 (file)
@@ -1,25 +1,2 @@
 Welcome to the CakePHP LAMP VM.
-
-Please refer to the built-in documentation available at: http://cakelampvm.com
-
-Some first steps to make this vm your own:
-
-####
-
-1) change your password for the developer account.
-(may eventually be automatically required)
-
-####
-
-2) change your git configuration for user and email.  this is how we've
-configured it so far:
-
-  # git config --global user.email "developer@cakelampvm.com"
-  # git config --global user.name "Developer J. Cakemo"
-
-if you're developing on a real project, you probably don't want the bogus
-email and even more bogus name above attached to your commits.
-Just run the two commands again but with proper values.
-
-####
-
+Documentation is available at: http://cakelampvm.com
diff --git a/production/sites/cakelampvm.com/rolling/default_page.001/001-default-http.conf b/production/sites/cakelampvm.com/rolling/default_page.001/001-default-http.conf
new file mode 100644 (file)
index 0000000..1360081
--- /dev/null
@@ -0,0 +1,21 @@
+
+
+<Directory "/opt/feistymeow.org/feisty_meow/production/sites/cakelampvm.com">
+  Options +ExecCGI +Indexes +FollowSymLinks +Includes +MultiViews
+  Require all granted
+</Directory>
+
+
+<VirtualHost *:80>
+       ServerName cakelampvm.com
+       ServerAlias www.cakelampvm.com
+       DocumentRoot /opt/feistymeow.org/feisty_meow/production/sites/cakelampvm.com
+       DirectoryIndex vm_index.html
+
+       ServerAdmin developer@localhost
+
+       ErrorLog ${APACHE_LOG_DIR}/error.log
+       CustomLog ${APACHE_LOG_DIR}/access.log combined
+
+</VirtualHost>
+
diff --git a/production/sites/cakelampvm.com/rolling/default_page.001/001-default-ssl.conf b/production/sites/cakelampvm.com/rolling/default_page.001/001-default-ssl.conf
new file mode 100644 (file)
index 0000000..c89b459
--- /dev/null
@@ -0,0 +1,37 @@
+
+
+<Directory "/opt/feistymeow.org/feisty_meow/production/sites/cakelampvm.com">
+  Options +ExecCGI +Indexes +FollowSymLinks +Includes +MultiViews
+  Require all granted
+</Directory>
+
+<VirtualHost *:443>
+       ServerName cakelampvm.com
+       ServerAlias www.cakelampvm.com
+       DocumentRoot /opt/feistymeow.org/feisty_meow/production/sites/cakelampvm.com
+       DirectoryIndex vm_index.html
+
+       ServerAdmin developer@localhost
+
+       ErrorLog ${APACHE_LOG_DIR}/error.log
+       CustomLog ${APACHE_LOG_DIR}/access.log combined
+
+       SSLEngine on
+
+       #   A self-signed (snakeoil) certificate can be created by installing
+       #   the ssl-cert package. See
+       #   /usr/share/doc/apache2/README.Debian.gz for more info.
+       #   If both key and certificate are stored in the same file, only the
+       #   SSLCertificateFile directive is needed.
+       SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
+       SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
+
+       <FilesMatch "\.(cgi|shtml|phtml|php)$">
+                       SSLOptions +StdEnvVars
+       </FilesMatch>
+       <Directory /usr/lib/cgi-bin>
+                       SSLOptions +StdEnvVars
+       </Directory>
+
+</VirtualHost>
+
index 60fcc7bc6bd43b30784cc53eddbabfd5e367f638..bcf70032cbce858f142a5ee62cdcae88c728ad05 100644 (file)
@@ -228,7 +228,8 @@ export DYNAMIC_LIBRARY_DIR = $(TARGETS_STORE)
 export STATIC_LIBRARY_DIR = $(TARGETS_STORE)
 
 # "HEADER_SEARCH_PATH" is where the class interface files are to be found.
-#HEADER_SEARCH_PATH =
+# we add the generated store folder for the build version file.
+HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)
 
 # "HOOPLE_HEADERS" are locations where the HOOPLE headers can be found.
 ifeq "$(HOOPLE_HEADERS)" ""
index 75f344cf66ab8485f0e8b980f6b83c8eef924859..d74fe1bd67c43c713249809e0bcbf0a991cb4b0a 100644 (file)
@@ -64,7 +64,7 @@ function do_checkin()
   if [ $nicedir == "." ]; then
     nicedir=$(\pwd)
   fi
-  local blatt="echo checking in '$nicedir'..."
+  local blatt="echo -n checking in '$nicedir'...  "
 
   do_update "$directory"
   test_or_die "repository update--this should be fixed before check-in."
diff --git a/scripts/site_avenger/clean_mapsdemo.sh b/scripts/site_avenger/clean_mapsdemo.sh
new file mode 100644 (file)
index 0000000..5054cdd
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# some code i wrote to add to revamp that turned out to be unsuitable.
+# but it corrects a problem in cakelampvm v002 release that i find annoying,
+# so here it is as its own file.
+
+# clean out some old files that were not checked in in mapsdemo.
+echo Doing some git repository maintenance in fred account.
+#
+# change over to fred folder
+pushd /home/fred
+test_or_die "changing dir to fred's home; what have you done with fred?"
+
+pushd apps/mapsdemo/avenger5
+test_or_die "changing dir to mapsdemo app"
+
+rpuffer . &>/dev/null
+if [ $? -ne 0 ]; then
+  # it seems our old files are still conflicting this.
+  if [ -f config/config_google.php ]; then
+    \rm -f config/config_google.php
+    test_or_die "removing old config for google"
+  fi
+  if [ -f config/app.php ]; then
+    \rm -f config/app.php
+    test_or_die "removing old config for app"
+  fi
+
+  git reset --hard HEAD
+  test_or_die "resetting git's hard head"
+
+  rpuffer .
+#hmmm: use output saver thing when that exists.
+  test_or_die "puffing out mapsdemo app after inadequate corrective action was taken"
+fi
+
+popd
+
+popd
+#...coolness, if we got to here.
+
+
index d024cd10922782e072c9570d7dbb535fc4e66a77..d966b69f558bae3ebb2194ce54097eb8dbd178df 100644 (file)
@@ -16,9 +16,21 @@ export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
 
 export NO_HELLO=right
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
 
 ##############
 
+echo "Regenerating feisty meow loading dock."
+
+reconfigure_feisty_meow
+test_or_die "feisty meow reconfiguration"
+chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
+test_or_die "fix after reconfigured as sudo"
+
+##############
+
+echo "Making some important permission changes..."
+
 # fix up the main web storage.
 chown -R www-data:www-data /var/www 
 test_or_die "chown www-data"
@@ -28,7 +40,7 @@ test_or_die "group_perm www-data"
 ##############
 
 # set up access on some important folders for the developer user.
-chown -R developer:developer /home/developer
+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"
@@ -40,8 +52,10 @@ test_or_die "group perms on apache2 and bind"
 ##############
 
 # fix perms for fred user.
-chown -R fred:fred /home/fred /home/archives/stuffing 
+chown -R fred:fred /home/fred /home/archives/stuffing /home/fred/.[a-zA-Z0-9]*
 test_or_die "chown fred home"
+group_perm $HOME/apps
+test_or_die "group perms on fred's apps"
 harsh_perm /home/fred/.ssh
 test_or_die "harsh_perm setting on fred .ssh"
 chown -R fred:fred /opt/feistymeow.org 
@@ -49,6 +63,8 @@ test_or_die "chown feisty meow to fred"
 group_perm /opt/feistymeow.org 
 test_or_die "group perms on feisty meow"
 
+echo "Done with important permission changes."
+
 ##############
 #
 # some slightly tricky bits start here.  we want to massage the vm into the
@@ -56,6 +72,8 @@ test_or_die "group perms on feisty meow"
 #
 ##############
 
+echo "Updating developer welcome file."
+
 # only update hello if they've still got the file there.  we don't want to
 # keep forcing our hellos at people.
 if [ -f "$HOME/hello.txt" ]; then
@@ -68,29 +86,66 @@ fi
 
 # install a better editor app.
 
-echo "
-The script is about to install the bluefish editor and some dependencies.
+echo "The script is about to install the bluefish editor and some dependencies.
 If the app is not already installed, then this process takes only about a
-minute on a slower home DSL internet connection...
-
-"
+minute on a slower home DSL internet connection..."
 
 apt-get install -y bluefish &> "/tmp/install_bluefish-$(logname).log"
-test_or_continue "failed to install bluefish editor.  not good."
+test_or_continue "installing bluefish editor"
 
 ##############
 
+# deploy any site updates here to the VM's cakelampvm.com site.
+#
+# we want to upgrade the default apache site to the latest, since the new
+# version mirrors the one on the internet (but with green checks instead
+# of red X's) and since we also support https on the new default version.
+# we can do this again later if needed, by upping the numbers on the apache
+# site config files.  our original site was 000 and the new version is 001,
+# which we've done as a prefix on the config for some reason.  makes the
+# code below easy at least.
+if [ -L /etc/apache2/sites-enabled/000-default.conf ]; then
+  # the old site is in place still, so let's update that.
+  echo "Updating default web sites to latest version."
+
+  a2enmod ssl
+  test_or_die "enabling SSL for secure websites"
+
+  restart_apache
+  test_or_die "getting SSL loaded in apache"
+
+  a2dissite 000-default
+  test_or_die "disabling old apache site"
+
+  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/* \
+      /etc/apache2/sites-available
+  test_or_die "installing new apache default sites"
+
+  # there should only be ours at this version level and with that prefix.
+  a2ensite 001-*
+  test_or_die "enabling new apache default sites"
+
+  restart_apache
+fi
 
-#hmmm: todo
-# deploy the site updater here to fix the local cakelampvm.com site...
-
+##############
 
 ##############
 
 # sequel--tell them they're great and show the hello again also.
 
-regenerate
+echo "
+
 
+"
+regenerate
+test_or_die "regenerating feisty meow scripts"
+chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
+test_or_die "fix after regenerate as sudo"
 echo "
 
 
index 223067f6ce7443b56f2fc929c94613ec55773910..4ab80ed3716e6092650b5e8b8b6c30763a9d9869 100644 (file)
@@ -181,7 +181,7 @@ function restart_bind()
     echo "The bind service did not restart properly.  Please check the error logs."
     exit 1
   fi
-  echo DNS server restarted.
+  echo DNS service restarted.
 }
 
 ############################################################################
@@ -317,6 +317,7 @@ function restart_apache()
     echo "Please consult the apache error logs for more details."
     exit 1
   fi
+  echo Apache2 service restarted.
 }
 
 # sets up the serverpilot storage location for a user hosted web site.