diff --git a/frontend/src/System/Status/About/About.js b/frontend/src/System/Status/About/About.js
index b0b289135..7cd66edf2 100644
--- a/frontend/src/System/Status/About/About.js
+++ b/frontend/src/System/Status/About/About.js
@@ -22,6 +22,8 @@ class About extends Component {
isNetCore,
isDocker,
runtimeVersion,
+ databaseVersion,
+ databaseType,
appData,
startupPath,
mode,
@@ -69,6 +71,11 @@ class About extends Component {
/>
}
+
+
+
\ No newline at end of file
diff --git a/src/NzbDrone.Automation.Test/AutomationTest.cs b/src/NzbDrone.Automation.Test/AutomationTest.cs
index 37996477f..799670e31 100644
--- a/src/NzbDrone.Automation.Test/AutomationTest.cs
+++ b/src/NzbDrone.Automation.Test/AutomationTest.cs
@@ -43,7 +43,7 @@ namespace NzbDrone.Automation.Test
driver.Manage().Window.Size = new System.Drawing.Size(1920, 1080);
- _runner = new NzbDroneRunner(LogManager.GetCurrentClassLogger());
+ _runner = new NzbDroneRunner(LogManager.GetCurrentClassLogger(), null);
_runner.KillAll();
_runner.Start(true);
diff --git a/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs b/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs
index 59407f4dd..388a96635 100644
--- a/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs
+++ b/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs
@@ -66,6 +66,9 @@ namespace NzbDrone.Common.Test.InstrumentationTests
[TestCase("Hardlinking episode file: /Users/mySecret/Downloads to /media/abc.mkv")]
[TestCase("Hardlink '/home/mySecret/Downloads/abs.mkv' to '/media/abc.mkv' failed.")]
[TestCase("Hardlink '/Users/mySecret/Downloads/abs.mkv' to '/media/abc.mkv' failed.")]
+ [TestCase("/sonarr/signalr/messages/negotiate?access_token=1234530f422f4aacb6b301233210aaaa&negotiateVersion=1")]
+ [TestCase(@"[Info] MigrationController: *** Migrating Database=sonarr-main;Host=postgres14;Username=mySecret;Password=mySecret;Port=5432;Enlist=False ***")]
+ [TestCase(@"[Info] MigrationController: *** Migrating Database=sonarr-main;Host=postgres14;Username=mySecret;Password=mySecret;Port=5432;token=mySecret;Enlist=False&username=mySecret;mypassword=mySecret;mypass=shouldkeep1;test_token=mySecret;password=123%@%_@!#^#@;use_password=mySecret;get_token=shouldkeep2;usetoken=shouldkeep3;passwrd=mySecret;")]
// Announce URLs (passkeys) Magnet & Tracker
[TestCase(@"magnet_uri"":""magnet:?xt=urn:btih:9pr04sgkillroyimaveql2tyu8xyui&dn=&tr=https%3a%2f%2fxxx.yyy%2f9pr04sg601233210imaveql2tyu8xyui%2fannounce""}")]
@@ -90,9 +93,24 @@ namespace NzbDrone.Common.Test.InstrumentationTests
var cleansedMessage = CleanseLogMessage.Cleanse(message);
cleansedMessage.Should().NotContain("mySecret");
+ cleansedMessage.Should().NotContain("123%@%_@!#^#@");
cleansedMessage.Should().NotContain("01233210");
}
+ [TestCase(@"[Info] MigrationController: *** Migrating Database=sonarr-main;Host=postgres14;Username=mySecret;Password=mySecret;Port=5432;token=mySecret;Enlist=False&username=mySecret;mypassword=mySecret;mypass=shouldkeep1;test_token=mySecret;password=123%@%_@!#^#@;use_password=mySecret;get_token=shouldkeep2;usetoken=shouldkeep3;passwrd=mySecret;")]
+ public void should_keep_message(string message)
+ {
+ var cleansedMessage = CleanseLogMessage.Cleanse(message);
+
+ cleansedMessage.Should().NotContain("mySecret");
+ cleansedMessage.Should().NotContain("123%@%_@!#^#@");
+ cleansedMessage.Should().NotContain("01233210");
+
+ cleansedMessage.Should().Contain("shouldkeep1");
+ cleansedMessage.Should().Contain("shouldkeep2");
+ cleansedMessage.Should().Contain("shouldkeep3");
+ }
+
[TestCase(@"Some message (from 32.2.3.5 user agent)")]
[TestCase(@"Auth-Invalidated ip 32.2.3.5")]
[TestCase(@"Auth-Success ip 32.2.3.5")]
diff --git a/src/NzbDrone.Common.Test/ServiceFactoryFixture.cs b/src/NzbDrone.Common.Test/ServiceFactoryFixture.cs
index f543af256..58642f2e4 100644
--- a/src/NzbDrone.Common.Test/ServiceFactoryFixture.cs
+++ b/src/NzbDrone.Common.Test/ServiceFactoryFixture.cs
@@ -4,11 +4,13 @@ using DryIoc.Microsoft.DependencyInjection;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Options;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Composition.Extensions;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Instrumentation.Extensions;
+using NzbDrone.Core.Datastore;
using NzbDrone.Core.Datastore.Extensions;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.Messaging.Events;
@@ -29,7 +31,8 @@ namespace NzbDrone.Common.Test
.AddDummyDatabase()
.AddStartupContext(new StartupContext("first", "second"));
- container.RegisterInstance(new Mock().Object);
+ container.RegisterInstance(new Mock().Object);
+ container.RegisterInstance(new Mock>().Object);
var serviceProvider = container.GetServiceProvider();
diff --git a/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs b/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs
index defe1bde0..d0150a7bc 100644
--- a/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs
+++ b/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs
@@ -17,6 +17,7 @@ namespace NzbDrone.Common.Instrumentation
new (@"iptorrents\.com/[/a-z0-9?&;]*?(?:[?&;](u|tp)=(?[^&=;]+?))+(?= |;|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
new (@"/fetch/[a-z0-9]{32}/(?[a-z0-9]{32})", RegexOptions.Compiled),
new (@"getnzb.*?(?<=\?|&)(r)=(?[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
+ new (@"\b(\w*)?(_?(?[^&=]+?)(?= |&|$|;)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
// Trackers Announce Keys; Designed for Qbit Json; should work for all in theory
new (@"announce(\.php)?(/|%2f|%3fpasskey%3d)(?[a-z0-9]{16,})|(?[a-z0-9]{16,})(/|%2f)announce"),
diff --git a/src/NzbDrone.Core.Test/Datastore/DatabaseFixture.cs b/src/NzbDrone.Core.Test/Datastore/DatabaseFixture.cs
index 19631c00c..b24765caf 100644
--- a/src/NzbDrone.Core.Test/Datastore/DatabaseFixture.cs
+++ b/src/NzbDrone.Core.Test/Datastore/DatabaseFixture.cs
@@ -15,7 +15,7 @@ namespace NzbDrone.Core.Test.Datastore
public void SingleOrDefault_should_return_null_on_empty_db()
{
Mocker.Resolve()
- .OpenConnection().Query("SELECT * FROM Series")
+ .OpenConnection().Query("SELECT * FROM \"Series\"")
.SingleOrDefault()
.Should()
.BeNull();
@@ -27,6 +27,20 @@ namespace NzbDrone.Core.Test.Datastore
Mocker.Resolve().Vacuum();
}
+ [Test]
+ public void postgres_should_not_contain_timestamp_without_timezone_columns()
+ {
+ if (Db.DatabaseType != DatabaseType.PostgreSQL)
+ {
+ return;
+ }
+
+ Mocker.Resolve()
+ .OpenConnection().Query("SELECT table_name, column_name, data_type FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'public' AND data_type = 'timestamp without time zone'")
+ .Should()
+ .BeNullOrEmpty();
+ }
+
[Test]
public void get_version()
{
diff --git a/src/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs b/src/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs
index 4a1226e1d..e40f9a0fa 100644
--- a/src/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs
+++ b/src/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
using FizzWare.NBuilder;
@@ -15,6 +16,17 @@ namespace NzbDrone.Core.Test.Datastore
[TestFixture]
public class DatabaseRelationshipFixture : DbTest
{
+ [SetUp]
+ public void Setup()
+ {
+ AssertionOptions.AssertEquivalencyUsing(options =>
+ {
+ options.Using(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation.ToUniversalTime(), TimeSpan.FromMilliseconds(20))).WhenTypeIs();
+ options.Using(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation.Value.ToUniversalTime(), TimeSpan.FromMilliseconds(20))).WhenTypeIs();
+ return options;
+ });
+ }
+
[Test]
public void one_to_one()
{
diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/070_delay_profileFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/070_delay_profileFixture.cs
index bdc199f1f..90304067f 100644
--- a/src/NzbDrone.Core.Test/Datastore/Migration/070_delay_profileFixture.cs
+++ b/src/NzbDrone.Core.Test/Datastore/Migration/070_delay_profileFixture.cs
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Datastore.Migration;
@@ -26,12 +26,12 @@ namespace NzbDrone.Core.Test.Datastore.Migration
{
GrabDelay = 2,
Name = "TwoHours",
- Cutoff = "{}",
+ Cutoff = 0,
Items = "[]"
});
});
- var allProfiles = db.Query("SELECT * FROM DelayProfiles");
+ var allProfiles = db.Query("SELECT * FROM \"DelayProfiles\"");
allProfiles.Should().HaveCount(3);
allProfiles.Should().OnlyContain(c => c.PreferredProtocol == 1);
@@ -54,7 +54,7 @@ namespace NzbDrone.Core.Test.Datastore.Migration
});
});
- var tags = db.Query("SELECT * FROM Tags");
+ var tags = db.Query("SELECT * FROM \"Tags\"");
tags.Should().HaveCount(1);
tags.First().Label.Should().Be("delay-60");
@@ -83,17 +83,17 @@ namespace NzbDrone.Core.Test.Datastore.Migration
Status = 0,
Images = "[]",
Path = @"C:\Test\Series",
- Monitored = 1,
- SeasonFolder = 1,
- RunTime = 0,
+ Monitored = true,
+ SeasonFolder = true,
+ Runtime = 0,
SeriesType = 0,
- UseSceneNumbering = 0,
+ UseSceneNumbering = false,
Tags = "[1]"
});
});
- var tag = db.Query("SELECT Id, Label FROM Tags").Single();
- var series = db.Query("SELECT Tags FROM Series");
+ var tag = db.Query("SELECT \"Id\", \"Label\" FROM \"Tags\"").Single();
+ var series = db.Query("SELECT \"Tags\" FROM \"Series\"");
series.Should().HaveCount(1);
diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/071_unknown_quality_in_profileFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/071_unknown_quality_in_profileFixture.cs
index 4aa14402f..5f5d8b1c6 100644
--- a/src/NzbDrone.Core.Test/Datastore/Migration/071_unknown_quality_in_profileFixture.cs
+++ b/src/NzbDrone.Core.Test/Datastore/Migration/071_unknown_quality_in_profileFixture.cs
@@ -1,6 +1,8 @@
+using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
+using NzbDrone.Common.Serializer;
using NzbDrone.Core.Datastore.Migration;
using NzbDrone.Core.Test.Framework;
@@ -19,12 +21,19 @@ namespace NzbDrone.Core.Test.Datastore.Migration
Id = 0,
Name = "SDTV",
Cutoff = 1,
- Items = "[ { \"quality\": 1, \"allowed\": true } ]",
+ Items = new List