Compare commits

...

38 Commits

Author SHA1 Message Date
8a8845d898 Merge pull request '¡Hyperling.com 2.0!' (#16) from dev into main
Reviewed-on: #16
2025-10-14 14:54:53 -07:00
65be246673 Remove idea, working fine without it. 2025-10-14 14:38:27 -07:00
eabf56ed93 Specify that this is not a TODO, just listing TODO items. 2025-10-14 14:38:01 -07:00
d55b13ecbf Add more comments. 2025-10-14 14:03:28 -07:00
cc8a7710a1 Enhance comment on WHY there is nothing to do. :) 2025-10-14 14:01:52 -07:00
ad83090b05 Add further comments for future self and others. 2025-10-14 14:01:08 -07:00
684c237ac1 Remove excess exit and provide output var in case it's helpful in later debugging. 2025-10-14 13:57:33 -07:00
23c0090a47 Only run apt install command once. 2025-10-14 13:51:58 -07:00
e57ec6de50 Add automatic restart if a primary program is updated. 2025-10-14 13:47:38 -07:00
c790dd6736 Reword the output. 2025-10-14 13:41:46 -07:00
6e3666cea2 Begin watching git's status too, not just the grep status of not already being up to date. Add more conditional branches so that errors are logged properly. 2025-10-14 13:37:55 -07:00
7379df38de Make output even more succint. Remove duplicate cd command. 2025-10-14 13:11:37 -07:00
2a915fec69 Fancify script. 2025-10-14 13:06:21 -07:00
fa0e9907ee Use full executable path. Move the ps information out of the loop to prevent log spam. 2025-10-14 13:06:11 -07:00
2c3b5056ae Use a single echo command to announce the program's run. 2025-10-14 12:52:07 -07:00
f5e0c39458 Change announcement wording. Refactor code HTML. 2025-10-14 12:51:06 -07:00
645093da36 Add the announcement video to Freedom page. 2025-10-14 12:48:39 -07:00
f57583b1a9 Refactor comments and output. 2025-10-14 12:46:57 -07:00
51b2ebf8e6 Do not do a full kill, allows website to keep uptime while getting updates. 2025-10-14 12:36:57 -07:00
5a6d91296d Change label for local cronjob. 2025-10-14 12:23:28 -07:00
5306cb78d3 Change to the proper package name for ps. 2025-10-14 12:17:17 -07:00
749a018a6e Remove rebase since files/ is being ignored in Docker container. 2025-10-14 12:16:59 -07:00
f212c41734 Add ps requirement, missing from Docker container! 2025-10-14 11:53:13 -07:00
cba46bfc23 Add explicit rebase. 2025-10-14 11:51:19 -07:00
b734be4054 Enable kill mode. 2025-10-14 11:50:50 -07:00
45915d2914 Add comment on how to stop the 2025-10-14 11:48:55 -07:00
1fa30724d2 Use a parent process checker for both forked jobs. 2025-10-14 11:43:03 -07:00
6def1a3007 Echo the killed processes. 2025-10-14 11:26:43 -07:00
ed7c2b8b29 Add automatic execution of cronjob through run script. 2025-10-14 11:25:35 -07:00
3fcd6af3a9 Move cd to be more in the program. 2025-10-14 11:24:14 -07:00
8507cbd189 Add dedicated cronjob file for keeping the project in sync on docker containers. 2025-10-14 11:18:39 -07:00
8207702442 Make the dates pop a bit more. 2025-10-14 10:30:22 -07:00
0ec47180e2 Add part about testing. 2025-10-14 10:30:08 -07:00
c28f7a92d9 Break open HTML so it is more readable. Add comment for gap. 2025-10-14 10:19:02 -07:00
2d270542f0 Add subtitles of eBooks, as well as a small gap between the list items. 2025-10-14 10:17:51 -07:00
ba0cfe8b56 Show advisory on this page since they are no longer related. 2025-10-14 10:17:24 -07:00
fa8eef51ff Reword and refactor advisory. 2025-10-14 10:12:27 -07:00
730940b003 Remove All, seems too wordy. 2025-10-14 09:58:35 -07:00
10 changed files with 160 additions and 41 deletions

