• Health tips to prevent the spread of COVID-19:
    • Wash your hands frequently;
    • Maintain 2 meters social distancing;
    • Minimise outdoor activities.
    Stay safe in your bubble!

Compile ZNC push mod for Igloo IRC

Andy

Administrator
User ID
1
Joined
7 Jan 2019
Messages
218
Reaction score
8
Points
18
Here's how to compile ZNC push mod for Igloo IRC 💡
Tested on ZNC 1.8.2 and it worked 👍

Rich (BB code):
[email protected]:~/.local/bin$ wget https://git.jordanko.ch/Igloo/Push/raw/master/Makefile
--2020-10-23 14:08:30--  https://git.jordanko.ch/Igloo/Push/raw/master/Makefile
Resolving git.jordanko.ch (git.jordanko.ch)... 52.204.108.200
Connecting to git.jordanko.ch (git.jordanko.ch)|52.204.108.200|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 393 [text/plain]
Saving to: ‘Makefile’

Makefile            100%[==================>]     393  --.-KB/s   in 0s

2020-10-23 14:08:31 (11.4 MB/s) - ‘Makefile’ saved [393/393]

[email protected]:~/.local/bin$ wget https://git.jordanko.ch/Igloo/Push/raw/master/push.cpp
--2020-10-23 11:01:48--  https://git.jordanko.ch/Igloo/Push/raw/master/push.cpp
Resolving git.jordanko.ch (git.jordanko.ch)... 52.204.108.200
Connecting to git.jordanko.ch (git.jordanko.ch)|52.204.108.200|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘push.cpp’

push.cpp                [  <=>              ]  51.01K   130KB/s   in 0.4s

2020-10-23 11:01:49 (130 KB/s) - ‘push.cpp’ saved [52230]

[email protected]:~/.local/bin$ ls -al
If you install ZNC from source using local user (not system-wide installation), you'll need to adjust line 14 (znc-buildmod path) similar with the Makefile below:
Bash:
version = $(shell git describe --dirty || echo dev)
curl=no

ifneq ($(curl),no)
        flags=-DUSE_CURL -lcurl
else
        flags=
endif

all: push.so

push.so: push.cpp
        CXXFLAGS="$(CXXFLAGS) -DPUSHVERSION=\"\\\"$(version)\\\"\" $(flags)" LIBS="$(LIBS) $(flags)" \
                $(HOME)/.local/bin/znc-buildmod push.cpp

install: push.so
        mkdir -p $(HOME)/.znc/modules/
        cp push.so $(HOME)/.znc/modules/push.so

clean:
        -rm -f push.so
Rich (BB code):
[email protected]:~/.local/bin$ make curl=yes
/bin/sh: git: command not found
CXXFLAGS=" -DPUSHVERSION=\"\\\"dev\\\"\" -DUSE_CURL -lcurl" LIBS=" -DUSE_CURL -lcurl" \
    /home/saputra/.local/bin/znc-buildmod push.cpp
Building "push.so" for ZNC 1.8.2... [ ok ]
[email protected]:~/.local/bin$ ls -al ~/.znc/modules/
total 8
drwxr-xr-x 2 saputra saputra 4096 Oct 23 14:13 .
drwx------ 6 saputra saputra 4096 Oct 23 10:44 ..
[email protected]:~/.local/bin$ cp push.so ~/.znc/modules/ -v
‘push.so’ -> ‘/home/saputra/.znc/modules/push.so’
[email protected]:~/.local/bin$ ls -al ~/.znc/modules/
total 208
drwxr-xr-x 2 saputra saputra   4096 Oct 23 14:15 .
drwx------ 6 saputra saputra   4096 Oct 23 10:44 ..
-rwxr-xr-x 1 saputra saputra 203848 Oct 23 14:15 push.so
[email protected]:~/.local/bin$
git: command not found can be safely ignored (won't miss any file)

To investigate errors:
/msg *push set debug on
Once done: /msg *push set debug off

Expected (normal) debug output:
Code:
[14:23:03] <Andy> send test
[14:23:03] <*push> service: igloo
[14:23:03] <*push> service_host: api.iglooirc.com
[14:23:03] <*push> service_url: /znc/push
[14:23:03] <*push> service_auth:
[14:23:03] <*push> use_port: 443
[14:23:03] <*push> use_ssl: 1
[14:23:03] <*push> use_post: 1
[14:23:03] <*push> using libcurl
[14:23:05] <*push> curl: HTTP status code 200
[14:23:05] <*push> Ok
znc push default configs:
znc push commands:
 
 Short URL:
Top