Compare commits

..

32 Commits

Author SHA1 Message Date
219236f167 Move PHP comments into PHP tags since they do not need to be on the website and were in front of the Doc Start tag. 2025-10-17 14:27:53 -07:00
2feb3e88cc Move comment to be after document start. 2025-10-17 14:19:57 -07:00
a1a02500e4 Fix formatting and add back the removed div. 2025-10-17 14:19:04 -07:00
5d9f57fec4 Remove stray a closure. 2025-10-17 14:15:48 -07:00
30a8041fa8 Change order of i and h2 tags, specify that i should be purple in this context. 2025-10-17 14:14:26 -07:00
ff1cf74a00 Remove unnecessary trailing slashes from meta attributes. 2025-10-17 14:12:36 -07:00
5ad44a8056 Remove excess div closure. 2025-10-17 14:10:11 -07:00
b5ea457491 Remove comments which may have some malformed portions showing up on the site. 2025-10-15 09:52:04 -07:00
eaf8d2e0bb Update wording now that there are multiple links. 2025-10-15 06:52:38 -07:00
616663ffe0 Move photo checking out of run.sh and into its own script. 2025-10-15 05:01:33 -07:00
1cd182b3a9 Rename cronjob.sh to check_git.sh. Eventually do the same with the photo checker code so that it can be called from check_git. 2025-10-14 15:13:24 -07:00
ccd4f4d051 Of course I think of something AFTER the release, lol! Reset the photo index file so that any changed CSS is adapted. 2025-10-14 15:10:14 -07:00
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
20 changed files with 198 additions and 141 deletions

View File

@@ -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.

68
check_git.sh Executable file
View File

@@ -0,0 +1,68 @@
#!/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 {
# Not much to do, run.sh and main.js automatically uses the latest files.
rm -v files/photos/index.html
# TBD/TODO: Call check_photos.sh once it has been pulled from run.sh.
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

46
check_photos.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# 2025-10-15 Hyperling
# Create script which does the photo checking so that it can be called by
# scripts other than just run.sh, such as if it needs used in check_git.sh.
## Setup ##
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
PROG="$(basename -- "${BASH_SOURCE[0]}")"
cd $DIR
DIR="`pwd`"
NAME="'$PROG'"
function log {
echo -e "`date` : $NAME - $1"
}
## Parameters ##
ports="$1"
## Main ##
count=1
http_code=0
port="${ports%% *}"
photos_uri=":$port/photos/"
beg_time="$SECONDS"
while [[ $http_code != "200" ]]; do
log "Sleeping for '$count' while waiting for $photos_uri to come up."
sleep $count
log "Checking if $photos_uri is available."
http_code="`curl --silent --fail -w '\n%{http_code}' localhost$photos_uri | tail -n 1`"
log "Check for $photos_uri responded with '$http_code'."
if (( $count >= 10 )); then
log "Giving up on loading $photos_uri after '$count' attempts."
break
else
count=$(( count + 1 ))
fi
done
end_time="$SECONDS"
time="$(( $end_time - $beg_time ))"
log "Finished checking for /photos/ after '$time' seconds."
exit 0

View File

