From ea1d6e93ba50e136c250ee34e5b45539fb7e09ae Mon Sep 17 00:00:00 2001 From: 00cedke Date: Sat, 8 Feb 2025 11:28:34 +0100 Subject: [PATCH 1/7] Added Pokken-tournament server. --- .gitmodules | 3 +++ compose.yml | 20 ++++++++++++++++++++ repos/pokken-tournament | 1 + 3 files changed, 24 insertions(+) create mode 160000 repos/pokken-tournament diff --git a/.gitmodules b/.gitmodules index 75fd25c..29492c9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -91,3 +91,6 @@ path = repos/pikmin-3 url = https://github.com/PretendoNetwork/pikmin-3 branch = master ignore = dirty +[submodule "repos/pokken-tournament"] + path = repos/pokken-tournament + url = https://github.com/PretendoNetwork/pokken-tournament diff --git a/compose.yml b/compose.yml index bb2b307..0c7cd0e 100644 --- a/compose.yml +++ b/compose.yml @@ -484,6 +484,26 @@ services: - ./environment/pikmin-3.env - ./environment/pikmin-3.local.env + pokken-tournament: + build: ./repos/pokken-tournament + depends_on: + - account + - postgres + restart: unless-stopped + ports: + # Go delve debugger + - 127.0.0.1:2352:2349 + # Authentication server + - 6012:6012/udp + # Secure server + - 6013:6013/udp + networks: + internal: + dns: 172.20.0.200 + env_file: + - ./environment/pokken-tournament.env + - ./environment/pokken-tournament.local.env + volumes: mitmproxy-pretendo-data: mongodb-database: diff --git a/repos/pokken-tournament b/repos/pokken-tournament new file mode 160000 index 0000000..53790f8 --- /dev/null +++ b/repos/pokken-tournament @@ -0,0 +1 @@ +Subproject commit 53790f8a05e6d19495deb1af97a32bd1c9f9a659 From 400a96ca44b6ca49fed9d1b80b0d407372b46168 Mon Sep 17 00:00:00 2001 From: 00cedke Date: Sat, 8 Feb 2025 11:30:11 +0100 Subject: [PATCH 2/7] Added pokken-tournament environment. --- environment/pokken-tournament.env | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 environment/pokken-tournament.env diff --git a/environment/pokken-tournament.env b/environment/pokken-tournament.env new file mode 100644 index 0000000..fba5f45 --- /dev/null +++ b/environment/pokken-tournament.env @@ -0,0 +1,4 @@ +PN_POKKENTOURNAMENT_AUTHENTICATION_SERVER_PORT=6012 +PN_POKKENTOURNAMENT_SECURE_SERVER_PORT=6013 +PN_POKKENTOURNAMENT_ACCOUNT_GRPC_HOST=account +PN_POKKENTOURNAMENT_ACCOUNT_GRPC_PORT=5000 From d740eaa9cf181049bc0f0f71f312f1b1843bbcd7 Mon Sep 17 00:00:00 2001 From: 00cedke Date: Sat, 8 Feb 2025 11:31:37 +0100 Subject: [PATCH 3/7] Modfified for create pkken-tournament local env. --- scripts/internal/framework.sh | 48 +++++++++++++++++------------------ scripts/mitmproxy-ca-cert.pem | 20 +++++++++++++++ scripts/setup-environment.sh | 6 +++++ 3 files changed, 50 insertions(+), 24 deletions(-) create mode 100644 scripts/mitmproxy-ca-cert.pem diff --git a/scripts/internal/framework.sh b/scripts/internal/framework.sh index 9c2d3b0..99bd779 100644 --- a/scripts/internal/framework.sh +++ b/scripts/internal/framework.sh @@ -229,32 +229,32 @@ if_not_verbose() { # with MinGW. All scripts are designed to be run inside a WSL2 distro when running on Windows, and running them in other # environments tends to cause various hard-to-debug issues, mainly when interacting with Docker. -windows_detected=false +# windows_detected=false -# $OS seems to be the most reliable, as it was set in all the environments I checked -if [[ "${OS:-}" = "Windows_NT" ]]; then - windows_detected=true -fi -# $OSTYPE was also set in all the environments I checked -if [[ "${OSTYPE:-}" =~ msys|cygwin ]]; then - windows_detected=true -fi -# uname should always work as a backup, even if the environment variables are not set as expected -if [[ "$(uname -so | tr "[:upper:]" "[:lower:]")" =~ mingw|msys|cygwin ]]; then - windows_detected=true -fi +# # $OS seems to be the most reliable, as it was set in all the environments I checked +# if [[ "${OS:-}" = "Windows_NT" ]]; then +# windows_detected=true +# fi +# # $OSTYPE was also set in all the environments I checked +# if [[ "${OSTYPE:-}" =~ msys|cygwin ]]; then +# windows_detected=true +# fi +# # uname should always work as a backup, even if the environment variables are not set as expected +# if [[ "$(uname -so | tr "[:upper:]" "[:lower:]")" =~ mingw|msys|cygwin ]]; then +# windows_detected=true +# fi -if [[ "$windows_detected" = true ]]; then - print_error "It looks like you are using Windows, but you are not running this script inside a WSL2 distro." - echo - print_info "All pretendo-docker scripts are designed to be run inside your WSL2 distro when running on Windows." - print_info "However, it looks like you are running this script in a different Bash on Windows environment (like Git Bash, Cygwin, MSYS2, or MinGW). Running in these environments tends to cause various hard-to-debug issues." - echo - echo "Note that this issue can be caused by running the script from a Windows shell (like PowerShell or Command Prompt) or by double-clicking it, as Windows will automatically run it with your default app for opening .sh files." - echo - print_info "${term_bold}Please run this script directly from Bash in your primary WSL2 distro instead." - exit 1 -fi +# if [[ "$windows_detected" = true ]]; then +# print_error "It looks like you are using Windows, but you are not running this script inside a WSL2 distro." +# echo +# print_info "All pretendo-docker scripts are designed to be run inside your WSL2 distro when running on Windows." +# print_info "However, it looks like you are running this script in a different Bash on Windows environment (like Git Bash, Cygwin, MSYS2, or MinGW). Running in these environments tends to cause various hard-to-debug issues." +# echo +# echo "Note that this issue can be caused by running the script from a Windows shell (like PowerShell or Command Prompt) or by double-clicking it, as Windows will automatically run it with your default app for opening .sh files." +# echo +# print_info "${term_bold}Please run this script directly from Bash in your primary WSL2 distro instead." +# exit 1 +# fi # Argument parsing framework # Uses a lot of Bash parameter expansion tricks: https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion diff --git a/scripts/mitmproxy-ca-cert.pem b/scripts/mitmproxy-ca-cert.pem new file mode 100644 index 0000000..3fa306a --- /dev/null +++ b/scripts/mitmproxy-ca-cert.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDNTCCAh2gAwIBAgIUThBrYCaoXE79vJIDX3VefYvY1LIwDQYJKoZIhvcNAQEL +BQAwKDESMBAGA1UEAwwJbWl0bXByb3h5MRIwEAYDVQQKDAltaXRtcHJveHkwHhcN +MjQxMjEzMTUyMjA1WhcNMzQxMjEzMTUyMjA1WjAoMRIwEAYDVQQDDAltaXRtcHJv +eHkxEjAQBgNVBAoMCW1pdG1wcm94eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKt9QbTkVhhO3OndhmiD3R+zCO3r8ra+QBvhTdrpy/LD10fPIbMwU1QF +k5wRwRYnnVIY9OWyBMPK9OXHmcy1Vb6p4m24zLSIFXWk78VddfJMCylf1UTGJQJ0 +vSXACw86HrqHmuXMyWt/4cVdpn+LNdQXOfNpSLXOlkGLpT2RCRSu1NQFxJGr8sES +PXivvsroXQHHr5i15JL29nBxhZmlzQq/mIti6DLoZtJNqD4iSMyaRJCXgDR5b/xQ +SO032DONsdc3YBu9LWQBGjr2LQpmh/RostfzpDhFlS1bSYhzzA7al/wE+7N2FbeP +OydHLCBesSBO1Vw9Oio9aemX8DzmP/MCAwEAAaNXMFUwDwYDVR0TAQH/BAUwAwEB +/zATBgNVHSUEDDAKBggrBgEFBQcDATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FGGqsBYGPYFmE07txvOAQVe0boYrMA0GCSqGSIb3DQEBCwUAA4IBAQA1hT1zA5Q4 +fuaLBQ2aCuD72t7ULwZzYhDXnQlB+bdDglshCkFgi6u4J71sCqvhq25f6NxWuLtm +1Q0rfwrZdB5+oEGpgtzcdKXrWoo7ATgAYXj8pzqr8h0+R3JDLpzJM2uDJksB6tTT +ZVIhiKyUZ4qQqBQ0sCs3PPIbctiUY0NwQI+2l4+0Cub2NP2nWxCoi4LMrHLc0aYS +aOfd7QlwBv1ab0x0aq3itZZgyO+Q+W/E1MK1feMsL+Nf05m/J8MOWPDc9VA41DiD +DLfq2Ngfbkazjvw2EBae4ZJtF7Zcft4Gld4s6/m7VBjbEbQF++Qk6buBeH4/meP7 +9SmhFpRQng9t +-----END CERTIFICATE----- diff --git a/scripts/setup-environment.sh b/scripts/setup-environment.sh index 3f2bff4..e321383 100755 --- a/scripts/setup-environment.sh +++ b/scripts/setup-environment.sh @@ -87,6 +87,7 @@ echo "PN_SMM_ACCOUNT_GRPC_API_KEY=$account_grpc_api_key" >>./super-mario-maker.l echo "PN_SPLATOON_ACCOUNT_GRPC_API_KEY=$account_grpc_api_key" >>./splatoon.local.env echo "PN_MINECRAFT_ACCOUNT_GRPC_API_KEY=$account_grpc_api_key" >>./minecraft-wiiu.local.env echo "PN_PIKMIN3_ACCOUNT_GRPC_API_KEY=$account_grpc_api_key" >>./pikmin-3.local.env +echo "PN_POKKENTOURNAMENT_ACCOUNT_GRPC_API_KEY=$account_grpc_api_key" >>./pokken-tournament.local.env # Generate a secret key for MinIO minio_secret_key=$(generate_password 32) @@ -138,6 +139,10 @@ echo "PN_MINECRAFT_KERBEROS_PASSWORD=$minecraft_kerberos_password" >>./minecraft pikmin3_kerberos_password=$(generate_password 32) echo "PN_PIKMIN3_KERBEROS_PASSWORD=$pikmin3_kerberos_password" >>./pikmin-3.local.env +# Generate a Kerberos password for the Pokken-Tournament server +pokkentournament_kerberos_password=$(generate_password 32) +echo "PN_POKKENTOURNAMENT_KERBEROS_PASSWORD=$pokkentournament_kerberos_password" >>./pokken-tournament.local.env + # Generate an AES key for the Miiverse servers miiverse_aes_key=$(generate_hex 64) echo "PN_MIIVERSE_API_CONFIG_AES_KEY=$miiverse_aes_key" >>./miiverse-api.local.env @@ -156,6 +161,7 @@ echo "PN_SMM_SECURE_SERVER_HOST=$server_ip" >>./super-mario-maker.local.env echo "PN_SPLATOON_SECURE_SERVER_HOST=$server_ip" >>./splatoon.local.env echo "PN_MINECRAFT_SECURE_SERVER_HOST=$server_ip" >>./minecraft-wiiu.local.env echo "PN_PIKMIN3_SECURE_SERVER_HOST=$server_ip" >>./pikmin-3.local.env +echo "PN_POKKENTOURNAMENT_SECURE_SERVER_HOST=$server_ip" >>./pokken-tournament.local.env # Get the Wii U IP address if [[ -n "$wiiu_ip" ]]; then From eb90baa0ca7715ab254232017741f582cd936e5a Mon Sep 17 00:00:00 2001 From: 00cedke Date: Sat, 8 Feb 2025 11:36:09 +0100 Subject: [PATCH 4/7] Reactivate the Windows check. --- scripts/internal/framework.sh | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/scripts/internal/framework.sh b/scripts/internal/framework.sh index 99bd779..5457427 100644 --- a/scripts/internal/framework.sh +++ b/scripts/internal/framework.sh @@ -229,32 +229,32 @@ if_not_verbose() { # with MinGW. All scripts are designed to be run inside a WSL2 distro when running on Windows, and running them in other # environments tends to cause various hard-to-debug issues, mainly when interacting with Docker. -# windows_detected=false +windows_detected=false -# # $OS seems to be the most reliable, as it was set in all the environments I checked -# if [[ "${OS:-}" = "Windows_NT" ]]; then -# windows_detected=true -# fi -# # $OSTYPE was also set in all the environments I checked -# if [[ "${OSTYPE:-}" =~ msys|cygwin ]]; then -# windows_detected=true -# fi -# # uname should always work as a backup, even if the environment variables are not set as expected -# if [[ "$(uname -so | tr "[:upper:]" "[:lower:]")" =~ mingw|msys|cygwin ]]; then -# windows_detected=true -# fi +# $OS seems to be the most reliable, as it was set in all the environments I checked +if [[ "${OS:-}" = "Windows_NT" ]]; then + windows_detected=true +fi +# $OSTYPE was also set in all the environments I checked +if [[ "${OSTYPE:-}" =~ msys|cygwin ]]; then + windows_detected=true +fi +# uname should always work as a backup, even if the environment variables are not set as expected +if [[ "$(uname -so | tr "[:upper:]" "[:lower:]")" =~ mingw|msys|cygwin ]]; then + windows_detected=true +fi -# if [[ "$windows_detected" = true ]]; then -# print_error "It looks like you are using Windows, but you are not running this script inside a WSL2 distro." -# echo -# print_info "All pretendo-docker scripts are designed to be run inside your WSL2 distro when running on Windows." -# print_info "However, it looks like you are running this script in a different Bash on Windows environment (like Git Bash, Cygwin, MSYS2, or MinGW). Running in these environments tends to cause various hard-to-debug issues." -# echo -# echo "Note that this issue can be caused by running the script from a Windows shell (like PowerShell or Command Prompt) or by double-clicking it, as Windows will automatically run it with your default app for opening .sh files." -# echo -# print_info "${term_bold}Please run this script directly from Bash in your primary WSL2 distro instead." -# exit 1 -# fi +if [[ "$windows_detected" = true ]]; then + print_error "It looks like you are using Windows, but you are not running this script inside a WSL2 distro." + echo + print_info "All pretendo-docker scripts are designed to be run inside your WSL2 distro when running on Windows." + print_info "However, it looks like you are running this script in a different Bash on Windows environment (like Git Bash, Cygwin, MSYS2, or MinGW). Running in these environments tends to cause various hard-to-debug issues." + echo + echo "Note that this issue can be caused by running the script from a Windows shell (like PowerShell or Command Prompt) or by double-clicking it, as Windows will automatically run it with your default app for opening .sh files." + echo + print_info "${term_bold}Please run this script directly from Bash in your primary WSL2 distro instead." + exit 1 +fi # Argument parsing framework # Uses a lot of Bash parameter expansion tricks: https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion From 627d11810c87318f685cb50bb8ee808d8a504482 Mon Sep 17 00:00:00 2001 From: cedkeChat <123301168+00cedke@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:54:45 +0100 Subject: [PATCH 5/7] Delete scripts/mitmproxy-ca-cert.pem --- scripts/mitmproxy-ca-cert.pem | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 scripts/mitmproxy-ca-cert.pem diff --git a/scripts/mitmproxy-ca-cert.pem b/scripts/mitmproxy-ca-cert.pem deleted file mode 100644 index 3fa306a..0000000 --- a/scripts/mitmproxy-ca-cert.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDNTCCAh2gAwIBAgIUThBrYCaoXE79vJIDX3VefYvY1LIwDQYJKoZIhvcNAQEL -BQAwKDESMBAGA1UEAwwJbWl0bXByb3h5MRIwEAYDVQQKDAltaXRtcHJveHkwHhcN -MjQxMjEzMTUyMjA1WhcNMzQxMjEzMTUyMjA1WjAoMRIwEAYDVQQDDAltaXRtcHJv -eHkxEjAQBgNVBAoMCW1pdG1wcm94eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKt9QbTkVhhO3OndhmiD3R+zCO3r8ra+QBvhTdrpy/LD10fPIbMwU1QF -k5wRwRYnnVIY9OWyBMPK9OXHmcy1Vb6p4m24zLSIFXWk78VddfJMCylf1UTGJQJ0 -vSXACw86HrqHmuXMyWt/4cVdpn+LNdQXOfNpSLXOlkGLpT2RCRSu1NQFxJGr8sES -PXivvsroXQHHr5i15JL29nBxhZmlzQq/mIti6DLoZtJNqD4iSMyaRJCXgDR5b/xQ -SO032DONsdc3YBu9LWQBGjr2LQpmh/RostfzpDhFlS1bSYhzzA7al/wE+7N2FbeP -OydHLCBesSBO1Vw9Oio9aemX8DzmP/MCAwEAAaNXMFUwDwYDVR0TAQH/BAUwAwEB -/zATBgNVHSUEDDAKBggrBgEFBQcDATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE -FGGqsBYGPYFmE07txvOAQVe0boYrMA0GCSqGSIb3DQEBCwUAA4IBAQA1hT1zA5Q4 -fuaLBQ2aCuD72t7ULwZzYhDXnQlB+bdDglshCkFgi6u4J71sCqvhq25f6NxWuLtm -1Q0rfwrZdB5+oEGpgtzcdKXrWoo7ATgAYXj8pzqr8h0+R3JDLpzJM2uDJksB6tTT -ZVIhiKyUZ4qQqBQ0sCs3PPIbctiUY0NwQI+2l4+0Cub2NP2nWxCoi4LMrHLc0aYS -aOfd7QlwBv1ab0x0aq3itZZgyO+Q+W/E1MK1feMsL+Nf05m/J8MOWPDc9VA41DiD -DLfq2Ngfbkazjvw2EBae4ZJtF7Zcft4Gld4s6/m7VBjbEbQF++Qk6buBeH4/meP7 -9SmhFpRQng9t ------END CERTIFICATE----- From f71676f5eb4a83b780ee8acb458b7feaff57567e Mon Sep 17 00:00:00 2001 From: cedkeChat <123301168+00cedke@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:23:38 +0100 Subject: [PATCH 6/7] Update update-account-servers-database.sh --- scripts/internal/update-account-servers-database.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/internal/update-account-servers-database.sh b/scripts/internal/update-account-servers-database.sh index 31cda00..c49faa5 100755 --- a/scripts/internal/update-account-servers-database.sh +++ b/scripts/internal/update-account-servers-database.sh @@ -7,7 +7,7 @@ parse_arguments "$@" print_info "Setting up Pretendo account servers database..." load_dotenv .env -dotenv_files=("friends" "miiverse-api" "wiiu-chat" "super-mario-maker" "splatoon" "minecraft-wiiu" "pikmin-3") +dotenv_files=("friends" "miiverse-api" "wiiu-chat" "super-mario-maker" "splatoon" "minecraft-wiiu" "pikmin-3" "pokken-tournament") for file in "${dotenv_files[@]}"; do load_dotenv "$file.env" "$file.local.env" done @@ -24,6 +24,7 @@ run_verbose docker compose exec -e SERVER_IP="$SERVER_IP" \ -e SPLATOON_PORT="$PN_SPLATOON_AUTHENTICATION_SERVER_PORT" \ -e MINECRAFT_PORT="$PN_MINECRAFT_AUTHENTICATION_SERVER_PORT" \ -e PIKMIN3_PORT="$PN_PIKMIN3_AUTHENTICATION_SERVER_PORT" \ + -e POKKENTOURNAMENT_PORT="$PN_POKKENTOURNAMENT_AUTHENTICATION_SERVER_PORT" \ account node -e "$create_server_script" print_success "Account servers database is set up." From f81a870fddc88478dc21173c9e42fe0825833488 Mon Sep 17 00:00:00 2001 From: cedkeChat <123301168+00cedke@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:29:10 +0100 Subject: [PATCH 7/7] Update update-account-servers-database.js --- .../run-in-container/update-account-servers-database.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/run-in-container/update-account-servers-database.js b/scripts/run-in-container/update-account-servers-database.js index 959bac8..4343371 100644 --- a/scripts/run-in-container/update-account-servers-database.js +++ b/scripts/run-in-container/update-account-servers-database.js @@ -109,6 +109,14 @@ async function runAsync() { 1, "0".repeat(64) ); + await createNexServer( + "Pokken Tournament", + "101C5800", + ["00050000101DF400", "00050000101C5800", "00050000101DEE00"], + process.env.SERVER_IP, + process.env.POKKENTOURNAMENT_PORT, + 1, + "0".repeat(64) } runAsync().then(() => {