Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/01_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ body:
label: NZBGet Version
description: Which version of NZBGet has this bug?
options:
- v25.4-testing
- v25.3-stable
- v25.2-stable
- v25.1-stable
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/03_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ body:
label: NZBGet Version
description: Version of NZBGet for the scope of this issue
options:
- v25.4-testing
- v25.3-stable
- v25.2-stable
- v25.1-stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
run: |
sudo mkdir -p /build
sudo chown $USER:$USER /build
curl -L https://github.com/nzbgetcom/build-files/releases/download/v3.0/android-unpack.tar.gz -o /build/unpack.tar.gz
curl -L https://github.com/nzbgetcom/build-files/releases/download/v4.0/android-unpack.tar.gz -o /build/unpack.tar.gz
tar zxf /build/unpack.tar.gz -C /build
- name: Download build artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
mkdir -p /build/lib
curl -L https://github.com/nzbgetcom/build-files/releases/download/v1.0/freebsd-sysroot.tar.gz -o /build/freebsd/sysroot.tar.gz
curl -L https://github.com/nzbgetcom/build-files/releases/download/v3.0/lib-x86_64-bsd.tar.gz -o /build/lib/lib.tar.gz
curl -L https://github.com/nzbgetcom/build-files/releases/download/v3.0/freebsd-unpack.tar.gz -o /build/unpack.tar.gz
curl -L https://github.com/nzbgetcom/build-files/releases/download/v4.0/freebsd-unpack.tar.gz -o /build/unpack.tar.gz
tar zxf /build/freebsd/sysroot.tar.gz -C /build/freebsd
tar zxf /build/lib/lib.tar.gz -C /build/lib
tar zxf /build/unpack.tar.gz -C /build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
run: |
sudo mkdir -p /build
sudo chown $USER:$USER /build
curl -L https://github.com/nzbgetcom/build-files/releases/download/v3.0/linux-unpack.tar.gz -o /build/unpack.tar.gz
curl -L https://github.com/nzbgetcom/build-files/releases/download/v4.0/linux-unpack.tar.gz -o /build/unpack.tar.gz
tar zxf /build/unpack.tar.gz -C /build

- name: Download build artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
Invoke-WebRequest https://github.com/nzbgetcom/build-files/releases/download/v3.0/vcpkg-windows-x${{ matrix.arch }}.zip -OutFile "${{ github.workspace }}\vcpkg.zip"
Rename-Item -path "C:\vcpkg" -NewName "C:\vcpkg.old"
Expand-Archive -Path "${{ github.workspace }}\vcpkg.zip" -DestinationPath C:\
Invoke-WebRequest https://github.com/nzbgetcom/build-files/releases/download/v3.0/nzbget-windows-tools.zip -OutFile "${{ github.workspace }}\tools.zip"
Invoke-WebRequest https://github.com/nzbgetcom/build-files/releases/download/v4.0/nzbget-windows-tools.zip -OutFile "${{ github.workspace }}\tools.zip"
Expand-Archive -Path "${{ github.workspace }}\tools.zip" -DestinationPath C:\

- name: Build nzbget ${{ matrix.arch }}-bit / ${{ matrix.type }} binary
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Prepare build environment
run: |
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://github.com/nzbgetcom/build-files/releases/download/v3.0/nzbget-windows-tools.zip -OutFile "${{ github.workspace }}\tools.zip"
Invoke-WebRequest https://github.com/nzbgetcom/build-files/releases/download/v4.0/nzbget-windows-tools.zip -OutFile "${{ github.workspace }}\tools.zip"
Expand-Archive -Path "${{ github.workspace }}\tools.zip" -DestinationPath C:\
New-Item build -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
Copy-Item Release* build -Recurse -ErrorAction SilentlyContinue
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not allowed. You should create separate directory for build files.")
endif()

