Fix Gitea upload script to use SSH port 222
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,8 +30,11 @@ Write-Host '[2/4] SSH test...' -ForegroundColor Yellow
|
||||
$keyPath = Join-Path $env:USERPROFILE '.ssh\id_ed25519_eene_dashboard'
|
||||
$fp = ssh-keygen -lf $pubKeyPath 2>$null
|
||||
if ($fp) { Write-Host " Key fingerprint: $fp" -ForegroundColor DarkGray }
|
||||
$giteaHost = '172.16.10.175'
|
||||
$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()
|
||||
if ($test -match 'Permission denied') {
|
||||
Write-Host ''
|
||||
@@ -57,11 +60,13 @@ Set-Location $projectRoot
|
||||
|
||||
Write-Host ''
|
||||
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)
|
||||
if ($remotes -contains 'gitea') {
|
||||
git remote set-url gitea 'git@gitea-eene:RyuWonJun/eene_dashboard.git'
|
||||
git remote set-url gitea $giteaUrl
|
||||
} else {
|
||||
git remote add gitea 'git@gitea-eene:RyuWonJun/eene_dashboard.git'
|
||||
git remote add gitea $giteaUrl
|
||||
}
|
||||
|
||||
Write-Host ''
|
||||
|
||||
Reference in New Issue
Block a user