@@ -1,26 +0,0 @@
#!/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.
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
PROG="$(basename -- "${BASH_SOURCE[0]}")"
echo "$DIR/$PROG"
echo "*** Running cronjob @ `date` ***"
cd $DIR
# Pull any updates, and if the project is already up to date, exit successfully.
git pull | grep -v "up to date"
status="$?"
echo "* Pull status is '$status'."
if [[ $status != 0 ]]; then
echo "* Site is already up to date, exiting."
exit 0
else
# Kill node.js which will complete run.sh and restart any Docker containers.
pkill node
fi
exit 0

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Synonym for home page.
-->
<?php <?php
/* Synonym for home page. */
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Apps"; $GLOBALS["HEADER_TITLE"] = "Apps";
} }

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Alias for where Books menu item should go.
-->
<?php <?php
/* Alias for where Books menu item should go. */
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Books"; $GLOBALS["HEADER_TITLE"] = "Books";
} }

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Alias for the support page with a more common name.
-->
<?php <?php
/* Alias for the support page with a more common name. */
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Donate"; $GLOBALS["HEADER_TITLE"] = "Donate";
} }

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Page to provide links for Freedom eBook.
-->
<?php <?php
/* Page to provide links for Freedom eBook. */
$GLOBALS["ADVISORY"] = false; $GLOBALS["ADVISORY"] = false;
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Freedom"; $GLOBALS["HEADER_TITLE"] = "Freedom";
@@ -29,7 +27,7 @@
<div class="row"> <div class="row">
<div class="col-12 text"> <div class="col-12 text">
<p> <p>
Click the link below to download the 4-page PDF: Use the links below to download the 4-page PDF:
</p> </p>
<ul class="indent"> <ul class="indent">
<li> <li>
@@ -58,13 +56,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">
<a href="https://git.hyperling.com/me/ebook-freedom-flyer" <li>
target="_blank" rel="noopener noreferrer" <a href="https://git.hyperling.com/me/ebook-freedom-flyer"
> target="_blank" rel="noopener noreferrer"
[CODE] | Source Code >
</a> [CODE] | Source Code
</li></ul> </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>
</div> </div>
<?php <?php

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Page to provide ways people can support me.
-->
<?php <?php
/* Page to provide ways people can support me. */
//$GLOBALS["ADVISORY"] = false; //$GLOBALS["ADVISORY"] = false;
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Health"; $GLOBALS["HEADER_TITLE"] = "Health";
@@ -30,7 +28,7 @@
<div class="row"> <div class="row">
<div class="col-12 text"> <div class="col-12 text">
<p> <p>
Click the link below to download the 10-page PDF: Use the links below to download the 10-page PDF:
</p> </p>
<ul class="indent"> <ul class="indent">
<li> <li>

View File

@@ -7,7 +7,7 @@
</div> </div>
<div class="row center title" id="advisory"> <div class="row center title" id="advisory">
<i><h2 class="col-12 title">Latest Announcement</h2></i> <h2 class="col-12 title"><i class="purple">Latest Announcement</i></h2>
<a href="/freedom/"> <a href="/freedom/">
<div class="col-12 text"> <div class="col-12 text">
<u class="orange">2025-09-28</u> <u class="orange">2025-09-28</u>

View File

@@ -6,32 +6,19 @@
} }
$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">
<?php if ($show_pics) echo ' <?php if ($show_pics) echo '
<div class="col-3 header center banner-image banner-image01"> <div class="col-3 header center banner-image banner-image01"></div>
<!-<img src="/files/media/icons/home.jpg" ';?>
alt="<<banner01.jpg>>" <div class="col-<?php echo "$banner_width"; ?> header">
>--> <div class="banner-top">Peace</div>
</div> <div class="banner-middle">Love</div>
';?> <div class="banner-bottom">Happiness</div>
<div class="col-<?php echo "$banner_width"; ?> header"> </div>
<div class="banner-top">Peace</div> <?php if ($show_pics) echo '
<div class="banner-middle">Love</div> <div class="col-3 header center banner-image banner-image02"></div>
<div class="banner-bottom">Happiness</div> ';?>
</div>
<?php if ($show_pics) echo '
<div class="col-3 header center banner-image banner-image02">
<!--<img src="/files/media/icons/contact.jpg"
alt="<<banner02.jpg>>"
>-->
</div>
';?>
</div> </div>
</a> </a>

View File

