#!/bin/bash readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}") readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script") Fillepath____Text_List_of_Repos="$Follpath____This_Script/Repos.txt" List____Fiols_to_Exclude=( ".htaccess" "gitolite-admin.git" "testing.git" "test-repo.git" ) Fillepath____CSS="../css/a.css" ############ # Function Grow_Output() { output+="$1" [ -z "$2" ] && output+=" " } readonly -f Grow_Output # End of # Function ############ ############ # Function Convert_Newline_Separated_String_to_Array() { string="$1" # 2016-03-15 04:45:41. addlater. should trim final newline before processing. # echo "Orig string: \"$string\"" string="${string%$'\n'}" #string="${string%\$'\\n'}" # echo "Trimmed string: \"$string\"" retcount=0 retval=() local array=() if [ -z "$string" ] then retcount=0 return 0 fi while read -r line; do #echo "Line: '$line' " array+=("$line") done <<< "$string" retval=( "${array[@]}" ) # 2016-01-29 04:58:07. Yep, it's that tough in Bash just to set a variable equal to an array. retcount=${#retval[@]} # arraystring=$(printf '%s\n' "${array[@]}") # echo "array: $array" # echo "arraystring: $arraystring" } readonly -f Convert_Newline_Separated_String_to_Array # End of # Function ############ ############ # Function Nav_Links() { local position="$1" local down="$2" local up="$3" #local should_omit_bottom_link="$4" retval="" retval+="" retval+="▲ Top  " #[ -z "$should_omit_bottom_link" ] && retval+="▼ Bottom  " retval+="▼ Bottom  " retval+="△ TOC   " [ ! -z "$down" ] && retval+="↓ Down   " [ ! -z "$up" ] && retval+="Up ↑" #!!!! return 0 } readonly -f Nav_Links # End of # Function ############ Raw_List=$(cat "$Fillepath____Text_List_of_Repos") Filtered_List="$Raw_List" for excluded_fiol in "${List____Fiols_to_Exclude[@]}" do Filtered_List=$(echo "$Filtered_List" | grep -v "^$excluded_fiol\$") done Convert_Newline_Separated_String_to_Array "$Filtered_List" List____Repos=( "${retval[@]}" ) count_of_repos="$retcount" echo echo "count_of_repos: $count_of_repos" Prefix____Repo_URL="https://apollia.org/git-repo" HTML____Repo_TOC="

Git Repo Table of Contents (TOC)

    " for repo in "${List____Repos[@]}" do Repo_Name_minus_git=${repo%[.]git} HTML____Repo_TOC+="
  1. $Repo_Name_minus_git" done HTML____Repo_TOC+="
" Nav_Links Nav_Links_for_Git_List="$retval" HTML____Repo_List="" for repo in "${List____Repos[@]}" do Repo_URL="$Prefix____Repo_URL/$repo" Repo_Name_minus_git=${repo%[.]git} Command_Line____Git_Clone="git clone $Repo_URL" HTML____Repo_List+="

$Repo_Name_minus_git

Back to Git Repo TOC - $Nav_Links_for_Git_List " done Grow_Output "" Grow_Output "" Grow_Output "Git Repos on Apollia.org" quote='"' Grow_Output "" Grow_Output "" Grow_Output "" Grow_Output "" Grow_Output '' Grow_Output '

' Grow_Output "



" Nav_Links "top" "repo-toc" Grow_Output "$retval" heredoc=$( cat <<'END_HEREDOC'

Git Repos on Apollia.org

Software and other things created or modified by me, Apollia.

I'm a free/libre/open source programmer who runs websites such as Apollia.org, Non24.com, Eryss.com, Astroblahhh.com, and someday there will be more.

Not everything here is software for Puppy Linux, but plenty is.


About This Page, and How I Made It

A Possible Fix If "git clone" Doesn't Work

END_HEREDOC ) Grow_Output "$heredoc" Grow_Output "



" Nav_Links "repo-toc" "repo-list" "top" Grow_Output "$retval" Grow_Output "$HTML____Repo_TOC" Grow_Output "


" Nav_Links "repo-list" "about" "repo-toc" Grow_Output "$retval" Grow_Output "$HTML____Repo_List" Grow_Output "



