1
mirror of https://github.com/jakejarvis/mastodon-utils.git synced 2025-06-27 13:55:43 -04:00

fix super-linter complaints

This commit is contained in:
2023-01-03 12:29:21 -05:00
parent 5ac292ffe8
commit a9c3de14ff
9 changed files with 35 additions and 17 deletions

View File

@ -1,5 +1,5 @@
# This workflow executes several linters on changed files based on languages used in your code base whenever
# you push a code or open a pull request.
# This workflow executes several linters on changed files based on languages
# used in your code base whenever you push a code or open a pull request.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
@ -11,6 +11,7 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
run-lint:
runs-on: ubuntu-latest
@ -18,10 +19,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0
- name: Lint Code Base
# Using the slim image drastically reduces build and runtime, see:
# https://github.com/github/super-linter#slim-image
uses: github/super-linter/slim@v4
env:
DEFAULT_BRANCH: "main"

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
*.log
# here be secrets
*.env*
!.env.example

View File

@ -10,6 +10,7 @@ set -euo pipefail
echo -e "\n===== backup.sh: started at $(date '+%Y-%m-%d %H:%M:%S') =====\n"
# initialize paths
# shellcheck disable=SC1091
. "$(dirname "${BASH_SOURCE[0]}")"/../init.sh
if [ "$(systemctl is-active mastodon-web.service)" = "active" ]; then

View File

@ -4,6 +4,7 @@
set -euo pipefail
# initialize paths
# shellcheck disable=SC1091
. "$(dirname "${BASH_SOURCE[0]}")"/../init.sh
# re-detect glitch-soc

View File

@ -14,6 +14,7 @@ if [ "$MY_NAME_IS_JAKE_JARVIS" != "pinky promise" ]; then
fi
# initialize paths (and silence warnings about things not existing yet because that's why we're running the installer.)
# shellcheck disable=SC1091
. "$(dirname "${BASH_SOURCE[0]}")"/../init.sh >/dev/null
# check for existing installation
@ -146,7 +147,10 @@ as_mastodon bundle install --jobs "$(getconf _NPROCESSORS_ONLN)"
as_mastodon yarn install --pure-lockfile
# set up database w/ random alphanumeric password
DB_PASSWORD=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c32; echo)
DB_PASSWORD=$(
tr </dev/urandom -dc A-Za-z0-9 | head -c32
echo
)
echo "CREATE USER $MASTODON_USER WITH PASSWORD '$DB_PASSWORD' CREATEDB" | sudo -u postgres psql -f -
# populate .env.production config
@ -283,14 +287,17 @@ as_mastodon touch "$LOGS_ROOT"/cron.log
# set cleanup & backup tasks to run weekly
# https://docs.joinmastodon.org/admin/setup/#cleanup
(sudo crontab -l; echo -e "\n$INSTALLER_WUZ_HERE
(
sudo crontab -l
echo -e "\n$INSTALLER_WUZ_HERE
@weekly bash -c \"$UTILS_ROOT/scripts/weekly_cleanup.sh >> $LOGS_ROOT/cron.log 2>&1\"
@weekly bash -c \"$UTILS_ROOT/scripts/backup.sh >> $LOGS_ROOT/cron.log 2>&1\"
# automatically renew Let's Encrypt certificates
# https://certbot.eff.org/instructions?ws=nginx&os=pip
0 0,12 * * * root /opt/certbot/bin/python -c \"import random; import time; time.sleep(random.random() * 3600)\" && certbot renew -q
") | sudo crontab -
"
) | sudo crontab -
echo "🎉 done! don't forget to fill in .env.production with optional credentials"
echo "https://$MASTODON_DOMAIN/auth/sign_in"

View File

@ -14,6 +14,7 @@ if [ "$MY_NAME_IS_JAKE_JARVIS" != "pinky promise" ]; then
fi
# initialize paths
# shellcheck disable=SC1091
. "$(dirname "${BASH_SOURCE[0]}")"/../init.sh
# pull latest mastodon source

View File

@ -4,6 +4,7 @@
set -euo pipefail
# initialize paths
# shellcheck disable=SC1091
. "$(dirname "${BASH_SOURCE[0]}")"/../init.sh
echo "* rbenv: $(rbenv --version)"

View File

@ -10,6 +10,7 @@ set -o pipefail
echo -e "\n===== weekly_cleanup.sh: started at $(date '+%Y-%m-%d %H:%M:%S') =====\n"
# initialize paths
# shellcheck disable=SC1091
. "$(dirname "${BASH_SOURCE[0]}")"/../init.sh
tootctl media remove --days 14