[Ingest] Per-source proxy toggle instead of one global switch
CI/CD / CI · dotnet build (push) Successful in 56s
CI/CD / Deploy · hamkadr (push) Successful in 1m6s

Each ingestion source now decides independently whether to route through the proxy: added TelegramUseProxy/BaleUseProxy/DivarUseProxy/MedjobsUseProxy/WebsitesUseProxy flags (migration). ScrapeHttpClients.For(s, useProxy) takes the source's own flag; a source is proxied only when its flag is on AND a proxy URL is set. Settings 'sources' tab: removed the global enable checkbox, kept the proxy address field, and added an «از پروکسی استفاده شود» checkbox under each source. Old IngestProxyEnabled column kept for compatibility but no longer gates routing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-04 18:46:48 +03:30
parent cde6b68a39
commit b1e474ba33
14 changed files with 1370 additions and 23 deletions
@@ -55,8 +55,12 @@ public class SettingsModel : PageModel
[BindProperty] public bool DemoMode { get; set; }
[BindProperty] public bool WebsitesEnabled { get; set; }
[BindProperty] public string? WebsiteUrls { get; set; }
[BindProperty] public bool IngestProxyEnabled { get; set; }
[BindProperty] public string? IngestProxyUrl { get; set; }
[BindProperty] public bool TelegramUseProxy { get; set; }
[BindProperty] public bool BaleUseProxy { get; set; }
[BindProperty] public bool DivarUseProxy { get; set; }
[BindProperty] public bool MedjobsUseProxy { get; set; }
[BindProperty] public bool WebsitesUseProxy { get; set; }
[TempData] public string? Saved { get; set; }
[TempData] public string? SmsTest { get; set; }
[TempData] public string? DemoMsg { get; set; }
@@ -91,8 +95,12 @@ public class SettingsModel : PageModel
DemoMode = s.DemoMode;
WebsitesEnabled = s.WebsitesEnabled;
WebsiteUrls = s.WebsiteUrls;
IngestProxyEnabled = s.IngestProxyEnabled;
IngestProxyUrl = s.IngestProxyUrl;
TelegramUseProxy = s.TelegramUseProxy;
BaleUseProxy = s.BaleUseProxy;
DivarUseProxy = s.DivarUseProxy;
MedjobsUseProxy = s.MedjobsUseProxy;
WebsitesUseProxy = s.WebsitesUseProxy;
WebNotificationsEnabled = s.WebNotificationsEnabled;
PushEnabled = s.PushEnabled;
VapidPublicKey = s.VapidPublicKey;
@@ -131,8 +139,12 @@ public class SettingsModel : PageModel
DemoMode = DemoMode,
WebsitesEnabled = WebsitesEnabled,
WebsiteUrls = WebsiteUrls,
IngestProxyEnabled = IngestProxyEnabled,
IngestProxyUrl = IngestProxyUrl,
TelegramUseProxy = TelegramUseProxy,
BaleUseProxy = BaleUseProxy,
DivarUseProxy = DivarUseProxy,
MedjobsUseProxy = MedjobsUseProxy,
WebsitesUseProxy = WebsitesUseProxy,
WebNotificationsEnabled = WebNotificationsEnabled,
PushEnabled = PushEnabled,
VapidPublicKey = VapidPublicKey,