Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no jwt.so #2883

Closed
hance2010 opened this issue Oct 13, 2021 · 6 comments
Closed

There is no jwt.so #2883

hance2010 opened this issue Oct 13, 2021 · 6 comments

Comments

@hance2010
Copy link

Description

apt install kamailio kamailio-*

find /usr/lib/x86_64-linux-gnu/kamailio/modules -name jwt.so

and nothing.

Troubleshooting

Reproduction

Debugging Data

(paste your debugging data here)

Log Messages

(paste your log messages here)

SIP Traffic

(paste your sip traffic here)

Possible Solutions

Additional Information

  • Kamailio Version - output of kamailio -v
kamailio5.5.2
  • Operating System:
debian10
@miconda
Copy link
Member

miconda commented Oct 14, 2021

Maybe @linuxmaniac can comment on it -- not sure if the required library is available or simply not added to packaging.

@linuxmaniac
Copy link
Member

from the README at src/modules/jwt

2.2. External Libraries or Applications

   The following libraries or applications must be installed before
   running Kamailio with this module loaded:
     * libjwt - minimum version 1.12.0.

https://packages.debian.org/search?keywords=libjwt

1.10.2-1 is the last version packaged

@bvisonl
Copy link

bvisonl commented Mar 1, 2022

@hance2010 How did you fix this? I am having the same issue:

$ kamailio -v
version: kamailio 5.5.3 (x86_64/linux) 315b22
....
$ apt list libjwt*
libjwt-dev/testing,now 1.12.0-1~bullseye-bullseye amd64 [installed]
libjwt-gnutls-dev/stable 1.10.2-1 amd64
libjwt-gnutls0/stable 1.10.2-1 amd64
libjwt0-dbgsym/testing 1.12.0-1~bullseye-bullseye amd64
libjwt0/testing,now 1.12.0-1~bullseye-bullseye amd64 [installed,automatic]

OS: Debian 11

@bmlkc
Copy link

bmlkc commented Mar 2, 2022

jwt is not on debian packages unfortunately:

image

so, it won't magically appear when you just install libjwt as they state above. you can compile kamailio on deb11 and then move the jwt.so to your production until they notice this and add it to deb packaging finally.

note also the requirement of libjwt >= 1.12.0, which is probably why they don't have it as at least on buster they don't have an updated libjwt. centos has it however on epel.

@bmlkc
Copy link

bmlkc commented Mar 2, 2022

here is a builder for buster:

# build JWT
FROM debian:buster-slim AS jwt

RUN sed -i 's/httpredir/deb/g' /etc/apt/sources.list
# build tools
RUN rm -rf /var/lib/apt/lists/* && \
               apt-get update && \
               apt-get install --assume-yes gnupg wget git gcc g++ make flex bison autoconf pkg-config libssl-dev unzip libtool check 
 
# libjansson & libjwt
RUN apt-get install --assume-yes libjansson-dev && \
    cd /usr/local/src && \
    wget https://github.com/benmcollins/libjwt/archive/refs/tags/v1.12.1.zip && \
    unzip v1.12.1.zip && \
    cd libjwt-1.12.1 && \
    autoreconf -i && \
    ./configure && \
    make all && \
    make check && \
    make install

# kam compile
RUN mkdir -p /usr/local/src/kamailio-5.5 && \
    cd /usr/local/src/kamailio-5.5 && \
    git clone --depth 1 --no-single-branch https://github.com/kamailio/kamailio kamailio && \
    cd kamailio && \
    git checkout -b 5.5 origin/5.5 && \
    make PREFIX="/usr/local/kamailio-5.5" include_modules="jwt" cfg && \
    make Q=0 all && \
    make install 
 
# copy files from: 
# /usr/local/lib/libjwt.so*
# /usr/local/src/kamailio-5.5/kamailio/src/modules/jwt/jwt.so => /usr/lib/x86_64-linux-gnu/kamailio/modules/

notice no need to copy libjansson, assuming kamailio installed it for other json modules.

e.g. if you do a multi-stage:

COPY --from=jwt /usr/local/lib/libjwt.so* /usr/lib/x86_64-linux-gnu/
COPY --from=jwt /usr/local/src/kamailio-5.5/kamailio/src/modules/jwt/jwt.so /usr/lib/x86_64-linux-gnu/kamailio/modules/

@bvisonl
Copy link

bvisonl commented Mar 2, 2022

Sweet. Thanks. I ended up compiling Kamailio with the jwt module as you mentioned.

Thanks for the script @bmlkc !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants