Updates user email notifications preference to 'onmention'

Closes #169.
This commit is contained in:
Maximilian Kratz 2024-07-16 20:44:29 +02:00
parent 7cf204ba2f
commit ec06f036b4
2 changed files with 24 additions and 0 deletions

View file

@ -50,6 +50,7 @@ services:
- GITEA__attachment__MAX_SIZE=100
- GITEA__cron__ENABLED=true
- GITEA__cron__SCHEDULE=@every 8h00m
- GITEA__admin__DEFAULT_EMAIL_NOTIFICATIONS=onmention
restart: unless-stopped
networks:
- forgejo

View file

@ -0,0 +1,23 @@
#!/bin/bash
#
# This script updates the 'email_notifications_preference' of some users to 'onmention' to prevent
# large amounts of notification emails.
#
# Some useful comments for psql:
# SELECT * FROM public.user WHERE public.user.lower_name = 'maxkratz';
# UPDATE public.user SET email_notifications_preference = 'onmention' WHERE public.user.lower_name = 'maxkratz';
# The actual script:
declare -a users=(
"maxkratz"
)
for u in "${users[@]}"
do
docker compose exec -it db psql -U forgejo -c "UPDATE public.user SET email_notifications_preference = 'onmention' WHERE public.user.lower_name = '$u';"
done
exit 0;