Compare commits
20 Commits
5306cb78d3
...
2.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a8845d898 | |||
| 65be246673 | |||
| eabf56ed93 | |||
| d55b13ecbf | |||
| cc8a7710a1 | |||
| ad83090b05 | |||
| 684c237ac1 | |||
| 23c0090a47 | |||
| e57ec6de50 | |||
| c790dd6736 | |||
| 6e3666cea2 | |||
| 7379df38de | |||
| 2a915fec69 | |||
| fa0e9907ee | |||
| 2c3b5056ae | |||
| f5e0c39458 | |||
| 645093da36 | |||
| f57583b1a9 | |||
| 51b2ebf8e6 | |||
| 5a6d91296d |
@@ -25,7 +25,7 @@ cd www
|
|||||||
|
|
||||||
Then in a web browser, navigate to `localhost:8080`.
|
Then in a web browser, navigate to `localhost:8080`.
|
||||||
|
|
||||||
## TODO
|
## TODO Items
|
||||||
|
|
||||||
All goals are currently completed.
|
All goals are currently completed.
|
||||||
|
|
||||||
|
|||||||
62
cronjob.sh
62
cronjob.sh
@@ -4,23 +4,63 @@
|
|||||||
# project so that docker container can do periodic git pulls rather than having
|
# project so that docker container can do periodic git pulls rather than having
|
||||||
# to reload /rebuild the container each time a release is pushed out.
|
# to reload /rebuild the container each time a release is pushed out.
|
||||||
|
|
||||||
|
## Setup ##
|
||||||
|
|
||||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
echo "$DIR/$PROG"
|
|
||||||
|
|
||||||
echo "*** Running cronjob @ `date` ***"
|
|
||||||
cd $DIR
|
cd $DIR
|
||||||
|
DIR="`pwd`"
|
||||||
|
NAME="'$PROG'"
|
||||||
|
|
||||||
|
function log {
|
||||||
|
echo -e "`date` : $NAME - $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function kill-project {
|
||||||
|
# Kill node.js which will complete run.sh and restart any Docker containers.
|
||||||
|
# This is more intended towards Development and Stage sites since Production
|
||||||
|
# will only see git changes when a pull request is manually completed.
|
||||||
|
log "Stopping continuous processes!"
|
||||||
|
pkill node
|
||||||
|
}
|
||||||
|
|
||||||
|
function reload-project {
|
||||||
|
# Nothing to do, run.sh and main.js automatically uses the latest files.
|
||||||
|
log "Project reloaded successfully!"
|
||||||
|
}
|
||||||
|
|
||||||
|
## Main ##
|
||||||
|
|
||||||
# Pull any updates, and if the project is already up to date, exit successfully.
|
# Pull any updates, and if the project is already up to date, exit successfully.
|
||||||
git pull | grep -v "up to date"
|
output="`git pull`"
|
||||||
status="$?"
|
git_status="$?"
|
||||||
echo "* Pull status is '$status'."
|
|
||||||
if [[ $status != 0 ]]; then
|
echo "$output" | grep -v "up to date"
|
||||||
echo "* Site is already up to date, exiting."
|
grep_status="$?"
|
||||||
exit 0
|
|
||||||
|
log "Pull status is '$git_status', checking for changes is '$grep_status'."
|
||||||
|
|
||||||
|
# Check whether the continuously running jobs have been updated.
|
||||||
|
echo "$output" | grep "main.js"
|
||||||
|
main_changed="$?"
|
||||||
|
echo "$output" | grep "run.sh"
|
||||||
|
run_changed="$?"
|
||||||
|
|
||||||
|
# Determine where we've landed and whether we need to do anything.
|
||||||
|
if [[ $git_status != 0 ]]; then
|
||||||
|
log "*** ERROR: Git reported a failure! ***"
|
||||||
|
exit 1
|
||||||
|
elif [[ $git_status == 0 && ($main_changed == 0 || $run_changed == 0) ]]; then
|
||||||
|
log "Either main ('$main_changed'), or run ('$run_changed') were changed!"
|
||||||
|
kill-project
|
||||||
|
elif [[ $git_status == 0 && $grep_status == 0 ]]; then
|
||||||
|
reload-project
|
||||||
|
elif [[ $git_status == 0 && $grep_status != 0 ]]; then
|
||||||
|
log "Nothing to do. '$output'"
|
||||||
else
|
else
|
||||||
# Kill node.js which will complete run.sh and restart any Docker containers.
|
log "*** WARNING: Unknown Situation ***"
|
||||||
pkill node
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Success! ##
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -58,13 +58,28 @@
|
|||||||
<p>
|
<p>
|
||||||
Curious how I made it? Check out its Git repository:
|
Curious how I made it? Check out its Git repository:
|
||||||
</p>
|
</p>
|
||||||
<ul class="indent"><li>
|
<ul class="indent">
|
||||||
|
<li>
|
||||||
<a href="https://git.hyperling.com/me/ebook-freedom-flyer"
|
<a href="https://git.hyperling.com/me/ebook-freedom-flyer"
|
||||||
target="_blank" rel="noopener noreferrer"
|
target="_blank" rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
[CODE] | Source Code
|
[CODE] | Source Code
|
||||||
</a>
|
</a>
|
||||||
</li></ul>
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Here is the video it was announced in:
|
||||||
|
</p>
|
||||||
|
<ul class="indent">
|
||||||
|
<li>
|
||||||
|
<a href="https://odysee.com/@HyperVegan:2/20251003-Announcements:0"
|
||||||
|
target="_blank" rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
[Odysee] | HyperVegan: "Announcements: Skipped Midfest, Voluntary Sovereignty eBook, CheapRVLiving Interview"
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -6,11 +6,6 @@
|
|||||||
}
|
}
|
||||||
$show_pics = $GLOBALS["SHOW_BANNER_PICS"];
|
$show_pics = $GLOBALS["SHOW_BANNER_PICS"];
|
||||||
$banner_width = $show_pics ? 6 : 12;
|
$banner_width = $show_pics ? 6 : 12;
|
||||||
|
|
||||||
// TBD / TODO:
|
|
||||||
// Check if user has vertical screen?
|
|
||||||
// Is that possible in this environment?
|
|
||||||
//$image_width = $vertical_screen ? 6 : 3;
|
|
||||||
?>
|
?>
|
||||||
<a href='/about/'>
|
<a href='/about/'>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
30
run.sh
30
run.sh
@@ -6,7 +6,12 @@
|
|||||||
|
|
||||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
echo "$DIR/$PROG"
|
|
||||||
|
# Ensure we are executing from this file's directory.
|
||||||
|
cd $DIR
|
||||||
|
DIR="`pwd`"
|
||||||
|
NAME="'$DIR/$PROG'"
|
||||||
|
echo $NAME
|
||||||
|
|
||||||
## Functions ##
|
## Functions ##
|
||||||
|
|
||||||
@@ -27,13 +32,15 @@ function log {
|
|||||||
echo -e "`date` - $message"
|
echo -e "`date` - $message"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log "Local process information:"
|
||||||
|
ps $$
|
||||||
function check_main {
|
function check_main {
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
echo "ERROR: Subprocess name was not provided. $1"
|
echo "ERROR: Subprocess name was not provided. $1"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
log "Subprocess '$1' checking if main process is still running..."
|
log "Subprocess '$1' checking if main process is still running..."
|
||||||
ps $$
|
ps $$ >/dev/null
|
||||||
status=$?
|
status=$?
|
||||||
if [[ $status != 0 ]]; then
|
if [[ $status != 0 ]]; then
|
||||||
log "Process '$$' not found, '$1' from '$DIR/$PROG' exiting."
|
log "Process '$$' not found, '$1' from '$DIR/$PROG' exiting."
|
||||||
@@ -62,9 +69,6 @@ fi
|
|||||||
|
|
||||||
## Build Environment ##
|
## Build Environment ##
|
||||||
|
|
||||||
# Ensure we are executing from this file's directory.
|
|
||||||
cd $DIR
|
|
||||||
|
|
||||||
sudo=""
|
sudo=""
|
||||||
if [[ -z $LOGNAME ]]; then
|
if [[ -z $LOGNAME ]]; then
|
||||||
LOGNAME="`whoami`"
|
LOGNAME="`whoami`"
|
||||||
@@ -75,25 +79,29 @@ if [[ $LOGNAME != "root" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log "Check if any system dependencies need installed."
|
log "Check if any system dependencies need installed."
|
||||||
|
progs=""
|
||||||
if [[ ! `which php` ]]; then
|
if [[ ! `which php` ]]; then
|
||||||
echo "- Installing PHP"
|
echo "- Installing PHP"
|
||||||
$sudo apt-get install -y php-cli
|
progs="$progs php-cli"
|
||||||
fi
|
fi
|
||||||
if [[ ! `which node` ]]; then
|
if [[ ! `which node` ]]; then
|
||||||
echo "- Installing Node"
|
echo "- Installing Node"
|
||||||
$sudo apt-get install -y nodejs
|
progs="$progs nodejs"
|
||||||
fi
|
fi
|
||||||
if [[ ! `which npm` ]]; then
|
if [[ ! `which npm` ]]; then
|
||||||
echo "- Installing NPM"
|
echo "- Installing NPM"
|
||||||
$sudo apt-get install -y npm
|
progs="$progs npm"
|
||||||
fi
|
fi
|
||||||
if [[ ! `which curl` ]]; then
|
if [[ ! `which curl` ]]; then
|
||||||
echo "- Installing Curl"
|
echo "- Installing Curl"
|
||||||
$sudo apt-get install -y curl
|
progs="$progs curl"
|
||||||
fi
|
fi
|
||||||
if [[ ! `which ps` ]]; then
|
if [[ ! `which ps` ]]; then
|
||||||
echo "- Installing PS"
|
echo "- Installing PS"
|
||||||
$sudo apt-get install -y procps
|
progs="$progs procps"
|
||||||
|
fi
|
||||||
|
if [[ -n "$progs" ]]; then
|
||||||
|
$sudo apt-get install -y $progs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Directories and allowed page types are executable, others are not.
|
# Directories and allowed page types are executable, others are not.
|
||||||
@@ -140,7 +148,7 @@ find files/photos/ -name "*".html -print -delete
|
|||||||
|
|
||||||
## Main ##
|
## Main ##
|
||||||
|
|
||||||
log "Start repo updater."
|
log "Start local cronjob."
|
||||||
while true; do
|
while true; do
|
||||||
check_main cronjob
|
check_main cronjob
|
||||||
$DIR/cronjob.sh
|
$DIR/cronjob.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user