View File

@@ -25,7 +25,7 @@ cd www
Then in a web browser, navigate to `localhost:8080`.
## TODO
## TODO Items
All goals are currently completed.

66
cronjob.sh Executable file
View File

@@ -0,0 +1,66 @@
#!/usr/bin/env bash
# 2025-10-14 Hyperling
# Copied cronjob.sh from env-docker/Config/Hugo-Example/files/ to use for this
# 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.
## Setup ##
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
PROG="$(basename -- "${BASH_SOURCE[0]}")"
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.
output="`git pull`"
git_status="$?"
echo "$output" | grep -v "up to date"
grep_status="$?"
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
log "*** WARNING: Unknown Situation ***"
fi
## Success! ##
exit 0

View File

@@ -18,9 +18,9 @@
Linux system administration from a young age.
Much of my career has focused on back-end / database systems
and optimizing workflows.
I feel that I specialize in building systems with "no sharp edges",
meaning that I make sure there isn't a way the user can hurt
themselves or the system.
I feel that I specialize in building systems with "no sharp
edges", meaning that I test rigorously to ensure there aren't any
ways the user can hurt themselves or the system.
In my free time I enjoy learning new
languages and writing apps for Android.
</p>

View File

@@ -58,13 +58,28 @@
<p>
Curious how I made it? Check out its Git repository:
</p>
<ul class="indent"><li>
<a href="https://git.hyperling.com/me/ebook-freedom-flyer"
target="_blank" rel="noopener noreferrer"
>
[CODE] | Source Code
</a>
</li></ul>
<ul class="indent">
<li>
<a href="https://git.hyperling.com/me/ebook-freedom-flyer"
target="_blank" rel="noopener noreferrer"
>
[CODE] | Source Code
</a>
</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>
<?php

View File

@@ -3,7 +3,7 @@
Page to provide ways people can support me.
-->
<?php
$GLOBALS["ADVISORY"] = false;
//$GLOBALS["ADVISORY"] = false;
if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Health";
}

View File

@@ -1,15 +1,13 @@
#!/usr/bin/php
<?php
$show_advisory = false;
$show_advisory = true;
if ($show_advisory) echo '
<div class="row">
<p><!-- Gap Area --></p>
</div>
<div class="row center" id="advisory">
<div class="col-12 title">
<i><h2>Announcements</h2></i>
</div>
<div class="row center title" id="advisory">
<i><h2 class="col-12 title">Latest Announcement</h2></i>
<a href="/freedom/">
<div class="col-12 text">
<u class="orange">2025-09-28</u>

View File

@@ -6,11 +6,6 @@
}
$show_pics = $GLOBALS["SHOW_BANNER_PICS"];
$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/'>
<div class="row">

View File

@@ -35,11 +35,18 @@
<p>
I enjoy writing! Find my free eBooks below.
</p>
<ul class="indent"><li>
2025-09-28: <a href="/freedom/">Voluntary Sovereignty</a>
</li><li>
2024-03-07: <a href="/health/">My Health Protocol</a>
</li></ul>
<ul class="indent">
<li>
2025-09-28: <a href="/freedom/">Voluntary Sovereignty</a> |
Existing in a statist society with the least amount of friction.
</li>
<li><p><!-- Small Gap --></p></li>
<li>
2024-03-07: <a href="/health/">Hyperling's Health Protocol</a> |
Health is a lifestyle, not a diet. Align yourself with Nature
to receive its blessings.
</li>
</ul>
</div>
</div>

View File

