mirror of
https://gh.llkk.cc/https://github.com/WeblateOrg/scripts.git
synced 2025-10-03 15:01:00 +08:00
chore(deps): update pre-commit hook scop/pre-commit-shfmt to v3.12.0-1 (#307)
* chore(deps): update pre-commit hook scop/pre-commit-shfmt to v3.12.0-1 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
c2ca1f3e17
commit
64d215f99d
15 changed files with 384 additions and 384 deletions
|
@ -53,7 +53,7 @@ repos:
|
|||
hooks:
|
||||
- id: actionlint
|
||||
- repo: https://github.com/scop/pre-commit-shfmt
|
||||
rev: v3.11.0-1
|
||||
rev: v3.12.0-1
|
||||
hooks:
|
||||
- id: shfmt
|
||||
- repo: https://github.com/adamchainz/blacken-docs
|
||||
|
|
|
@ -30,7 +30,7 @@ fi
|
|||
|
||||
smtp_pass=$(openssl rand -hex 32)
|
||||
|
||||
cat > "${1:-/etc/weblate-bootstrap}" << EOT
|
||||
cat >"${1:-/etc/weblate-bootstrap}" <<EOT
|
||||
WEBLATE_DOMAIN="$domain"
|
||||
WEBLATE_CLOUD_DOMAIN="$cloud_domain"
|
||||
WEBLATE_TITLE="$title"
|
||||
|
|
|
@ -7,7 +7,7 @@ apt update
|
|||
apt install -y fail2ban vim
|
||||
apt purge -y vim-tiny cryptsetup-initramfs
|
||||
|
||||
cat > /etc/fail2ban/jail.d/sshd.conf << EOT
|
||||
cat >/etc/fail2ban/jail.d/sshd.conf <<EOT
|
||||
[sshd]
|
||||
mode = aggressive
|
||||
EOT
|
||||
|
|
|
@ -19,7 +19,7 @@ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o
|
|||
# APT source
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') \
|
||||
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
|
||||
$(lsb_release -cs) stable" >/etc/apt/sources.list.d/docker.list
|
||||
|
||||
# Install Docker
|
||||
apt-get update
|
||||
|
|
|
@ -20,7 +20,7 @@ scp ~/Nextcloud/Weblate/Servers/Mail/DKIM/dkim.private.key "$1":/etc/exim4/dkim.
|
|||
ssh "$1" chgrp Debian-exim /etc/exim4/dkim.private.key
|
||||
ssh "$1" chmod 640 /etc/exim4/dkim.private.key
|
||||
|
||||
ssh "$1" tee /etc/exim4/update-exim4.conf.conf << EOT
|
||||
ssh "$1" tee /etc/exim4/update-exim4.conf.conf <<EOT
|
||||
dc_eximconfig_configtype='internet'
|
||||
dc_other_hostnames=''
|
||||
dc_local_interfaces=''
|
||||
|
@ -36,7 +36,7 @@ dc_mailname_in_oh='true'
|
|||
dc_localdelivery='mail_spool'
|
||||
EOT
|
||||
|
||||
ssh "$1" tee /etc/exim4/conf.d/main/00_local_settings << EOT
|
||||
ssh "$1" tee /etc/exim4/conf.d/main/00_local_settings <<EOT
|
||||
daemon_smtp_ports = 25 : 587
|
||||
REMOTE_SMTP_HELO_DATA = md.weblate.org
|
||||
MAIN_HARDCODE_PRIMARY_HOSTNAME = md.weblate.org
|
||||
|
@ -55,7 +55,7 @@ ssh "$1" systemctl restart exim4
|
|||
ssh "$1" ./scripts/install-graylog "'$(cat ~/.config/weblate-bootstrap/graylog_token)'"
|
||||
|
||||
# shellcheck disable=SC2087
|
||||
ssh "$1" mail -r "noreply@weblate.org" -s "Test" -- "michal@weblate.org" << EOT
|
||||
ssh "$1" mail -r "noreply@weblate.org" -s "Test" -- "michal@weblate.org" <<EOT
|
||||
E-mail delivery from $1.
|
||||
|
||||
--
|
||||
|
|
|
@ -11,14 +11,14 @@ export PATH
|
|||
|
||||
# Munin
|
||||
mkdir -p /etc/munin/plugin-conf.d/
|
||||
cat > /etc/munin/plugin-conf.d/postgres << EOT
|
||||
cat >/etc/munin/plugin-conf.d/postgres <<EOT
|
||||
[postgres_*]
|
||||
user weblate
|
||||
env.PGHOST 127.0.0.1
|
||||
env.PGUSER weblate
|
||||
env.PGPASSWORD weblate
|
||||
EOT
|
||||
cat > /etc/munin/plugin-conf.d/redis << EOT
|
||||
cat >/etc/munin/plugin-conf.d/redis <<EOT
|
||||
[redis]
|
||||
env.host1 127.0.0.1
|
||||
env.port1 6379
|
||||
|
@ -31,7 +31,7 @@ wget https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/r
|
|||
wget https://raw.githubusercontent.com/WeblateOrg/munin/master/weblate
|
||||
wget https://raw.githubusercontent.com/WeblateOrg/munin/master/ksm
|
||||
chmod +x redis weblate ksm
|
||||
cat > /etc/munin/plugin-conf.d/weblate_servers << EOT
|
||||
cat >/etc/munin/plugin-conf.d/weblate_servers <<EOT
|
||||
[weblate]
|
||||
env.SERVER https://$WEBLATE_DOMAIN/
|
||||
env.KEY
|
||||
|
|
|
@ -24,7 +24,7 @@ TMPFILE=$(mktemp --tmpdir weblate-log.XXXXXXXXXX)
|
|||
|
||||
# Gather basic configuration
|
||||
bootstrap "$BOOTSTRAP" "$2"
|
||||
cat >> "$BOOTSTRAP" << EOT
|
||||
cat >>"$BOOTSTRAP" <<EOT
|
||||
WEBLATE_PASSWORD="$(apg -a 0 -M sncl -n 1 -x 10 -m 20)"
|
||||
EOT
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ SENTRY_TOKEN = '$WEBLATE_SENTRY_TOKEN'" \
|
|||
-e 's/# "weblate.machinery.apertium.ApertiumAPYTranslation",/"weblate.machinery.apertium.ApertiumAPYTranslation",/' \
|
||||
"$SETTINGS_PY"
|
||||
|
||||
cat << EOT >> "$SETTINGS_PY"
|
||||
cat <<EOT >>"$SETTINGS_PY"
|
||||
|
||||
# Hosted customization
|
||||
ADMINS_CONTACT = ['care@weblate.org']
|
||||
|
@ -168,7 +168,7 @@ sed -i 's/^\t# gzip/\tgzip/' /etc/nginx/nginx.conf
|
|||
# Hide server version
|
||||
sed -i 's/# server_tokens off/server_tokens off/' /etc/nginx/nginx.conf
|
||||
# Weblate nginx snippet
|
||||
cat > /etc/nginx/snippets/weblate.conf << EOT
|
||||
cat >/etc/nginx/snippets/weblate.conf <<EOT
|
||||
location /static/ {
|
||||
# DATA_DIR/static/
|
||||
alias $WEBLATE_HOME/data/static/;
|
||||
|
|
|
@ -64,7 +64,7 @@ fi
|
|||
sed -i 's/# server_tokens off/server_tokens off/' /etc/nginx/nginx.conf
|
||||
|
||||
# Weblate nginx snippet
|
||||
cat > /etc/nginx/snippets/weblate.conf << EOT
|
||||
cat >/etc/nginx/snippets/weblate.conf <<EOT
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
proxy_read_timeout 3600s;
|
||||
|
@ -111,9 +111,9 @@ mkdir -p "$WEBLATE_DOCKER" "$WEBLATE_HOME/cache" "$WEBLATE_HOME/data" "$WEBLATE_
|
|||
# Go to the docker dir
|
||||
cd "$WEBLATE_DOCKER"
|
||||
|
||||
curl -fsSL https://raw.githubusercontent.com/WeblateOrg/docker-compose/main/docker-compose.yml > docker-compose.yml
|
||||
curl -fsSL https://raw.githubusercontent.com/WeblateOrg/docker-compose/main/environment > environment
|
||||
cat > docker-compose.override.yml << EOT
|
||||
curl -fsSL https://raw.githubusercontent.com/WeblateOrg/docker-compose/main/docker-compose.yml >docker-compose.yml
|
||||
curl -fsSL https://raw.githubusercontent.com/WeblateOrg/docker-compose/main/environment >environment
|
||||
cat >docker-compose.override.yml <<EOT
|
||||
services:
|
||||
weblate:
|
||||
image: weblate/weblate:latest
|
||||
|
@ -153,7 +153,7 @@ volumes:
|
|||
device: '$WEBLATE_HOME/redis'
|
||||
EOT
|
||||
|
||||
cat >> environment << EOT
|
||||
cat >>environment <<EOT
|
||||
|
||||
# E-mail setup
|
||||
WEBLATE_EMAIL_HOST=172.16.0.84
|
||||
|
|
|
@ -33,13 +33,13 @@ install-weblate-docker "$@" --migrate
|
|||
|
||||
# Dump PostgreSQL and load it to Docker
|
||||
# shellcheck disable=SC2024
|
||||
sudo -u "postgres" pg_dump --no-privileges --no-owner --clean --if-exists weblate > "$WEBLATE_HOME/weblate.sql"
|
||||
sudo -u "postgres" pg_dump --no-privileges --no-owner --clean --if-exists weblate >"$WEBLATE_HOME/weblate.sql"
|
||||
systemctl stop postgresql
|
||||
|
||||
cd "$WEBLATE_DOCKER"
|
||||
docker compose up -d database --wait
|
||||
sleep 60
|
||||
docker compose exec -T database psql --username weblate --dbname weblate < "$WEBLATE_HOME/weblate.sql"
|
||||
docker compose exec -T database psql --username weblate --dbname weblate <"$WEBLATE_HOME/weblate.sql"
|
||||
|
||||
# Move redis data
|
||||
cp /var/lib/redis/dump.rdb "$WEBLATE_HOME/redis"
|
||||
|
|
|
@ -9,7 +9,7 @@ sed -i '/\/etc\/letsencrypt\/options-ssl-nginx.conf/ D' /etc/nginx/sites-availab
|
|||
sed -i -e '/ssl_protocols/D' -e '/ssl_prefer_server_ciphers/D' /etc/nginx/nginx.conf
|
||||
|
||||
# Update SSL config
|
||||
cat > /etc/nginx/conf.d/ssl.conf << EOT
|
||||
cat >/etc/nginx/conf.d/ssl.conf <<EOT
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:SSL:50m;
|
||||
ssl_session_tickets off;
|
||||
|
@ -26,7 +26,7 @@ EOT
|
|||
|
||||
# Update DH params
|
||||
if [ ! -f /etc/nginx/ffdhe4096.pem ]; then
|
||||
curl https://ssl-config.mozilla.org/ffdhe2048.txt > /etc/nginx/ffdhe4096.pem
|
||||
curl https://ssl-config.mozilla.org/ffdhe2048.txt >/etc/nginx/ffdhe4096.pem
|
||||
fi
|
||||
|
||||
# Reload ngxin
|
||||
|
|
|
@ -55,7 +55,7 @@ if [ -n "$WEBLATE_USERNAME" ]; then
|
|||
USERNAME=$WEBLATE_USERNAME
|
||||
else
|
||||
for u in weblate ec2-user apache; do
|
||||
if id $u > /dev/null 2>&1; then
|
||||
if id $u >/dev/null 2>&1; then
|
||||
USERNAME=$u
|
||||
break
|
||||
fi
|
||||
|
@ -92,7 +92,7 @@ else
|
|||
|
||||
# Detect web service
|
||||
for service in gunicorn.service uwsgi.service httpd.service; do
|
||||
if systemctl cat -- $service > /dev/null 2>&1; then
|
||||
if systemctl cat -- $service >/dev/null 2>&1; then
|
||||
SERVICE=$service
|
||||
break
|
||||
fi
|
||||
|
@ -169,7 +169,7 @@ else
|
|||
if [ -d "$WEBLATE_HOME/hosted" ]; then
|
||||
sudo -u "$WEBLATE_USERNAME" sh -c "cd $WEBLATE_HOME/hosted; git pull -q"
|
||||
fi
|
||||
if [ "$DO_DIFF" -eq 1 ] && git diff --exit-code "$OLD_HEAD".. -- weblate/settings_example.py > /dev/null; then
|
||||
if [ "$DO_DIFF" -eq 1 ] && git diff --exit-code "$OLD_HEAD".. -- weblate/settings_example.py >/dev/null; then
|
||||
DO_DIFF="0"
|
||||
fi
|
||||
cd "$OLD_DIR"
|
||||
|
@ -182,7 +182,7 @@ else
|
|||
vimdiff "$WEBLATE_DIR/weblate/settings_example.py" "$WEBLATE_DIR/weblate/settings.py"
|
||||
fi
|
||||
if [ -z "$WEBLATE_WORKERS" ]; then
|
||||
sed "s@/home/weblate/weblate-env@$WEBLATE_ENV@" "$WEBLATE_DIR/weblate/examples/celery-weblate.conf" > /etc/default/celery-weblate
|
||||
sed "s@/home/weblate/weblate-env@$WEBLATE_ENV@" "$WEBLATE_DIR/weblate/examples/celery-weblate.conf" >/etc/default/celery-weblate
|
||||
fi
|
||||
|
||||
# Migrate database, compile gettext and collect static files
|
||||
|
@ -230,8 +230,8 @@ fi
|
|||
|
||||
# Upgrade munin plugin
|
||||
if [ -d /usr/share/munin/plugins ]; then
|
||||
wget -O - https://raw.githubusercontent.com/WeblateOrg/munin/master/weblate > /usr/share/munin/plugins/weblate
|
||||
wget -O - https://raw.githubusercontent.com/WeblateOrg/munin/master/ksm > /usr/share/munin/plugins/ksm
|
||||
wget -O - https://raw.githubusercontent.com/WeblateOrg/munin/master/weblate >/usr/share/munin/plugins/weblate
|
||||
wget -O - https://raw.githubusercontent.com/WeblateOrg/munin/master/ksm >/usr/share/munin/plugins/ksm
|
||||
fi
|
||||
|
||||
# Upgrade fail2ban
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue