snapshot of https://github.com/raimohanska/ourboard.git (master, 2026-09-23; blobs > 131072B omitted)
This commit is contained in:
33
scripts/migrate_user_email.sh
Executable file
33
scripts/migrate_user_email.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
from_email=$1
|
||||
to_email=$2
|
||||
|
||||
if [ -z $to_email ]; then
|
||||
echo "Usage: migrate_user_email.sh <fromemail> <toemail>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z $DATABASE_URL ]; then
|
||||
echo "DATABASE_URL env missing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo Migrating user email from $from_email to $to_email
|
||||
|
||||
cat << EOF | psql $DATABASE_URL
|
||||
BEGIN;
|
||||
insert into app_user(id, email)
|
||||
values (uuid_generate_v4(), '$to_email')
|
||||
on conflict do nothing;
|
||||
|
||||
update board_access set email='$to_email' where email='$from_email';
|
||||
|
||||
insert into user_board(board_id, user_id, last_opened) (
|
||||
select board_id, (select id from app_user where email='$to_email'), last_opened
|
||||
from user_board where user_id = (select id from app_user where email='$from_email')
|
||||
) on conflict do nothing;
|
||||
|
||||
COMMIT;
|
||||
|
||||
EOF
|
||||
8
scripts/run_dockerized.sh
Executable file
8
scripts/run_dockerized.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
docker run \
|
||||
-it \
|
||||
--init \
|
||||
-e SESSION_SIGNING_SECRET=NOTICE________THIS_________IS____NOT___SECURE_____USE_RANDOMIZED____STRING__INSTEAD \
|
||||
-e DATABASE_URL=postgres://r-board:secret@host.docker.internal:13338/r-board \
|
||||
--mount type=bind,source="$(pwd)"/backend/localfiles,target=/usr/src/app/backend/localfiles \
|
||||
-p 127.0.0.1:1337:1337/tcp \
|
||||
raimohanska/ourboard
|
||||
Reference in New Issue
Block a user