diff --git a/setup.ps1 b/setup.ps1 index fbd0f98..5bbb5de 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -161,7 +161,7 @@ $FileBrowserPort = "18888" $AuthUser = "admin" $AuthPass = "changeme" -if ($FoundKey) { +if ($FoundKey -and $ServerHost -ne "YOUR_SERVER_IP") { # Test SSH $testOut = ssh -i $FoundKey -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10 -o BatchMode=yes "dune@$ServerHost" "echo ok" 2>$null if ($testOut -eq "ok") { @@ -299,16 +299,17 @@ Write-Host "" # Check if SSH key is valid for the server $SshValid = $false -if ($FoundKey -and (Test-Path $FoundKey)) { +if ($FoundKey -and (Test-Path $FoundKey) -and $ServerHost -ne "YOUR_SERVER_IP") { $testOut = ssh -i $FoundKey -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10 -o BatchMode=yes "${ServerUser}@${ServerHost}" "echo ok" 2>$null $SshValid = ($testOut -eq "ok") } if (-not $SshValid) { - Write-Host " SSH key is not configured or failed to connect." -ForegroundColor Yellow - Write-Host " Run setup-ssh-key.ps1 first to configure SSH access:" -ForegroundColor Yellow - Write-Host "" - Write-Host " .\setup-ssh-key.ps1" -ForegroundColor Cyan + if ($ServerHost -eq "YOUR_SERVER_IP") { + Write-Host " Remember to edit settings.yaml with your server IP before starting." -ForegroundColor Yellow + } else { + Write-Host " SSH key is not configured or failed to connect." -ForegroundColor Yellow + } Write-Host "" Write-Host " Then start the dashboard with:" -ForegroundColor Yellow Write-Host "" diff --git a/setup.sh b/setup.sh index d5cbbcb..326e855 100644 --- a/setup.sh +++ b/setup.sh @@ -130,7 +130,7 @@ FILEBROWSER_PORT="18888" AUTH_USER="admin" AUTH_PASS="changeme" -if [ -n "$FOUND_KEY" ]; then +if [ -n "$FOUND_KEY" ] && [ "$SERVER_HOST" != "YOUR_SERVER_IP" ]; then if ssh -i "$FOUND_KEY" -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10 -o BatchMode=yes "dune@$SERVER_HOST" "echo ok" &>/dev/null; then echo " SSH connection OK" NS=$(ssh -i "$FOUND_KEY" -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10 -o BatchMode=yes "dune@$SERVER_HOST" "sudo kubectl get namespaces -o name" 2>/dev/null | grep 'funcom-seabass-' | head -1 | sed 's|namespace/||') @@ -242,14 +242,18 @@ echo "" # Check SSH validity SSH_VALID=false -if [ -n "$FOUND_KEY" ] && [ -f "$FOUND_KEY" ]; then +if [ -n "$FOUND_KEY" ] && [ -f "$FOUND_KEY" ] && [ "$SERVER_HOST" != "YOUR_SERVER_IP" ]; then if ssh -i "$FOUND_KEY" -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10 -o BatchMode=yes "${SERVER_USER}@${SERVER_HOST}" "echo ok" &>/dev/null; then SSH_VALID=true fi fi if [ "$SSH_VALID" = false ]; then - echo " SSH key is not configured or failed to connect." + if [ "$SERVER_HOST" = "YOUR_SERVER_IP" ]; then + echo " Remember to edit settings.yaml with your server IP before starting." + else + echo " SSH key is not configured or failed to connect." + fi echo " Edit settings.yaml and set ssh_key to your key path." echo "" echo " Then start the dashboard with:"