set(VERSION "25.3")
set(VERSION "25.4")
set(PACKAGE "nzbget")
set(LIBS "")
set(INCLUDES ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
Expand All @@ -16,6 +16,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" VERSION_MATCH ${VERSION})
set(VERSION_MAJOR ${CMAKE_MATCH_1})
Expand Down
21 changes: 20 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
nzbget-v25.4
- Features:
- Added TLS 1.3 cipher suite support via ServerX.Cipher option
[#658](https://github.com/nzbgetcom/nzbget/pull/658) [#665](https://github.com/nzbgetcom/nzbget/pull/665);
- Enabled the search bar on small screens in web UI
[#656](https://github.com/nzbgetcom/nzbget/pull/656).

- Bug fixes:
- Fixed the Scan script API
[#663](https://github.com/nzbgetcom/nzbget/pull/663);
- Fixed RSS feed category reading and applying when the category is set via filter rules
[#654](https://github.com/nzbgetcom/nzbget/pull/654);
- Fixed the JSON value parsing and the "testserver" API method
[#666](https://github.com/nzbgetcom/nzbget/pull/666).

- For developers:
- Updated 7-Zip to 25.01
[#655](https://github.com/nzbgetcom/nzbget/pull/655).

nzbget-v25.3
- Features:
- Automatic category detection from NZB file metadata
Expand All @@ -10,7 +29,7 @@ nzbget-v25.3
This allows for immediate access to files during the unpacking process
[#617](https://github.com/nzbgetcom/nzbget/pull/617).

- Bug fixes
- Bug fixes:
- Fixed macOS x64 Mojave support
[#613](https://github.com/nzbgetcom/nzbget/pull/613).

Expand Down
2 changes: 1 addition & 1 deletion cmake/posix.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
option(ENABLE_STATIC "Build static executable")
option(ENABLE_TESTS "Build tests")
option(ENABLE_CLANG_TIDY "Enable Clang-Tidy static analizer")
option(ENABLE_CLANG_TIDY "Enable Clang-Tidy static analyzer")
option(ENABLE_SANITIZERS "Enable leak, undefined, address sanitizers")
option(DISABLE_TLS "Disable TLS")
option(DISABLE_CURSES "Disable curses")
Expand Down
28 changes: 26 additions & 2 deletions daemon/connect/TlsSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ bool TlsSocket::Start()
return false;
}

if (!m_cipher.empty() && !SSL_set_cipher_list(m_session.get(), m_cipher.c_str()))
if (!SetCipherSuite(m_cipher))
{
ReportError("Could not select cipher for TLS", false);
ReportError("Could not set cipher suite for SSL/TLS connection", false);
Close();
return false;
}
Expand Down Expand Up @@ -209,10 +209,34 @@ bool TlsSocket::Start()
return false;
}

const SSL_CIPHER* currentCipher = SSL_get_current_cipher(m_session.get());
if (currentCipher != nullptr)
{
const char* protocolVersion = SSL_get_version(m_session.get());
const char* cipherName = SSL_CIPHER_get_name(currentCipher);
debug("TLS connection established: %s using %s", protocolVersion, cipherName);
}

m_connected = true;
return true;
}

bool TlsSocket::SetCipherSuite(std::string_view cipher)
{
if (cipher.empty())
{
return true;
}

bool tls13 = SSL_set_ciphersuites(m_session.get(), cipher.data());
bool legacy = SSL_set_cipher_list(m_session.get(), cipher.data());

if (!tls13)
ERR_clear_error();

return tls13 || legacy;
}

bool TlsSocket::ValidateCert()
{
// verify a server certificate was presented during the negotiation
Expand Down
12 changes: 12 additions & 0 deletions daemon/connect/TlsSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ class TlsSocket
static void InitX509Store(std::string_view certStore);
static OpenSSL::X509StorePtr m_X509Store;

/**
* This function configures the allowed ciphers for both TLSv1.3 and
* older protocols from a single, combined string. OpenSSL
* will parse the string and apply the relevant ciphers to their
* respective protocol versions.
*
* * @note This implementation allows a mixed list, but TLSv1.3 ciphers will
* always be preferred during the handshake if the server supports them,
* regardless of their order in the string.
*/
bool SetCipherSuite(std::string_view cipher);

SOCKET m_socket;

std::string m_host;
Expand Down
15 changes: 6 additions & 9 deletions daemon/extension/ScanScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ void ScanScriptController::ExecuteScripts(
const char* nzbFilename,
NzbInfo* nzbInfo,
const char* directory,
const char* nzbName,
const char* category,
std::string& nzbName,
std::string& category,
int* priority,
NzbParameterList* parameters,
bool* addTop,
bool* addPaused,
const char* dupeKey,
std::string& dupeKey,
int* dupeScore,
EDupeMode* dupeMode)
{
Expand All @@ -61,26 +61,23 @@ void ScanScriptController::ExecuteScripts(
return;
}

ScanScriptController scriptController;
ScanScriptController scriptController(nzbName, category, dupeKey);
scriptController.m_nzbFilename = nzbFilename;
scriptController.m_url = nzbInfo ? nzbInfo->GetUrl() : "";
scriptController.m_directory = directory;
scriptController.m_nzbName = nzbName ? nzbName : "";
scriptController.m_category = category ? category : "";
scriptController.m_parameters = parameters;
scriptController.m_priority = priority;
scriptController.m_addTop = addTop;
scriptController.m_addPaused = addPaused;
scriptController.m_dupeKey = dupeKey ? dupeKey : "";
scriptController.m_dupeScore = dupeScore;
scriptController.m_dupeMode = dupeMode;
scriptController.m_prefixLen = 0;

const char* extensions = g_Options->GetExtensions();

if (!Util::EmptyStr(category))
if (!category.empty())
{
Options::Category* categoryObj = g_Options->FindCategory(category, false);
Options::Category* categoryObj = g_Options->FindCategory(category.c_str(), false);
if (categoryObj && !Util::EmptyStr(categoryObj->GetExtensions()))
{
extensions = categoryObj->GetExtensions();
Expand Down
40 changes: 32 additions & 8 deletions daemon/extension/ScanScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,54 @@
class ScanScriptController : public NzbScriptController
{
public:
static void ExecuteScripts(const char* nzbFilename, NzbInfo* nzbInfo,
const char* directory, const char* nzbName, const char* category, int* priority,
NzbParameterList* parameters, bool* addTop, bool* addPaused,
const char* dupeKey, int* dupeScore, EDupeMode* dupeMode);
ScanScriptController(
std::string& nzbName,
std::string& category,
std::string& dupeKey)
: m_nzbName{ nzbName }
, m_category{ category }
, m_dupeKey{ dupeKey } {}

static void ExecuteScripts(
const char* nzbFilename,
NzbInfo* nzbInfo,
const char* directory,
std::string& nzbName,
std::string& category,
int* priority,
NzbParameterList* parameters,
bool* addTop,
bool* addPaused,
std::string& dupeKey,
int* dupeScore,
EDupeMode* dupeMode);
static bool HasScripts();

protected:
void ExecuteScript(std::shared_ptr<const Extension::Script> script) override;
void AddMessage(Message::EKind kind, const char* text) override;

void SetPriority(int* priority) { m_priority = priority; }
void SetDupeScore(int* dupeScore) { m_dupeScore = dupeScore; }
void SetDupeMode(EDupeMode* dupeMode) { m_dupeMode = dupeMode; }
void SetAddTop(bool* addTop) { m_addTop = addTop; }
void SetAddPaused(bool* addPaused) { m_addPaused = addPaused; }
void SetParameters(NzbParameterList* parameters) { m_parameters = parameters; }

private:
const char* m_nzbFilename;
const char* m_url;
const char* m_directory;
std::string m_nzbName;
std::string m_category;
std::string m_dupeKey;
std::string& m_nzbName;
std::string& m_category;
std::string& m_dupeKey;
int* m_priority;
int* m_dupeScore;
bool* m_addTop;
bool* m_addPaused;
EDupeMode* m_dupeMode;
NzbParameterList* m_parameters;
int m_prefixLen;
int m_prefixLen = 0;

void PrepareParams(const char* scriptName);
};
Expand Down
Loading