#!/bin/bash # SPDX-FileCopyrightText: Copyright Corsinvest Srl # SPDX-License-Identifier: AGPL-3.0-only set -e echo "===================================================================" echo " CV4PVE Admin - Docker Installation" echo "===================================================================" echo "" echo "Welcome! This script will download and configure CV4PVE Admin." echo "" # Create directory DIR_NAME="cv4pve-admin-docker" if [ -d "$DIR_NAME" ]; then echo "Directory '$DIR_NAME' already exists!" echo "Please remove it or choose a different location." exit 1 fi # Ask for edition echo "Choose edition:" echo " 1) Community Edition (CE)" echo " 2) Enterprise Edition (EE)" echo "" read -p "Select [1-2] (default: 1): " EDITION_CHOICE docker-compose.yaml" # Update .env file if [[ "$OSTYPE" == "darwin"* ]]; then # macOS if [ "$TAG" != "latest" ]; then sed -i '' "s/^CV4PVE_ADMIN_TAG=.*/CV4PVE_ADMIN_TAG=$TAG/" .env fi sed -i '' "s/^POSTGRES_PASSWORD=.*/POSTGRES_PASSWORD=$POSTGRES_PASSWORD/" .env else # Linux if [ "$TAG" != "latest" ]; then sed -i "s/^CV4PVE_ADMIN_TAG=.*/CV4PVE_ADMIN_TAG=$TAG/" .env fi sed -i "s/^POSTGRES_PASSWORD=.*/POSTGRES_PASSWORD=$POSTGRES_PASSWORD/" .env fi echo "Configuration updated in .env" # Make adminctl executable chmod +x adminctl echo "" echo "===================================================================" echo " Installation completed!" echo "===================================================================" echo "" echo "Next steps:" echo " 1. docker compose up -d" echo "" echo "Access: http://localhost:8080" echo "Default credentials: admin@local / Password123!" echo "" echo "Tip: Use './adminctl' for easy Docker management" echo ""