mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-08-28 05:44:04 -05:00
Start setting up the account server
This is about the minimum required to make the account server start. It doesn't fully work yet.
This commit is contained in:
27
scripts/setup-environment.sh
Executable file
27
scripts/setup-environment.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
echo "Setting up local environment variables..."
|
||||
|
||||
rm environment/*.local.env || true
|
||||
|
||||
# Generate an AES-256-CBC key for account server tokens
|
||||
account_aes_key=$(openssl rand -hex 32)
|
||||
echo "PN_ACT_CONFIG_AES_KEY=$account_aes_key" >>./environment/account.local.env
|
||||
|
||||
# Generate master API keys for the account gRPC server
|
||||
account_api_key_account=$(openssl rand -base64 32)
|
||||
account_api_key_api=$(openssl rand -base64 32)
|
||||
echo "PN_ACT_CONFIG_GRPC_MASTER_API_KEY_ACCOUNT=$account_api_key_account" >>./environment/account.local.env
|
||||
echo "PN_ACT_CONFIG_GRPC_MASTER_API_KEY_API=$account_api_key_api" >>./environment/account.local.env
|
||||
|
||||
# Generate access and secret keys for MinIO
|
||||
minio_access_key=$(openssl rand -base64 32)
|
||||
echo "PN_ACT_CONFIG_S3_ACCESS_KEY=$minio_access_key" >>./environment/account.local.env
|
||||
echo "MINIO_ACCESS_KEY=$minio_access_key" >>./environment/minio.local.env
|
||||
minio_secret_key=$(openssl rand -base64 32)
|
||||
echo "PN_ACT_CONFIG_S3_ACCESS_SECRET=$minio_secret_key" >>./environment/account.local.env
|
||||
echo "MINIO_SECRET_KEY=$minio_secret_key" >>./environment/minio.local.env
|
||||
|
||||
echo "Successfully set up environment."
|
||||
27
scripts/setup-submodule-patches.sh
Executable file
27
scripts/setup-submodule-patches.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
echo "Resetting all submodules..."
|
||||
git submodule sync --recursive
|
||||
git submodule foreach --recursive "git reset --hard"
|
||||
git submodule update --init --recursive --checkout --force
|
||||
|
||||
git_base=$(git rev-parse --show-toplevel)
|
||||
|
||||
echo "Applying patches..."
|
||||
num_patches=0
|
||||
for dir in "$git_base/patches/"*; do
|
||||
if [ -d "$dir" ]; then
|
||||
subdir=$(basename "$dir")
|
||||
|
||||
cd "$git_base/repos/$subdir"
|
||||
|
||||
for patch in "$git_base/patches/$subdir"/*; do
|
||||
echo "Applying patch $patch..."
|
||||
git apply "$patch" -v
|
||||
num_patches=$((num_patches + 1))
|
||||
done
|
||||
fi
|
||||
done
|
||||
echo "Successfully applied $num_patches patches."
|
||||
Reference in New Issue
Block a user