Update autosetup2.sh

This commit is contained in:
maq
2025-08-24 14:15:35 -07:00
parent 535f83433a
commit 20f5cd279d

View File

@@ -3,7 +3,7 @@
# --- Fully Automated "Plug and Play" Project Setup Script ---
#
# This script will:
# 1. Prompt the user for all necessary environment variables.
# 1. Take all necessary environment variables as command-line arguments.
# 2. Verify that the required Docker Compose and Traefik files exist.
# 3. Create the main project directory.
# 4. Move the necessary configuration files into the new directory.
@@ -18,15 +18,22 @@ PROJECT_DIR="notesnook-sync"
# Define the required configuration files as a single string, separated by spaces
REQUIRED_FILES="docker-compose.yml traefik.yml"
# --- Step 1: Prompt user for environment variables ---
echo "--- Please enter the required information ---"
read -p "Enter Traefik dashboard user and password hash (e.g., admin:$apr1$...): " TRAEFIK_AUTH_USER
read -p "Enter a secure password for the MinIO user: " MINIO_ROOT_PASSWORD
read -p "Enter the public URL for your sync service (e.g., https://notesnook.example.com/sync): " SERVICE_DISCOVERY_URL
read -p "Enter a long, random token for service-to-service communication: " SERVICE_DISCOVERY_TOKEN
read -p "Enter the public URL for the MinIO S3 service (e.g., https://notesnook.example.com/s3): " ATTACHMENTS_SERVER_PUBLIC_URL
read -p "Enter the public URL for the Monograph service (e.g., https://notesnook.example.com/monograph): " MONOGRAPH_PUBLIC_URL
echo ""
# --- Step 1: Verify command-line arguments ---
if [ "$#" -ne 6 ]; then
echo "Usage: $0 \"TRAEFIK_AUTH_USER_HASH\" \"MINIO_ROOT_PASSWORD\" \"SERVICE_DISCOVERY_URL\" \"SERVICE_DISCOVERY_TOKEN\" \"ATTACHMENTS_SERVER_PUBLIC_URL\" \"MONOGRAPH_PUBLIC_URL\""
echo ""
echo "Example: $0 \"admin:$apr1$...\" \"A_SECURE_PASSWORD\" \"https://sync.example.com\" \"A_LONG_TOKEN\" \"https://s3.example.com\" \"https://monograph.example.com\""
exit 1
fi
# Assign command-line arguments to variables
TRAEFIK_AUTH_USER="$1"
MINIO_ROOT_PASSWORD="$2"
SERVICE_DISCOVERY_URL="$3"
SERVICE_DISCOVERY_TOKEN="$4"
ATTACHMENTS_SERVER_PUBLIC_URL="$5"
MONOGRAPH_PUBLIC_URL="$6"
echo "All information has been gathered. Proceeding with setup..."
echo ""