mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-09-10 04:15:40 -05:00
Create WIP Super Mario Maker server configuration
This commit is contained in:
@@ -7,7 +7,7 @@ while ! mc alias set minio http://minio:9000 "$MINIO_ROOT_USER" "$MINIO_ROOT_PAS
|
||||
sleep 1
|
||||
done
|
||||
|
||||
buckets="pn-cdn pn-boss"
|
||||
buckets="pn-cdn pn-boss super-mario-maker"
|
||||
|
||||
# Create buckets and allow public access
|
||||
for bucket in $buckets; do
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -eu
|
||||
|
||||
databases="friends"
|
||||
databases="friends super_mario_maker"
|
||||
|
||||
for database in $databases; do
|
||||
echo "Creating database: $database"
|
||||
|
||||
@@ -62,6 +62,15 @@ async function runAsync() {
|
||||
// Wii U Chat server doesn't seem to care about the AES key
|
||||
"0".repeat(64)
|
||||
);
|
||||
await createNexServer(
|
||||
"Super Mario Maker",
|
||||
"1018DB00",
|
||||
["000500001018DB00", "000500001018DC00", "000500001018DD00"],
|
||||
process.env.SERVER_IP,
|
||||
process.env.SMM_PORT,
|
||||
1,
|
||||
"0".repeat(64)
|
||||
);
|
||||
|
||||
await mongoose.connection.close();
|
||||
}
|
||||
@@ -75,24 +84,10 @@ async function resetServers() {
|
||||
await Server.deleteMany({});
|
||||
}
|
||||
|
||||
async function createNexServer(
|
||||
service_name,
|
||||
game_server_id,
|
||||
title_ids,
|
||||
ip,
|
||||
port,
|
||||
device,
|
||||
aes_key
|
||||
) {
|
||||
async function createNexServer(service_name, game_server_id, title_ids, ip, port, device, aes_key) {
|
||||
for (const arg of arguments) {
|
||||
if (!arg && arg !== 0 && arg !== false) {
|
||||
throw new Error(
|
||||
`Missing argument in new NEX server:\n${JSON.stringify(
|
||||
arguments,
|
||||
null,
|
||||
2
|
||||
)}`
|
||||
);
|
||||
throw new Error(`Missing argument in new NEX server:\n${JSON.stringify(arguments, null, 2)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,22 +111,10 @@ async function createNexServer(
|
||||
}
|
||||
}
|
||||
|
||||
async function createServiceServer(
|
||||
service_name,
|
||||
client_id,
|
||||
title_ids,
|
||||
device,
|
||||
aes_key
|
||||
) {
|
||||
async function createServiceServer(service_name, client_id, title_ids, device, aes_key) {
|
||||
for (const arg of arguments) {
|
||||
if (!arg && arg !== 0 && arg !== false) {
|
||||
throw new Error(
|
||||
`Missing argument in new service server:\n${JSON.stringify(
|
||||
arguments,
|
||||
null,
|
||||
2
|
||||
)}`
|
||||
);
|
||||
throw new Error(`Missing argument in new service server:\n${JSON.stringify(arguments, null, 2)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ echo "PN_FRIENDS_ACCOUNT_GRPC_API_KEY=$account_grpc_api_key" >>./friends.local.e
|
||||
echo "PN_MIIVERSE_API_CONFIG_GRPC_ACCOUNT_API_KEY=$account_grpc_api_key" >>./miiverse-api.local.env
|
||||
echo "JUXT_CONFIG_GRPC_ACCOUNT_API_KEY=$account_grpc_api_key" >>./juxtaposition-ui.local.env
|
||||
echo "PN_BOSS_CONFIG_GRPC_ACCOUNT_SERVER_API_KEY=$account_grpc_api_key" >>./boss.local.env
|
||||
echo "PN_SMM_ACCOUNT_GRPC_API_KEY=$account_grpc_api_key" >>./super-mario-maker.local.env
|
||||
|
||||
# Generate a secret key for MinIO
|
||||
minio_secret_key=$(generate_password 32)
|
||||
@@ -72,11 +73,13 @@ echo "PN_ACT_CONFIG_S3_ACCESS_SECRET=$minio_secret_key" >>./account.local.env
|
||||
echo "PN_MIIVERSE_API_CONFIG_S3_ACCESS_SECRET=$minio_secret_key" >>./miiverse-api.local.env
|
||||
echo "JUXT_CONFIG_AWS_SPACES_SECRET=$minio_secret_key" >>./juxtaposition-ui.local.env
|
||||
echo "PN_BOSS_CONFIG_S3_ACCESS_SECRET=$minio_secret_key" >>./boss.local.env
|
||||
echo "PN_SMM_CONFIG_S3_ACCESS_SECRET=$minio_secret_key" >>./super-mario-maker.local.env
|
||||
|
||||
# Generate a password for Postgres
|
||||
postgres_password=$(generate_password 32)
|
||||
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
|
||||
@@ -94,6 +97,10 @@ echo "PN_FRIENDS_CONFIG_AES_KEY=$friends_aes_key" >>./friends.local.env
|
||||
chat_kerberos_password=$(generate_password 32)
|
||||
echo "PN_WIIU_CHAT_KERBEROS_PASSWORD=$chat_kerberos_password" >>./wiiu-chat.local.env
|
||||
|
||||
# Generate a Kerberos password for the Super Mario Maker server
|
||||
smm_kerberos_password=$(generate_password 32)
|
||||
echo "PN_SMM_KERBEROS_PASSWORD=$smm_kerberos_password" >>./super-mario-maker.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
|
||||
@@ -108,6 +115,7 @@ info "Using server IP address $server_ip."
|
||||
echo "SERVER_IP=$server_ip" >>./system.local.env
|
||||
echo "PN_FRIENDS_SECURE_SERVER_HOST=$server_ip" >>./friends.local.env
|
||||
echo "PN_WIIU_CHAT_SECURE_SERVER_LOCATION=$server_ip" >>./wiiu-chat.local.env
|
||||
echo "PN_SMM_SECURE_SERVER_HOST=$server_ip" >>./super-mario-maker.local.env
|
||||
|
||||
# Get the Wii U IP address
|
||||
if [ -n "$wiiu_ip" ]; then
|
||||
|
||||
@@ -12,7 +12,7 @@ if [ ! -f "$git_base/environment/system.local.env" ]; then
|
||||
fi
|
||||
. "$git_base/environment/system.local.env"
|
||||
|
||||
necessary_environment_files="friends miiverse-api wiiu-chat"
|
||||
necessary_environment_files="friends miiverse-api wiiu-chat super-mario-maker"
|
||||
for environment in $necessary_environment_files; do
|
||||
if [ ! -f "$git_base/environment/$environment.local.env" ]; then
|
||||
error "Missing environment file $environment.local.env. Did you run setup-environment.sh?"
|
||||
@@ -29,4 +29,5 @@ docker compose exec -e SERVER_IP="$SERVER_IP" \
|
||||
-e FRIENDS_AES_KEY="$PN_FRIENDS_CONFIG_AES_KEY" \
|
||||
-e MIIVERSE_AES_KEY="$PN_MIIVERSE_API_CONFIG_AES_KEY" \
|
||||
-e WIIU_CHAT_PORT="$PN_WIIU_CHAT_AUTHENTICATION_SERVER_PORT" \
|
||||
-e SMM_PORT="$PN_SMM_AUTHENTICATION_SERVER_PORT" \
|
||||
account node -e "$create_server_script"
|
||||
|
||||
Reference in New Issue
Block a user