chore(private): fix PapaTramp URLs on papatramp mirror
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,7 +33,7 @@ Test-Path '\\K6A-DC3\NETLOGON'
|
|||||||
|----------|----------|
|
|----------|----------|
|
||||||
| `$RepoPath` | `C:\Soft\Git\RDP-login-monitor` |
|
| `$RepoPath` | `C:\Soft\Git\RDP-login-monitor` |
|
||||||
| `$NetlogonDest` | `\\dc.contoso.local\NETLOGON\RDP-login-monitor` *(заглушка — замените на свой DC)* |
|
| `$NetlogonDest` | `\\dc.contoso.local\NETLOGON\RDP-login-monitor` *(заглушка — замените на свой DC)* |
|
||||||
| `$GitUrl` | `https://github.com/PTah/RDP-login-monitor.git` |
|
| `$GitUrl` | `https://git.papatramp.ru/PapaTramp/RDP-login-monitor.git` |
|
||||||
| `$GitBranch` | `main` |
|
| `$GitBranch` | `main` |
|
||||||
| `$LogFile` | `C:\soft\Logs\update-rdp-monitor.log` |
|
| `$LogFile` | `C:\soft\Logs\update-rdp-monitor.log` |
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\Soft\Git\RDP-login-mo
|
|||||||
```powershell
|
```powershell
|
||||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\Soft\Git\RDP-login-monitor\update-rdp-monitor.ps1 `
|
powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\Soft\Git\RDP-login-monitor\update-rdp-monitor.ps1 `
|
||||||
-NetlogonDest '\\K6A-DC3\NETLOGON\RDP-login-monitor' `
|
-NetlogonDest '\\K6A-DC3\NETLOGON\RDP-login-monitor' `
|
||||||
-GitUrl 'https://git.kalinamall.ru/PapaTramp/RDP-login-monitor.git'
|
-GitUrl 'https://git.papatramp.ru/PapaTramp/RDP-login-monitor.git'
|
||||||
```
|
```
|
||||||
|
|
||||||
Пробный прогон без копирования:
|
Пробный прогон без копирования:
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass `
|
|||||||
|
|
||||||
**Требования:** domain admin в SAC; `SAC_PUBLIC_URL` доступен с ПК; `rdp_git_repo_url` в настройках обновлений. **`Deploy-LoginMonitor.ps1` на шаре NETLOGON для этого пути не обязателен** — скрипт приходит в zip.
|
**Требования:** domain admin в SAC; `SAC_PUBLIC_URL` доступен с ПК; `rdp_git_repo_url` в настройках обновлений. **`Deploy-LoginMonitor.ps1` на шаре NETLOGON для этого пути не обязателен** — скрипт приходит в zip.
|
||||||
|
|
||||||
Лог операции — в модалке SAC сразу при старте. См. [agent-control-plane.md](https://git.kalinamall.ru/PapaTramp/security-alert-center/src/branch/main/docs/agent-control-plane.md) §4.3.
|
Лог операции — в модалке SAC сразу при старте. См. [agent-control-plane.md](https://git.papatramp.ru/PapaTramp/security-alert-center/src/branch/main/docs/agent-control-plane.md) §4.3.
|
||||||
|
|
||||||
## Версии
|
## Версии
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -File "\\<DC>\NETLOGON\RDP-login-m
|
|||||||
2. `Deploy-LoginMonitor.ps1 -SourceShareRoot` (тот же алгоритм, что при GPO)
|
2. `Deploy-LoginMonitor.ps1 -SourceShareRoot` (тот же алгоритм, что при GPO)
|
||||||
3. Нужны: WinRM, domain admin в SAC, доступ ПК к `SAC_PUBLIC_URL`, `rdp_git_repo_url` в **Настройки → Обновления агентов**
|
3. Нужны: WinRM, domain admin в SAC, доступ ПК к `SAC_PUBLIC_URL`, `rdp_git_repo_url` в **Настройки → Обновления агентов**
|
||||||
|
|
||||||
Подробнее: [security-alert-center — agent-control-plane](https://git.kalinamall.ru/PapaTramp/security-alert-center/src/branch/main/docs/agent-control-plane.md) §4.3.
|
Подробнее: [security-alert-center — agent-control-plane](https://git.papatramp.ru/PapaTramp/security-alert-center/src/branch/main/docs/agent-control-plane.md) §4.3.
|
||||||
|
|
||||||
## События в SAC
|
## События в SAC
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -File "\\<DC>\NETLOGON\RDP-login-m
|
|||||||
| Security 4740 (КД) | `auth.account.locked` |
|
| Security 4740 (КД) | `auth.account.locked` |
|
||||||
| Агент | `agent.heartbeat`, `report.daily.rdp`, `agent.inventory` |
|
| Агент | `agent.heartbeat`, `report.daily.rdp`, `agent.inventory` |
|
||||||
|
|
||||||
**SAC:** `Sac-Client.ps1`, `$UseSAC` — [agent-integration.md](https://git.kalinamall.ru/PapaTramp/security-alert-center/src/branch/main/docs/agent-integration.md). Poll команд `qwinsta`/`logoff` (≥ 2.1.0-SAC).
|
**SAC:** `Sac-Client.ps1`, `$UseSAC` — [agent-integration.md](https://git.papatramp.ru/PapaTramp/security-alert-center/src/branch/main/docs/agent-integration.md). Poll команд `qwinsta`/`logoff` (≥ 2.1.0-SAC).
|
||||||
|
|
||||||
## Ключевые файлы
|
## Ключевые файлы
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ Login_Monitor.ps1 -CheckSac
|
|||||||
## Документация
|
## Документация
|
||||||
|
|
||||||
- [Docs/README.md](Docs/README.md) — развёртывание, Exchange
|
- [Docs/README.md](Docs/README.md) — развёртывание, Exchange
|
||||||
- [security-alert-center](https://git.kalinamall.ru/PapaTramp/security-alert-center) — сервер, RDG flap, qwinsta через SAC UI/Seaca
|
- [security-alert-center](https://git.papatramp.ru/PapaTramp/security-alert-center) — сервер, RDG flap, qwinsta через SAC UI/Seaca
|
||||||
|
|
||||||
## English
|
## English
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ $QueueMessageCountThreshold = 150
|
|||||||
# --- Пилот VIP (рекомендуется для первого запуска) ---
|
# --- Пилот VIP (рекомендуется для первого запуска) ---
|
||||||
# $VipMailboxesOnly = $true
|
# $VipMailboxesOnly = $true
|
||||||
# $VipMailboxes = @(
|
# $VipMailboxes = @(
|
||||||
# 'director@kalinamall.ru',
|
# 'director@example.com',
|
||||||
# 'cfo@kalinamall.ru'
|
# 'cfo@example.com'
|
||||||
# )
|
# )
|
||||||
# $VipMailboxPatterns = @(
|
# $VipMailboxPatterns = @(
|
||||||
# '*@kalinamall.ru' # опционально: все ящики домена из Get-Mailbox
|
# '*@example.com' # опционально: все ящики домена из Get-Mailbox
|
||||||
# )
|
# )
|
||||||
|
|
||||||
# Первый ночной скан: не слать сотни алертов по уже существующим пересылкам
|
# Первый ночной скан: не слать сотни алертов по уже существующим пересылкам
|
||||||
@@ -46,9 +46,9 @@ $QueueMessageCountThreshold = 150
|
|||||||
# $SendInboxScanSummary = $true
|
# $SendInboxScanSummary = $true
|
||||||
|
|
||||||
# Удалённый EMS (если скрипт не на Exchange)
|
# Удалённый EMS (если скрипт не на Exchange)
|
||||||
# $ExchangeServerFqdn = 'fifth.kalinamall.ru'
|
# $ExchangeServerFqdn = 'mail.example.com'
|
||||||
|
|
||||||
# Не сканировать Inbox rules (битое хранилище правил / Watson на Get-InboxRule)
|
# Не сканировать Inbox rules (битое хранилище правил / Watson на Get-InboxRule)
|
||||||
# $SkipInboxScanMailboxes = @(
|
# $SkipInboxScanMailboxes = @(
|
||||||
# 'k.selezneva@kalinamall.ru'
|
# 'k.selezneva@example.com'
|
||||||
# )
|
# )
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
# --- Telegram (или DPAPI Base64 через Encrypt-DpapiForRdpMonitor.ps1) ---
|
# --- Telegram (или DPAPI Base64 через Encrypt-DpapiForRdpMonitor.ps1) ---
|
||||||
$TelegramBotToken = '8239219522:AAEyOZX3cwNfgGOMDkf-mgjTIuoaOh5gF7I'
|
$TelegramBotToken = 'YOUR_BOT_TOKEN'
|
||||||
$TelegramChatID = '2843230'
|
$TelegramChatID = 'YOUR_CHAT_ID'
|
||||||
# $TelegramBotTokenProtectedB64 = ''
|
# $TelegramBotTokenProtectedB64 = ''
|
||||||
# $TelegramChatIDProtectedB64 = ''
|
# $TelegramChatIDProtectedB64 = ''
|
||||||
|
|
||||||
@@ -29,17 +29,15 @@ $NotifyOrder = 'tg'
|
|||||||
# --- Подпись сервера в Telegram и SAC (host.display_name); пусто = $env:COMPUTERNAME ---
|
# --- Подпись сервера в Telegram и SAC (host.display_name); пусто = $env:COMPUTERNAME ---
|
||||||
# $ServerDisplayName = 'UNMS Kalina'
|
# $ServerDisplayName = 'UNMS Kalina'
|
||||||
# --- Явный IPv4 хоста для SAC (опционально; иначе автоопределение) ---
|
# --- Явный IPv4 хоста для SAC (опционально; иначе автоопределение) ---
|
||||||
# $ServerIPv4 = '192.168.160.57'
|
# $ServerIPv4 = '10.0.0.10'
|
||||||
|
|
||||||
# --- Security Alert Center (SAC) ---
|
# --- Security Alert Center (SAC) ---
|
||||||
# off | exclusive | dual | fallback — см. security-alert-center/docs/agent-integration.md
|
# off | exclusive | dual | fallback — см. security-alert-center/docs/agent-integration.md
|
||||||
$UseSAC = 'fallback'
|
$UseSAC = 'fallback'
|
||||||
$SacUrl = 'https://sac.kalinamall.ru'
|
$SacUrl = 'https://sac.example.com'
|
||||||
$SacApiKey = 'sac_UkOsAT3UWiQS54KK5OJPBDCSucysQDrKFju28wmYiz8'
|
$SacApiKey = 'sac_CHANGE_ME'
|
||||||
$SacSpoolDir = 'C:\ProgramData\RDP-login-monitor\sac-spool'
|
# $SacSpoolDir = 'C:\ProgramData\RDP-login-monitor\sac-spool'
|
||||||
$SacTimeoutSec = 45
|
# $SacTimeoutSec = 12
|
||||||
$SacSpoolFlushMaxFiles = 50
|
|
||||||
$SacSpoolMaxAgeHours = 72
|
|
||||||
# $SacTlsSkipVerify = $false
|
# $SacTlsSkipVerify = $false
|
||||||
# $SacFallbackFailures = 5
|
# $SacFallbackFailures = 5
|
||||||
# $false = не слать report.daily.rdp с агента (суточный отчёт только из SAC)
|
# $false = не слать report.daily.rdp с агента (суточный отчёт только из SAC)
|
||||||
@@ -60,7 +58,6 @@ $StartupRebootDetectMinutes = 5
|
|||||||
$GetInventory = $true
|
$GetInventory = $true
|
||||||
|
|
||||||
# --- RDS Shadow Control + WinRM inbound (Enter-PSSession), severity warning ---
|
# --- RDS Shadow Control + WinRM inbound (Enter-PSSession), severity warning ---
|
||||||
# $EnableRcm1149Monitoring = 1 # RCM Operational 1149 (RDP auth; workstation + RDS server)
|
|
||||||
# $EnableRcmShadowControlMonitoring = 1 # RCM Operational 20506/20507/20510
|
# $EnableRcmShadowControlMonitoring = 1 # RCM Operational 20506/20507/20510
|
||||||
# $EnableWinRmInboundMonitoring = 1 # WinRM Operational 91 (+ correlate Security 4624)
|
# $EnableWinRmInboundMonitoring = 1 # WinRM Operational 91 (+ correlate Security 4624)
|
||||||
# $EnableAdminShareMonitoring = 1 # Security 5140 C$/ADMIN$ (audit File Share)
|
# $EnableAdminShareMonitoring = 1 # Security 5140 C$/ADMIN$ (audit File Share)
|
||||||
@@ -72,7 +69,7 @@ $GetInventory = $true
|
|||||||
|
|
||||||
# --- Узкое исключение шумовых сетевых логонов (LogonType=3, Advapi) ---
|
# --- Узкое исключение шумовых сетевых логонов (LogonType=3, Advapi) ---
|
||||||
$IgnoreAdvapiNetworkLogonSourceIps = @(
|
$IgnoreAdvapiNetworkLogonSourceIps = @(
|
||||||
'192.168.160.57'
|
'10.0.0.1'
|
||||||
)
|
)
|
||||||
# --- Exchange noise filter: 4624 + LogonType=3 + IP='-' (часто Outlook/почтовые клиенты) ---
|
# --- Exchange noise filter: 4624 + LogonType=3 + IP='-' (часто Outlook/почтовые клиенты) ---
|
||||||
# Включайте на почтовом сервере, если нужен только полезный интерактивный сигнал.
|
# Включайте на почтовом сервере, если нужен только полезный интерактивный сигнал.
|
||||||
@@ -85,9 +82,9 @@ $MaxBackupDays = 31
|
|||||||
|
|
||||||
# --- Блокировка учётной записи AD (4740) + IP из IIS ActiveSync ---
|
# --- Блокировка учётной записи AD (4740) + IP из IIS ActiveSync ---
|
||||||
# Мониторинг включается только на КД с именем $LockoutMonitorDomainController.
|
# Мониторинг включается только на КД с именем $LockoutMonitorDomainController.
|
||||||
$LockoutMonitorDomainController = 'K6A-DC3'
|
$LockoutMonitorDomainController = 'DC01'
|
||||||
$NetBiosDomainName = 'B26'
|
$NetBiosDomainName = 'CONTOSO'
|
||||||
$ExchangeIisLogPath = '\\fifth.kalinamall.ru\c$\inetpub\logs\LogFiles\W3SVC1'
|
$ExchangeIisLogPath = '\\mail.example.com\c$\inetpub\logs\LogFiles\W3SVC1'
|
||||||
$ExchangeServerHostForIisExclude = ''
|
$ExchangeServerHostForIisExclude = ''
|
||||||
$ExchangeIisLogTailLines = 5000
|
$ExchangeIisLogTailLines = 5000
|
||||||
$ExchangeIisLogMinutesBeforeLockout = 30
|
$ExchangeIisLogMinutesBeforeLockout = 30
|
||||||
|
|||||||
@@ -28,20 +28,20 @@ switch ($Target) {
|
|||||||
$BaseHost = $Base -replace '^https://', ''
|
$BaseHost = $Base -replace '^https://', ''
|
||||||
|
|
||||||
$patterns = @(
|
$patterns = @(
|
||||||
@{ From = 'https://github.com/PTah/([^)/''"\s]+)/blob/main/'; To = "$Base/`$1$BlobSuffix/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/([^)/''"\s]+)/blob/main/'; To = "$Base/`$1$BlobSuffix/" }
|
||||||
@{ From = 'https://github.com/PTah/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" }
|
||||||
@{ From = 'https://git.kalinamall.ru/PapaTramp/([^)/''"\s]+)/blob/main/'; To = "$Base/`$1$BlobSuffix/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/([^)/''"\s]+)/blob/main/'; To = "$Base/`$1$BlobSuffix/" }
|
||||||
@{ From = 'https://git.kalinamall.ru/PapaTramp/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" }
|
||||||
|
@{ From = 'https://git.papatramp.ru/PapaTramp/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" }
|
||||||
@{ From = 'https://git.papatramp.ru/PapaTramp/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" }
|
||||||
@{ From = 'https://git.papatramp.ru/PTah/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" }
|
|
||||||
@{ From = 'https://github.com/PTah/'; To = "$Base/" }
|
|
||||||
@{ From = 'https://git.kalinamall.ru/PapaTramp/'; To = "$Base/" }
|
|
||||||
@{ From = 'https://git.papatramp.ru/PapaTramp/'; To = "$Base/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/'; To = "$Base/" }
|
||||||
@{ From = 'https://git.papatramp.ru/PTah/'; To = "$Base/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/'; To = "$Base/" }
|
||||||
@{ From = 'github.com/PTah/'; To = "$BaseHost/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/'; To = "$Base/" }
|
||||||
@{ From = 'git.kalinamall.ru/PapaTramp/'; To = "$BaseHost/" }
|
@{ From = 'https://git.papatramp.ru/PapaTramp/'; To = "$Base/" }
|
||||||
|
@{ From = 'git.papatramp.ru/PapaTramp/'; To = "$BaseHost/" }
|
||||||
|
@{ From = 'git.papatramp.ru/PapaTramp/'; To = "$BaseHost/" }
|
||||||
|
@{ From = 'git.papatramp.ru/PapaTramp/'; To = "$BaseHost/" }
|
||||||
@{ From = 'git.papatramp.ru/PapaTramp/'; To = "$BaseHost/" }
|
@{ From = 'git.papatramp.ru/PapaTramp/'; To = "$BaseHost/" }
|
||||||
@{ From = 'git.papatramp.ru/PTah/'; To = "$BaseHost/" }
|
|
||||||
)
|
)
|
||||||
|
|
||||||
$extensions = @('*.md', '*.json', '*.service', '*.example', '*.sh', '*.ps1', '*.yml', '*.yaml')
|
$extensions = @('*.md', '*.json', '*.service', '*.example', '*.sh', '*.ps1', '*.yml', '*.yaml')
|
||||||
|
|||||||
+10
-24
@@ -4,7 +4,7 @@
|
|||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Dlya servera publikatsii (napr. DC3). Po umolchaniyu GitHub (github.com/PTah).
|
Dlya servera publikatsii (napr. DC3). Po umolchaniyu GitHub (github.com/PTah).
|
||||||
Na zakrytom zerkale ukazhite -GitUrl URL vashego Gitea.
|
Na zakrytom zerkale ukazhite -GitUrl URL vashego Gitea.
|
||||||
Posle fetch: vsegda reset --hard na kalinamall/main (bez merge), zatem clean -fd.
|
Posle fetch: vsegda reset --hard na vetku upstream (bez merge), zatem clean -fd.
|
||||||
Kopiruyutsya: polnyj spisok v Docs/deploy-netlogon-publish.md.
|
Kopiruyutsya: polnyj spisok v Docs/deploy-netlogon-publish.md.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\soft\update-rdp-monitor.ps1
|
powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\soft\update-rdp-monitor.ps1
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
[CmdletBinding(SupportsShouldProcess = $true)]
|
[CmdletBinding(SupportsShouldProcess = $true)]
|
||||||
param(
|
param(
|
||||||
[string]$RepoPath = 'C:\Soft\Git\RDP-login-monitor',
|
[string]$RepoPath = 'C:\Soft\Git\RDP-login-monitor',
|
||||||
[string]$NetlogonDest = '\\b26\NETLOGON\RDP-login-monitor',
|
[string]$NetlogonDest = '\\dc.contoso.local\NETLOGON\RDP-login-monitor',
|
||||||
[string]$GitUrl = 'https://git.kalinamall.ru/PapaTramp/RDP-login-monitor.git',
|
[string]$GitUrl = 'https://git.papatramp.ru/PapaTramp/RDP-login-monitor.git',
|
||||||
[string]$GitBranch = 'main',
|
[string]$GitBranch = 'main',
|
||||||
[string]$LogFile = 'C:\soft\Logs\update-rdp-monitor.log',
|
[string]$LogFile = 'C:\soft\Logs\update-rdp-monitor.log',
|
||||||
[switch]$SkipGitClean
|
[switch]$SkipGitClean
|
||||||
@@ -34,7 +34,6 @@ $DistFiles = @(
|
|||||||
'Install-DomainMonitors.ps1',
|
'Install-DomainMonitors.ps1',
|
||||||
'Deploy-DomainMonitors.ps1',
|
'Deploy-DomainMonitors.ps1',
|
||||||
'exchange_monitor.settings.example.ps1',
|
'exchange_monitor.settings.example.ps1',
|
||||||
'Diagnose-RdpLoginMonitor.ps1',
|
|
||||||
'login_monitor.settings.example.ps1'
|
'login_monitor.settings.example.ps1'
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -113,38 +112,25 @@ function Ensure-GitRepository {
|
|||||||
function Get-ConfiguredGitRemoteName {
|
function Get-ConfiguredGitRemoteName {
|
||||||
$names = @(Invoke-GitCommand -Arguments @('remote') | ForEach-Object { "$_".Trim() } | Where-Object { $_ })
|
$names = @(Invoke-GitCommand -Arguments @('remote') | ForEach-Object { "$_".Trim() } | Where-Object { $_ })
|
||||||
if ($names.Count -eq 0) { return $null }
|
if ($names.Count -eq 0) { return $null }
|
||||||
if ('kalinamall' -in $names) { return 'kalinamall' }
|
|
||||||
foreach ($n in $names) {
|
|
||||||
$url = (& git -C $RepoPath remote get-url $n 2>$null)
|
|
||||||
if ($url -match 'git\.kalinamall\.ru') { return $n }
|
|
||||||
}
|
|
||||||
if ('origin' -in $names) { return 'origin' }
|
if ('origin' -in $names) { return 'origin' }
|
||||||
return $names[0]
|
return $names[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
function Ensure-GitKalinamallRemote {
|
function Ensure-GitUpstreamRemote {
|
||||||
$name = Get-ConfiguredGitRemoteName
|
$name = Get-ConfiguredGitRemoteName
|
||||||
if ($null -ne $name) {
|
if ($null -ne $name) {
|
||||||
$url = (& git -C $RepoPath remote get-url $name 2>$null)
|
$url = (& git -C $RepoPath remote get-url $name 2>$null)
|
||||||
if ($url -match 'git\.kalinamall\.ru') {
|
Write-UpdateLog "Using remote: $name ($url)"
|
||||||
Write-UpdateLog "Using remote: $name ($url)"
|
return $name
|
||||||
return $name
|
|
||||||
}
|
|
||||||
Write-UpdateLog "Remote $name is not kalinamall ($url); adding kalinamall -> $GitUrl"
|
|
||||||
} else {
|
|
||||||
Write-UpdateLog "No remotes; adding kalinamall -> $GitUrl"
|
|
||||||
}
|
}
|
||||||
if ('kalinamall' -in @(& git -C $RepoPath remote 2>$null)) {
|
Write-UpdateLog "No remotes; adding origin -> $GitUrl"
|
||||||
Invoke-GitCommand -Arguments @('remote', 'set-url', 'kalinamall', $GitUrl)
|
Invoke-GitCommand -Arguments @('remote', 'add', 'origin', $GitUrl)
|
||||||
return 'kalinamall'
|
return 'origin'
|
||||||
}
|
|
||||||
Invoke-GitCommand -Arguments @('remote', 'add', 'kalinamall', $GitUrl)
|
|
||||||
return 'kalinamall'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Update-Repository {
|
function Update-Repository {
|
||||||
Ensure-GitRepository
|
Ensure-GitRepository
|
||||||
$remote = Ensure-GitKalinamallRemote
|
$remote = Ensure-GitUpstreamRemote
|
||||||
Invoke-GitCommand -Arguments @('fetch', '--prune', $remote, $GitBranch)
|
Invoke-GitCommand -Arguments @('fetch', '--prune', $remote, $GitBranch)
|
||||||
$upstream = "${remote}/${GitBranch}"
|
$upstream = "${remote}/${GitBranch}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user