Initial commit (I feel unsafe)

This commit is contained in:
2026-01-16 00:11:58 -08:00
commit d69daa37bf
121 changed files with 4153 additions and 0 deletions

45
ghost_server-backup Normal file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
# shellcheck source=ghost_server-env
. "${HOME}"/"${USER}"-env
mkdir -p "${HOME}"/backup_logs
logFile=${HOME}/backup_logs/$(date +%y_%m).log
{
echo -e "\n[+] ghost backup\n"
cd "${BLOG_PATH}" || exit
if ! /usr/bin/expect "${HOME}"/"${USER}"-credentials.exp; then
curl -Ss \
-H "Title: Ghost Blog" \
-H "Priority: 3" \
-H "Tags: warning,backup" \
-d "Backup not completed - ghost backup failure" \
"${NOTIF_URL}"
rm -r "${BLOG_PATH}"/backup*
exit 1
fi
echo "[+] local backup taken"
if ! rclone copyto "${BLOG_PATH}"/backup*.zip "${BUCKET_PATH}" -v; then
curl -Ss \
-H "Title: Ghost Blog" \
-H "Priority: 3" \
-H "Tags: warning,backup" \
-d "Backup not completed - rclone failure" \
"${NOTIF_URL}"
rm -r "${BLOG_PATH}"/backup*
exit 1
fi
curl -Ss \
-H "Title: Ghost Blog" \
-H "Priority: 2" \
-H "Tags: heavy_check_mark,backup" \
-d "Backup completed" \
"${NOTIF_URL}"
rm -r "${BLOG_PATH}"/backup*
} &>>"$logFile"