[Ingest] Per-source proxy toggle instead of one global switch
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:
@@ -51,13 +51,22 @@ public class AppSetting
|
||||
/// <summary>Generic web pages to scrape, one URL per line.</summary>
|
||||
[MaxLength(4000)] public string? WebsiteUrls { get; set; }
|
||||
|
||||
/// <summary>Route ingestion fetches through a proxy (needed in Iran for Telegram etc.).</summary>
|
||||
public bool IngestProxyEnabled { get; set; } = false;
|
||||
/// <summary>Local proxy an Xray/V2Ray client sidecar exposes, e.g. socks5://xray:10808
|
||||
/// (also accepts socks4:// or http://). The app cannot read vmess/vless/trojan directly;
|
||||
/// the sidecar converts that config into this local proxy.</summary>
|
||||
/// the sidecar converts that config into this local proxy. Per-source toggles below decide
|
||||
/// which channels actually route through it.</summary>
|
||||
[MaxLength(200)] public string? IngestProxyUrl { get; set; }
|
||||
|
||||
/// <summary>Legacy global flag — kept for compatibility; per-source flags below now control routing.</summary>
|
||||
public bool IngestProxyEnabled { get; set; } = false;
|
||||
|
||||
// Per-source: route this source's fetches through IngestProxyUrl (only when a URL is set).
|
||||
public bool TelegramUseProxy { get; set; } = false;
|
||||
public bool BaleUseProxy { get; set; } = false;
|
||||
public bool DivarUseProxy { get; set; } = false;
|
||||
public bool MedjobsUseProxy { get; set; } = false;
|
||||
public bool WebsitesUseProxy { get; set; } = false;
|
||||
|
||||
public bool DivarEnabled { get; set; } = false;
|
||||
[MaxLength(60)] public string? DivarCity { get; set; } = "tehran";
|
||||
/// <summary>Divar search terms, one per line or comma-separated.</summary>
|
||||
|
||||
Reference in New Issue
Block a user