From 6fc8a03907c2354ea96618a17d1bb673c3cf68af Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Tue, 25 Feb 2025 11:22:11 +0100 Subject: [PATCH 1/2] feat: enable libcurl for znc-push Before enabling libcurl in znc-push, some notifications were not delivered, especially messages that were sent in burst. Working example: ``` <*push> Building notification to api.telegram.org/botXXX/sendMessage... <*push> Request sending <*push> Status: 200 <*push> Message: OK ... ``` Broken example: ``` <*push> Building notification to api.telegram.org/botXXX/sendMessage... <*push> Request sending ... ``` Ref: https://github.com/amyreese/znc-push/blob/master/README.md#advanced ``` Note: You are strongly encouraged to use libcurl transport. The reason for that is, that the default CSocket transport doesn't verify server's SSL certificate which leaves you vulnerable to MITM attacks. However, use of libcurl will block the main ZNC thread at every push notification; for installations with many users, libcurl is not yet ideal, even with the above security concerns in mind. ``` I subsequently enabled libcurl in push.cpp compilation. I could not modify the Makefile because it is overwritten for every module downloaded, but I could override the cpp file before building the module. After using libcurl, I could receive all the notifications sent by znc-push. --- Dockerfile | 2 ++ Dockerfile.aarch64 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index e63ba86..30bb970 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ RUN \ boost-dev\ build-base \ c-ares-dev \ + curl-dev \ cyrus-sasl-dev \ gettext-dev \ git \ @@ -55,6 +56,7 @@ RUN \ tar xf \ /tmp/znc-push.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ + sed -i '1i #define USE_CURL' /tmp/znc/modules/push.cpp && \ curl -o \ /tmp/znc-clientbuffer.tar.gz -L \ https://github.com/CyberShadow/znc-clientbuffer/archive/master.tar.gz && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index ebfa290..87c21ab 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -16,6 +16,7 @@ RUN \ boost-dev\ build-base \ c-ares-dev \ + curl-dev \ cyrus-sasl-dev \ gettext-dev \ git \ @@ -54,6 +55,7 @@ RUN \ tar xf \ /tmp/znc-push.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ + sed -i '1i #define USE_CURL' /tmp/znc/modules/push.cpp && \ curl -o \ /tmp/znc-clientbuffer.tar.gz -L \ https://github.com/CyberShadow/znc-clientbuffer/archive/master.tar.gz && \ From 42b066dff99a7158a2b5747ddc77b51109a80c31 Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Sun, 9 Mar 2025 19:04:38 +0100 Subject: [PATCH 2/2] chore: add changelog --- readme-vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/readme-vars.yml b/readme-vars.yml index f7cccc9..bcaf7d2 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -77,6 +77,7 @@ init_diagram: | "znc:latest" <- Base Images # changelog changelogs: + - {date: "09.03.25:", desc: "Enable libcurl for znc-push."} - {date: "10.06.24:", desc: "Migrate default config file to newer format."} - {date: "06.06.24:", desc: "Rebase to Alpine 3.20."} - {date: "26.03.24:", desc: "Switch back to multi-threaded builds and ignore `-beta` and `-alpha` tags as well as `-rc`."}