1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-16 21:15:33 -04:00

Compare commits

...

4 Commits

Author SHA1 Message Date
bakerboy448
5d98ad12bb ci: improve cleanup and add nuget cache
add pre-commit to git ignore
2025-10-30 20:43:38 -05:00
Mark McDowall
7d8444c435 Set known networks to RFC 1918 ranges during startup
(cherry picked from commit d10107739b9ed6a50165e5dd1dfae15c7e8aea56)
2025-10-30 09:37:21 -05:00
Polgonite
1883ae52ac Fixed: qBittorrent /login API success check 2025-10-29 17:59:53 -05:00
bakerboy448
47d4ebbeac Bump to 6.0.4 2025-10-26 12:55:36 -05:00
4 changed files with 49 additions and 11 deletions

1
.gitignore vendored
View File

@@ -174,3 +174,4 @@ node_modules.nosync
# Ignore Jetbrains IntelliJ Workspace Directories
.idea/
.pre-commit-config

View File

@@ -9,7 +9,7 @@ variables:
testsFolder: './_tests'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
majorVersion: '6.0.3'
majorVersion: '6.0.4'
minorVersion: $[counter('minorVersion', 2000)]
radarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
@@ -88,6 +88,8 @@ stages:
pool:
vmImage: $(imageName)
workspace:
clean: all
variables:
# Disable stylecop here - linting errors get caught by the analyze task
EnableAnalyzers: $(enableAnalysis)
@@ -95,6 +97,15 @@ stages:
- checkout: self
submodules: true
fetchDepth: 1
- task: Cache@2
inputs:
key: 'nuget | "$(osName)" | global.json'
restoreKeys: |
nuget | "$(osName)"
nuget
path: $(nugetCacheFolder)
displayName: Cache NuGet packages
- task: UseDotNet@2
displayName: 'Install .net core'
inputs:
@@ -112,11 +123,13 @@ stages:
- bash: ./build.sh --backend --enable-extra-platforms
displayName: Build Radarr Backend
- bash: |
find ${OUTPUTFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
find ${OUTPUTFOLDER} -depth -empty -type d -exec rm -r "{}" \;
find ${TESTSFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
find ${TESTSFOLDER} -depth -empty -type d -exec rm -r "{}" \;
displayName: Clean up intermediate output
find ${OUTPUTFOLDER} -type f ! -path "*/publish/*" -delete 2>/dev/null || true
find ${OUTPUTFOLDER} -depth -empty -type d -delete 2>/dev/null || true
find ${TESTSFOLDER} -type f ! -path "*/publish/*" -delete 2>/dev/null || true
find ${TESTSFOLDER} -depth -empty -type d -delete 2>/dev/null || true
rm -rf _temp/obj _temp/bin 2>/dev/null || true
dotnet nuget locals temp --clear 2>/dev/null || true
displayName: Clean up build artifacts
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
- publish: $(outputFolder)
artifact: '$(osName)Backend'
@@ -161,6 +174,8 @@ stages:
imageName: ${{ variables.windowsImage }}
pool:
vmImage: $(imageName)
workspace:
clean: all
steps:
- task: UseNode@1
displayName: Set Node.js version
@@ -181,6 +196,13 @@ stages:
env:
FORCE_COLOR: 0
YARN_CACHE_FOLDER: $(yarnCacheFolder)
- bash: |
if [ "$(osName)" != "Windows" ]; then
rm -rf node_modules 2>/dev/null || true
fi
rm -rf _temp 2>/dev/null || true
displayName: Clean up frontend build artifacts
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
- publish: $(outputFolder)
artifact: '$(osName)Frontend'
displayName: Publish Frontend
@@ -250,6 +272,11 @@ stages:
find . -name "Radarr" -exec chmod a+x {} \;
find . -name "Radarr.Update" -exec chmod a+x {} \;
displayName: Set executable bits
- bash: |
rm -rf _artifacts _output _temp 2>/dev/null || true
dotnet nuget locals temp --clear 2>/dev/null || true
displayName: Clean up source artifacts
condition: succeeded()
- task: ArchiveFiles@2
displayName: Create win-x64 zip
inputs:
@@ -470,6 +497,13 @@ stages:
testRunTitle: '$(testName) Unit Tests'
failTaskOnFailedTests: true
failTaskOnMissingResultsFile: ne(variables['testName'], 'freebsd-x64')
- bash: |
if [ "$(osName)" != "Windows" ]; then
rm -rf ${TESTSFOLDER} 2>/dev/null || true
dotnet nuget locals temp --clear 2>/dev/null || true
fi
displayName: Clean up test artifacts
condition: always()
- job: Unit_Docker
displayName: Unit Docker

View File

@@ -424,8 +424,8 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
catch (HttpException ex)
{
_logger.Debug("qbitTorrent authentication failed.");
if (ex.Response.StatusCode == HttpStatusCode.Forbidden)
_logger.Debug(ex, "qbitTorrent authentication failed.");
if (ex.Response.StatusCode is HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden)
{
throw new DownloadClientAuthenticationException("Failed to authenticate with qBittorrent.", ex);
}
@@ -437,7 +437,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
throw new DownloadClientUnavailableException("Failed to connect to qBittorrent, please check your settings.", ex);
}
if (response.Content != "Ok.")
if (response.Content.IsNotNullOrWhiteSpace() && response.Content != "Ok.")
{
// returns "Fails." on bad login
_logger.Debug("qbitTorrent authentication failed.");

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using DryIoc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
@@ -32,6 +33,7 @@ using Radarr.Http.ClientSchema;
using Radarr.Http.ErrorManagement;
using Radarr.Http.Frontend;
using Radarr.Http.Middleware;
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
using LogLevel = Microsoft.Extensions.Logging.LogLevel;
namespace NzbDrone.Host
@@ -60,8 +62,9 @@ namespace NzbDrone.Host
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost;
options.KnownNetworks.Clear();
options.KnownProxies.Clear();
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("10.0.0.0"), 8));
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("172.16.0.0"), 12));
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("192.168.0.0"), 16));
});
services.AddRouting(options => options.LowercaseUrls = true);