" Nav_Links "about" "possible-fix-for-git-clone" "repo-list" Grow_Output "$retval" heredoc=$( cat <<'END_HEREDOC'

About This Page, and How I Made It

This page is currently (07:58:36 11/08/2023) a very basic substitute for GitList, which I still love but stopped using in Feb. 2023, only because my shared web host keeps making me upgrade to newer versions of PHP, and I'd rather not keep having the chore every few years of fixing various things on my websites likely to get broken by PHP updates.

Someday I want to make a fancier substitute which will show details like recent Git commits and diffs, and each repo's description and main Readme file.

But this will suffice for now to make my repos easily available to the world again.


To make this page, I logged into my web host, went to the folder with my repos, and ran this command to obtain an alphabetized list of repos, sorted case-insensitively:

I copied and pasted the resultant list to a file.

Then I ran this Bash script:

That script produced the "index.shtml" page you're currently reading, probably at:

https://apollia.org/gitlist

I uploaded that index.shtml file to Apollia.org with the rsync command.

Sometimes I still use the software gFTP (which is available by default in many different kinds of Puppy Linux) to upload things to Apollia.org, but rsync is much easier.


So, that explains how the front end of this Git repo list was made. It took me about a month to get around to making that Bash script, but once I started actually working on it, it only took about 4.5 hours on March 24, 2023 to throw together.

(However, it would've taken longer if I wasn't so comfortable with Bash and didn't already have various useful bits of code to copy and paste in from other things I've worked on.)

More details on how the back end works and was set up are in this old repo from June 2018:

GitList-and-Gitolite-Setup-on-DreamHost-Shared-Web-Hosting

I no longer use GitList, but I'm still using Gitolite and DreamHost. END_HEREDOC #' 19:02:49 03/24/2023. This comment is only here to fix the Geany text editor's syntax coloring issues resulting from an apostrophe in the above "heredoc" block. ' ) Grow_Output "$heredoc" Grow_Output "



" Nav_Links "possible-fix-for-git-clone" "old-notes" "about" Grow_Output "$retval" heredoc=$( cat <<'END_HEREDOC'

A Possible Fix If "git clone" Doesn't Work

In late September 2022, I finally switched to FossaPup64 9.5 Puppy Linux, after many happy years of Lighthouse 64 Puppy Linux 6.02 Beta 2 as my usual primary OS (operating system).

In FossaPup64 9.5, I had a bit of trouble figuring out how to make the above "git clone" command lines successfully download my own Git repos from my own website.

Fortunately, this very helpful web page explained how to fix that:

Git: client error, server certificate verification failed
January 28, 2019 from FabianLee.org


In FossaPup64 9.5 Puppy Linux, these two commands are all I need to run to make Git cloning from my own website work properly for me:

I haven't had to try this in any other OS (operating system), but hopefully something like the above would work in other OSes too. END_HEREDOC ) Grow_Output "$heredoc" Grow_Output "



" Nav_Links "old-notes" "" "possible-fix-for-git-clone" Grow_Output "$retval" heredoc=$( cat <<'END_HEREDOC'

Old Note by Apollia

22:41:39 02/23/2023:

Earlier today, my web host switched all of my websites over to PHP 8.1, which broke a few things on my websites, including https://apollia.org/gitlist, and the forums I had at https://non24.com/forum and https://eryss.com/forum!

I'm tired of having to deal with annoying unwanted PHP updates every few years, so, rather than struggling to install newer versions of GitList and Simple Machines Forum, I plan to cobble together some simpler, less easily broken substitutes for both GitList and the forums.

END_HEREDOC #' 15:12:48 03/24/2023. This comment is only here to fix the Geany text editor's syntax coloring issues resulting from the apostrophe in the above "heredoc" block. ' ) Grow_Output "$heredoc" Nav_Links "bottom" #"" "" "omit bottom link" Grow_Output "$retval" Grow_Output "
" Grow_Output '' #echo "$output" Fillepath____Output="$Follpath____This_Script/index.shtml" echo "$output" > "$Fillepath____Output" echo echo echo "Done; results are now in: $Fillepath____Output"