@@ -30,16 +30,16 @@
<?php include "banner.css"; ?> <?php include "banner.css"; ?>
</style> </style>
<meta property="og:title" content="Hyperling"/> <meta property="og:title" content="Hyperling">
<meta property="og:description" content="Apps, eBooks, media, and other resources from the brands Hyperling and HyperVegan."/> <meta property="og:description" content="Apps, eBooks, media, and other resources from the brands Hyperling and HyperVegan.">
<meta property="og:site_name" content="Hyperling"/> <meta property="og:site_name" content="Hyperling">
<meta property="og:url" content="https://hyperling.com/"/> <meta property="og:url" content="https://hyperling.com/">
<meta property="og:type" content="website"/> <meta property="og:type" content="website">
<meta property="og:image" content="https://hyperling.com/files/media/icons/home.jpg"/> <meta property="og:image" content="https://hyperling.com/files/media/icons/home.jpg">
<meta name="referrer" content="same-origin"/> <meta name="referrer" content="same-origin">
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Hyperling" /> <meta name="twitter:title" content="Hyperling">
<meta name="twitter:description" content="Apps, eBooks, media, and other resources from the brands Hyperling and HyperVegan." /> <meta name="twitter:description" content="Apps, eBooks, media, and other resources from the brands Hyperling and HyperVegan.">
<meta name="twitter:image" content="https://hyperling.com/files/media/icons/home.jpg" /> <meta name="twitter:image" content="https://hyperling.com/files/media/icons/home.jpg">
</head> </head>

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Landing page, keeping it apps and development projects like old WordPress site.
-->
<?php <?php
/* Landing page, keeping it apps and development projects like old WordPress site. */
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Announcements"; $GLOBALS["HEADER_TITLE"] = "Announcements";
} }

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Page for my video links.
-->
<?php <?php
/* Page for my video links. */
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Media"; $GLOBALS["HEADER_TITLE"] = "Media";
} }

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Lists of items which I'd like to share such as gear and frequently used apps.
-->
<?php <?php
/* Lists of items which I'd like to share such as gear and frequently used apps. */
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Resources"; $GLOBALS["HEADER_TITLE"] = "Resources";
} }

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Page for my resume and work skill links.
-->
<?php <?php
/* Page for my resume and work skill links. */
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Resume"; $GLOBALS["HEADER_TITLE"] = "Resume";
} }

View File

@@ -54,7 +54,6 @@
>Watch the announcement here | (HyperVegan: "Expense Tracker App")</a> >Watch the announcement here | (HyperVegan: "Expense Tracker App")</a>
</p> </p>
</div> </div>
</a>
</div> </div>
<div class="row"> <div class="row">

View File

@@ -1,8 +1,6 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Page to provide ways people can support me.
-->
<?php <?php
/* Page to provide ways people can support me. */
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Support"; $GLOBALS["HEADER_TITLE"] = "Support";
} }

View File

@@ -1,9 +1,9 @@
#!/usr/bin/php #!/usr/bin/php
<!--
Old page for my video links.
Deprecated 2024-03-06 for /media.
-->
<?php <?php
/*
Old page for my video links.
Deprecated 2024-03-06 for /media.
*/
if (!isset($GLOBALS["HEADER_TITLE"])) { if (!isset($GLOBALS["HEADER_TITLE"])) {
$GLOBALS["HEADER_TITLE"] = "Videos"; $GLOBALS["HEADER_TITLE"] = "Videos";
} }

56
run.sh
View File

@@ -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.
@@ -115,35 +123,15 @@ log "Removing old index files."
find files/photos/ -name "*".html -print -delete find files/photos/ -name "*".html -print -delete
{ {
check_main photos check_main photos
count=1 $DIR/check_photos.sh "$ports"
http_code=0
port="${ports%% *}"
photos_uri=":$port/photos/"
beg_time="$SECONDS"
while [[ $http_code != "200" ]]; do
log "Sleeping for '$count' while waiting for $photos_uri to come up."
sleep $count
log "Checking if $photos_uri is available."
http_code="`curl --silent --fail -w '\n%{http_code}' localhost$photos_uri | tail -n 1`"
log "Check for $photos_uri responded with '$http_code'."
if (( $count >= 10 )); then
log "Giving up on loading $photos_uri after '$count' attempts."
break
else
count=$(( count + 1 ))
fi
done
end_time="$SECONDS"
time="$(( $end_time - $beg_time ))"
log "Finished checking for /photos/ after '$time' seconds."
} & } &
## Main ## ## Main ##
log "Start repo updater." log "Start check_git."
while true; do while true; do
check_main cronjob check_main check_git
$DIR/cronjob.sh $DIR/check_git.sh
sleep 30 sleep 30
done & done &