feat: Добавлены скрипты для установки Sing-box и Discord, а также для просмотра логов.

This commit is contained in:
2025-12-31 12:26:17 +03:00
parent e1f71f95ad
commit 479a7232b1
4 changed files with 193 additions and 6 deletions

View File

@@ -107,11 +107,12 @@ function Install-ProxiFyre {
function Configure-And-Start {
param($TargetApps, $ProxyAddr)
# Конфиг
# Конфиг (гарантируем, что appNames - массив)
$appNamesArray = @($TargetApps)
$cfg = @{
logLevel = "Info"
proxies = @(@{
appNames = $TargetApps
appNames = $appNamesArray
socks5ProxyEndpoint = $ProxyAddr
supportedProtocols = @("TCP", "UDP")
})
@@ -182,12 +183,74 @@ function Configure-And-Start {
Write-Success "Готово! Служба стабильна."
}
function Get-AppPath {
Write-Host "`n📁 Укажите путь до папки с приложением" -ForegroundColor Yellow
Write-Host " (Будут проксированы все .exe из этой папки)" -ForegroundColor Gray
# Стандартные пути установки Discord-клиентов
$defaultPaths = @{
"Discord" = "$env:LOCALAPPDATA\Discord"
"Discord PTB" = "$env:LOCALAPPDATA\DiscordPTB"
"Discord Canary" = "$env:LOCALAPPDATA\DiscordCanary"
"Vesktop" = "$env:LOCALAPPDATA\vesktop"
"Lightcord" = "$env:LOCALAPPDATA\Lightcord"
}
$suggestions = @()
foreach ($app in $defaultPaths.Keys) {
if (Test-Path $defaultPaths[$app]) {
$suggestions += @{ Name = $app; Path = $defaultPaths[$app] }
}
}
if ($suggestions.Count -gt 0) {
Write-Host "`n Найденные приложения:" -ForegroundColor Cyan
for ($i = 0; $i -lt $suggestions.Count; $i++) {
Write-Host " [$($i+1)] $($suggestions[$i].Name): $($suggestions[$i].Path)" -ForegroundColor Gray
}
Write-Host " [c] Указать свой путь" -ForegroundColor Gray
$choice = Read-Host "`n Выберите"
if ($choice -match "^\d+$" -and [int]$choice -ge 1 -and [int]$choice -le $suggestions.Count) {
return @($suggestions[[int]$choice - 1].Path)
}
}
# Ручной ввод пути
while ($true) {
$path = Read-Host " Путь до папки"
if ([string]::IsNullOrWhiteSpace($path)) {
Write-Warning "Путь не указан"
continue
}
if (Test-Path $path) {
$exeCount = (Get-ChildItem $path -Filter "*.exe" -Recurse -ErrorAction SilentlyContinue).Count
if ($exeCount -gt 0) {
Write-Success "Найдено $exeCount исполняемых файлов"
return @($path)
}
else {
Write-Warning "В папке не найдено .exe файлов"
}
}
else {
Write-Error "Папка не существует: $path"
}
$retry = Read-Host " Попробовать другой путь? (y/n)"
if ($retry -ne 'y') { return $null }
}
}
function Select-Apps {
Write-Host "`n🎮 Какие приложения проксировать?" -ForegroundColor Yellow
$appOpts = [Ordered]@{
"1" = "Discord"
"2" = "Vesktop"
"3" = "Discord + Vesktop"
"1" = "Discord (по имени процесса)"
"2" = "Vesktop (по имени процесса)"
"3" = "Discord + Vesktop (по имени процесса)"
"4" = "Указать путь до папки приложения"
}
$appChoice = Show-Menu -Options $appOpts
@@ -196,6 +259,7 @@ function Select-Apps {
"1" { @("Discord", "Update") }
"2" { @("Vesktop") }
"3" { @("Vesktop", "Discord", "Update") }
"4" { Get-AppPath }
default { @("Discord", "Update") }
}
return $result