mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-04-25 08:04:02 -05:00
Switch Friends to nex-go-rewrite branch
This commit is contained in:
parent
8ab28e8eaa
commit
bf8ae18400
2
.gitmodules
vendored
2
.gitmodules
vendored
|
|
@ -24,7 +24,7 @@ ignore = dirty
|
|||
[submodule "repos/friends"]
|
||||
path = repos/friends
|
||||
url = https://github.com/PretendoNetwork/friends.git
|
||||
branch = dev
|
||||
branch = nex-go-rewrite
|
||||
ignore = dirty
|
||||
|
||||
[submodule "repos/miiverse-api"]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit cc9b839d45bf7b65203c9d74935ad927aa8e8b49
|
||||
Subproject commit ee46ec47e5d5549bb68f45c5e130b69409f0688b
|
||||
18
scripts/internal/migrations.sh
Executable file
18
scripts/internal/migrations.sh
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# shellcheck source=./framework.sh
|
||||
source "$(dirname "$(realpath "$0")")/framework.sh"
|
||||
parse_arguments "$@"
|
||||
|
||||
print_info "Running migrations..."
|
||||
|
||||
load_dotenv postgres.env postgres.local.env
|
||||
|
||||
# Migrate friends to the nex-go rewrite
|
||||
migration=$(cat "$git_base_dir/scripts/run-in-container/friends-nex-go-rewrite-migration.sql")
|
||||
|
||||
compose_no_progress up -d friends
|
||||
# shellcheck disable=SC2046
|
||||
docker compose exec postgres psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -d friends -c "$migration" $(if_not_verbose --quiet)
|
||||
|
||||
print_success "Migrations are complete."
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
-- See https://github.com/PretendoNetwork/friends/pull/15
|
||||
ALTER TABLE "3ds".user_data
|
||||
ADD IF NOT EXISTS country integer DEFAULT 0,
|
||||
ALTER COLUMN comment SET DEFAULT '',
|
||||
ALTER COLUMN comment_changed SET DEFAULT 0,
|
||||
ALTER COLUMN last_online SET DEFAULT 0,
|
||||
ALTER COLUMN favorite_title SET DEFAULT 0,
|
||||
ALTER COLUMN favorite_title_version SET DEFAULT 0,
|
||||
ALTER COLUMN mii_name SET DEFAULT '',
|
||||
ALTER COLUMN mii_data SET DEFAULT '',
|
||||
ALTER COLUMN mii_changed SET DEFAULT 0,
|
||||
ALTER COLUMN region SET DEFAULT 0,
|
||||
ALTER COLUMN area SET DEFAULT 0,
|
||||
ALTER COLUMN language SET DEFAULT 0;
|
||||
|
||||
UPDATE "3ds".user_data SET comment = '' WHERE comment IS NULL;
|
||||
UPDATE "3ds".user_data SET comment_changed = 0 WHERE comment_changed IS NULL;
|
||||
UPDATE "3ds".user_data SET last_online = 0 WHERE last_online IS NULL;
|
||||
UPDATE "3ds".user_data SET favorite_title = 0 WHERE favorite_title IS NULL;
|
||||
UPDATE "3ds".user_data SET favorite_title_version = 0 WHERE favorite_title_version IS NULL;
|
||||
UPDATE "3ds".user_data SET mii_name = '' WHERE mii_name IS NULL;
|
||||
UPDATE "3ds".user_data SET mii_data = '' WHERE mii_data IS NULL;
|
||||
UPDATE "3ds".user_data SET mii_changed = 0 WHERE mii_changed IS NULL;
|
||||
UPDATE "3ds".user_data SET region = 0 WHERE region IS NULL;
|
||||
UPDATE "3ds".user_data SET area = 0 WHERE area IS NULL;
|
||||
UPDATE "3ds".user_data SET language = 0 WHERE language IS NULL;
|
||||
|
||||
ALTER TABLE wiiu.user_data
|
||||
ALTER COLUMN last_online SET DEFAULT 0;
|
||||
|
||||
UPDATE wiiu.user_data SET last_online = 0 WHERE last_online IS NULL;
|
||||
|
||||
-- See https://github.com/PretendoNetwork/friends/pull/19
|
||||
ALTER TABLE "3ds".user_data
|
||||
ADD IF NOT EXISTS mii_profanity boolean DEFAULT FALSE,
|
||||
ADD IF NOT EXISTS mii_character_set integer DEFAULT 0;
|
||||
|
||||
UPDATE "3ds".user_data SET mii_profanity = FALSE WHERE mii_profanity IS NULL;
|
||||
UPDATE "3ds".user_data SET mii_character_set = 0 WHERE mii_character_set IS NULL;
|
||||
|
|
@ -93,10 +93,11 @@ echo "POSTGRES_PASSWORD=$postgres_password" >>./postgres.local.env
|
|||
echo "PN_FRIENDS_CONFIG_DATABASE_URI=postgres://postgres_pretendo:$postgres_password@postgres/friends?sslmode=disable" >>./friends.local.env
|
||||
echo "PN_SMM_POSTGRES_URI=postgres://postgres_pretendo:$postgres_password@postgres/super_mario_maker?sslmode=disable" >>./super-mario-maker.local.env
|
||||
|
||||
# Generate a Kerberos password, a gRPC API key, and an AES key for the friends
|
||||
# server
|
||||
friends_kerberos_password=$(generate_password 32)
|
||||
echo "PN_FRIENDS_CONFIG_KERBEROS_PASSWORD=$friends_kerberos_password" >>./friends.local.env
|
||||
# Generate passwords, a gRPC API key, and an AES key for the friends server
|
||||
friends_authentication_password=$(generate_password 32)
|
||||
echo "PN_FRIENDS_CONFIG_AUTHENTICATION_PASSWORD=$friends_authentication_password" >>./friends.local.env
|
||||
friends_secure_password=$(generate_password 32)
|
||||
echo "PN_FRIENDS_CONFIG_SECURE_PASSWORD=$friends_secure_password" >>./friends.local.env
|
||||
friends_api_key=$(generate_password 32)
|
||||
echo "PN_FRIENDS_CONFIG_GRPC_API_KEY=$friends_api_key" >>./friends.local.env
|
||||
echo "PN_WIIU_CHAT_FRIENDS_GRPC_API_KEY=$friends_api_key" >>./wiiu-chat.local.env
|
||||
|
|
|
|||
1
setup.sh
1
setup.sh
|
|
@ -61,6 +61,7 @@ setup_containers() {
|
|||
./scripts/internal/update-account-servers-database.sh
|
||||
./scripts/internal/update-miiverse-endpoints.sh
|
||||
./scripts/internal/update-postgres-password.sh
|
||||
./scripts/internal/migrations.sh
|
||||
print_info "Stopping containers after initial setup..."
|
||||
compose_no_progress down
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user