sbs

A Simple Blogging System.
git clone https://git.sr.ht/~jbauer/sbs
Log | Files | Refs | README | LICENSE

commit e2af53afe660c7add083a724bfebcae77a0b8796
parent ef9eb307eeb43350afe4ca4f42a36e4dc2834c57
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Tue, 15 Feb 2022 00:31:14 -0500

Validate format of siteURL

Diffstat:
Msbs | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/sbs b/sbs @@ -25,6 +25,12 @@ for key in $options; do fi done +# Validate configuration +if ! echo "$siteURL" | grep -qE '^https?://.*\..*/$'; then + echo "Error: siteURL should be in canonical form (e.g. https://example.com/)" + exit 1 +fi + # Note: The script does not run measurably faster if files are written to using # one versus many printfs. Therefore, I use many printf statements to ease # reading, understanding, and modification of the code.