@@ -3,12 +3,12 @@
$long = true;
?>
<div class="row" id="obtainium">
<h2 class="col-12 header">All Announcements</h2>
<h2 class="col-12 header">Announcements</h2>
</div>
<div class="row">
<div class="col-12 text">
<a href="/freedom/">2025-09-28</a>
<strong><a href="/freedom/">2025-09-28</a></strong>
<p>
I wrote another short free eBook, "Voluntary Sovereignty", check it out
<a href="/freedom/">here</a>!
@@ -33,7 +33,7 @@
<div class="row">
<div class="col-12 text">
<a href="/apps/#expense">2025-05-XX</a>
<strong><a href="/apps/#expense">2025-03-27</a></strong>
<p>
My new Android app
<a href="/apps/#expense">"Expense Tracker"</a>
@@ -59,7 +59,7 @@
<div class="row">
<div class="col-12 text">
<a href="/health/">2024-03-07</a>
<strong><a href="/health/">2024-03-07</a></strong>
<p>
Find my free eBook, "Hyperling's Health Protocol",
<a href="/health/">here</a>!
@@ -86,7 +86,7 @@
<div class="row">
<div class="col-12 text">
<a href="/apps/#tictactoe">2024-03-31</a>
<strong><a href="/apps/#tictactoe">2024-03-31</a></strong>
<p>
There's a new app in town,
<a href="/apps/#tictactoe">Tic-Tac-Toe</a>!

56
run.sh
View File

@@ -4,8 +4,14 @@
## Setup ##
DIR=`dirname $0`
PROG=`basename $0`
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
PROG="$(basename -- "${BASH_SOURCE[0]}")"
# Ensure we are executing from this file's directory.
cd $DIR
DIR="`pwd`"
NAME="'$DIR/$PROG'"
echo $NAME
## Functions ##
@@ -26,6 +32,22 @@ function log {
echo -e "`date` - $message"
}
log "Local process information:"
ps $$
function check_main {
if [[ -z "$1" ]]; then
echo "ERROR: Subprocess name was not provided. $1"
exit 0
fi
log "Subprocess '$1' checking if main process is still running..."
ps $$ >/dev/null
status=$?
if [[ $status != 0 ]]; then
log "Process '$$' not found, '$1' from '$DIR/$PROG' exiting."
exit 0
fi
}
## Parameters ##
while getopts ':p:h' opt; do
@@ -47,9 +69,6 @@ fi
## Build Environment ##
# Ensure we are executing from this file's directory.
cd $DIR
sudo=""
if [[ -z $LOGNAME ]]; then
LOGNAME="`whoami`"
@@ -60,21 +79,29 @@ if [[ $LOGNAME != "root" ]]; then
fi
log "Check if any system dependencies need installed."
progs=""
if [[ ! `which php` ]]; then
echo "- Installing PHP"
$sudo apt-get install -y php-cli
progs="$progs php-cli"
fi
if [[ ! `which node` ]]; then
echo "- Installing Node"
$sudo apt-get install -y nodejs
progs="$progs nodejs"
fi
if [[ ! `which npm` ]]; then
echo "- Installing NPM"
$sudo apt-get install -y npm
progs="$progs npm"
fi
if [[ ! `which curl` ]]; then
echo "- Installing Curl"
$sudo apt-get install -y curl
progs="$progs curl"
fi
if [[ ! `which ps` ]]; then
echo "- Installing PS"
progs="$progs procps"
fi
if [[ -n "$progs" ]]; then
$sudo apt-get install -y $progs
fi
# Directories and allowed page types are executable, others are not.
@@ -95,6 +122,7 @@ npm install
log "Removing old index files."
find files/photos/ -name "*".html -print -delete
{
check_main photos
count=1
http_code=0
port="${ports%% *}"
@@ -120,11 +148,21 @@ find files/photos/ -name "*".html -print -delete
## Main ##
log "Start local cronjob."
while true; do
check_main cronjob
$DIR/cronjob.sh
sleep 30
done &
log "Start website API."
node ./main.js $ports
status=$?
## Finish ##
log "Kill spawned processes."
pkill -eP $$
log "Exiting with status '$status'."
exit $status