diff --git a/deployment/docker/.env.example b/deployment/docker/.env.example index c2b33a8..bb08140 100644 --- a/deployment/docker/.env.example +++ b/deployment/docker/.env.example @@ -31,6 +31,7 @@ COLLECTOR_QBIT_ENABLED=false COLLECTOR_DEBRID_ENABLED=true COLLECTOR_REAL_DEBRID_API_KEY= QBIT_HOST=http://qbittorrent:8080 +QBIT_TRACKERS_URL=https://ngosang.github.io/trackerslist/trackers_all.txt # Addon DEBUG_MODE=false diff --git a/deployment/docker/components/knightcrawler.yaml b/deployment/docker/components/knightcrawler.yaml index 8a78fb5..5154f66 100644 --- a/deployment/docker/components/knightcrawler.yaml +++ b/deployment/docker/components/knightcrawler.yaml @@ -20,7 +20,7 @@ x-depends: &knightcrawler-app-depends services: metadata: - image: gabisonfire/knightcrawler-metadata:2.0.6 + image: gabisonfire/knightcrawler-metadata:2.0.7 env_file: ../.env networks: - knightcrawler-network @@ -30,7 +30,7 @@ services: condition: service_completed_successfully migrator: - image: gabisonfire/knightcrawler-migrator:2.0.6 + image: gabisonfire/knightcrawler-migrator:2.0.7 env_file: ../.env networks: - knightcrawler-network @@ -40,7 +40,7 @@ services: condition: service_healthy addon: - image: gabisonfire/knightcrawler-addon:2.0.6 + image: gabisonfire/knightcrawler-addon:2.0.7 <<: [*knightcrawler-app, *knightcrawler-app-depends] restart: unless-stopped hostname: knightcrawler-addon @@ -48,22 +48,22 @@ services: - "7000:7000" consumer: - image: gabisonfire/knightcrawler-consumer:2.0.6 + image: gabisonfire/knightcrawler-consumer:2.0.7 <<: [*knightcrawler-app, *knightcrawler-app-depends] restart: unless-stopped debridcollector: - image: gabisonfire/knightcrawler-debrid-collector:2.0.6 + image: gabisonfire/knightcrawler-debrid-collector:2.0.7 <<: [*knightcrawler-app, *knightcrawler-app-depends] restart: unless-stopped producer: - image: gabisonfire/knightcrawler-producer:2.0.6 + image: gabisonfire/knightcrawler-producer:2.0.7 <<: [*knightcrawler-app, *knightcrawler-app-depends] restart: unless-stopped qbitcollector: - image: gabisonfire/knightcrawler-qbit-collector:2.0.6 + image: gabisonfire/knightcrawler-qbit-collector:2.0.7 <<: [*knightcrawler-app, *knightcrawler-app-depends] restart: unless-stopped depends_on: diff --git a/src/qbit-collector/Features/Qbit/QbitConfiguration.cs b/src/qbit-collector/Features/Qbit/QbitConfiguration.cs index 5c23877..3130184 100644 --- a/src/qbit-collector/Features/Qbit/QbitConfiguration.cs +++ b/src/qbit-collector/Features/Qbit/QbitConfiguration.cs @@ -3,7 +3,9 @@ namespace QBitCollector.Features.Qbit; public class QbitConfiguration { private const string Prefix = "QBIT"; - private const string ConnectionStringVariable = "HOST"; + private const string HOST_VARIABLE = "HOST"; + private const string TRACKERS_URL_VARIABLE = "TRACKERS_URL"; - public string? Host { get; init; } = Prefix.GetRequiredEnvironmentVariableAsString(ConnectionStringVariable); + public string? Host { get; init; } = Prefix.GetRequiredEnvironmentVariableAsString(HOST_VARIABLE); + public string? TrackersUrl { get; init; } = Prefix.GetRequiredEnvironmentVariableAsString(TRACKERS_URL_VARIABLE); } \ No newline at end of file diff --git a/src/qbit-collector/Features/Trackers/TrackersService.cs b/src/qbit-collector/Features/Trackers/TrackersService.cs index 2070e07..8a48557 100644 --- a/src/qbit-collector/Features/Trackers/TrackersService.cs +++ b/src/qbit-collector/Features/Trackers/TrackersService.cs @@ -1,8 +1,7 @@ namespace QBitCollector.Features.Trackers; -public class TrackersService(IDistributedCache cache, HttpClient client, IMemoryCache memoryCache) : ITrackersService +public class TrackersService(IDistributedCache cache, HttpClient client, IMemoryCache memoryCache, QbitConfiguration configuration) : ITrackersService { - private const string TrackersListUrl = "https://ngosang.github.io/trackerslist/trackers_all.txt"; private const string CacheKey = "trackers"; public async Task> GetTrackers() @@ -42,7 +41,7 @@ public class TrackersService(IDistributedCache cache, HttpClient client, IMemory private async Task> GetTrackersAsync() { - var response = await client.GetStringAsync(TrackersListUrl); + var response = await client.GetStringAsync(configuration.TrackersUrl); var lines = response.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);