[mass update] fix supporting multiple domains while enforcing ssl #1

Merged
ammaratef45 merged 1 commits from forceSsl into main 2025-09-08 17:35:50 +00:00
Owner

Script used for the mass update:

forcessl.sh Lines 1 to 31 in 88951c8e39
#!/bin/zsh
# set -x
set -e
dir=~/.abra/recipes
for r in `ls $dir`; do
cd "$dir/$r"
# check if recipe has SSLForceHost label
# skip if it's a commented line
# skip .swp binary file (found in radicale and I don't know what is it for)
if res=$(grep -r "SSLForceHost" . 2>/dev/null \
| grep -v "#-" | grep -v "# -" \
| grep -v ".swp"); then
branch=$(git branch --format '%(refname:short)' --list main master | head -n 1)
current_dir="${PWD##*/}"
git checkout $branch
git pull --rebase
yes | git branch -D forceSsl
git checkout -b forceSsl
for file in `echo $res | cut -d ":" -f 1`; do
# I use macos and BSD versions of tools like sed look weird :(
sed -i '' -e "s/headers.SSLForceHost=true/redirectscheme.scheme=https/" $file
sed -i '' -e "s/headers.SSLHost=.*/redirectscheme.permanent=true\"/" $file
done
git add $file
git commit -m "[mass update] fix supporting multiple domains while enforcing ssl"
git push --set-upstream origin forceSsl
echo "https://git.coopcloud.tech/coop-cloud/$current_dir/pulls/new/forceSsl"
fi
done

Script used for the mass update: https://git.coopcloud.tech/toolshed/oneoff-scripts/src/commit/88951c8e39cb39b5d66ad3927ed650986f097e16/forcessl.sh#L1-L31
ammaratef45 added 1 commit 2025-09-08 15:21:25 +00:00
stevensting approved these changes 2025-09-08 15:32:50 +00:00
ammaratef45 merged commit 41fbf0caa7 into main 2025-09-08 17:35:50 +00:00
ammaratef45 deleted branch forceSsl 2025-09-08 17:36:31 +00:00
Sign in to join this conversation.
No description provided.