Updates user email notifications preference to 'onmention'
Closes #169.
This commit is contained in:
parent
7cf204ba2f
commit
ec06f036b4
2 changed files with 24 additions and 0 deletions
|
@ -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
|
||||
|
|
23
scripts/update-users-email-notifications-preferences.sh
Normal file
23
scripts/update-users-email-notifications-preferences.sh
Normal 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;
|
Loading…
Reference in a new issue