Fix Gitea upload script to use SSH port 222

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
EENE Dashboard
2026-06-17 17:01:20 +09:00
parent b3f2da203b
commit a1f70a5b46

View File

@@ -30,8 +30,11 @@ Write-Host '[2/4] SSH test...' -ForegroundColor Yellow
$keyPath = Join-Path $env:USERPROFILE '.ssh\id_ed25519_eene_dashboard' $keyPath = Join-Path $env:USERPROFILE '.ssh\id_ed25519_eene_dashboard'
$fp = ssh-keygen -lf $pubKeyPath 2>$null $fp = ssh-keygen -lf $pubKeyPath 2>$null
if ($fp) { Write-Host " Key fingerprint: $fp" -ForegroundColor DarkGray } if ($fp) { Write-Host " Key fingerprint: $fp" -ForegroundColor DarkGray }
$giteaHost = '172.16.10.175'
$giteaPort = 222 $giteaPort = 222
$test = ssh -i $keyPath -T git@172.16.10.175 -p $giteaPort -o IdentitiesOnly=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new 2>&1 | Out-String $giteaRepo = 'RyuWonJun/eene_dashboard.git'
$sshConfig = Join-Path $env:USERPROFILE '.ssh\config'
$test = ssh -F $sshConfig -i $keyPath -T "git@${giteaHost}" -p $giteaPort -o IdentitiesOnly=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new 2>&1 | Out-String
Write-Host $test.TrimEnd() Write-Host $test.TrimEnd()
if ($test -match 'Permission denied') { if ($test -match 'Permission denied') {
Write-Host '' Write-Host ''
@@ -57,11 +60,13 @@ Set-Location $projectRoot
Write-Host '' Write-Host ''
Write-Host '[3/4] git remote gitea...' -ForegroundColor Yellow Write-Host '[3/4] git remote gitea...' -ForegroundColor Yellow
$giteaUrl = "ssh://git@${giteaHost}:${giteaPort}/${giteaRepo}"
$env:GIT_SSH_COMMAND = "ssh -F `"$sshConfig`""
$remotes = @(git remote 2>$null) $remotes = @(git remote 2>$null)
if ($remotes -contains 'gitea') { if ($remotes -contains 'gitea') {
git remote set-url gitea 'git@gitea-eene:RyuWonJun/eene_dashboard.git' git remote set-url gitea $giteaUrl
} else { } else {
git remote add gitea 'git@gitea-eene:RyuWonJun/eene_dashboard.git' git remote add gitea $giteaUrl
} }
Write-Host '' Write-Host ''