Jitsi-meet-tokens unable to install

Hello Guys,

I am new here and first I would like to thank you for the great work you’re doing. It’s an amazing app, which (with the config I did for now) is working like a charm.
But now I tried to install jitsi-meet-tokens to use JWT auth, but after many hours spending on it I can’t get it work…
I tried many things to get jitsi-meet-tokens to run, according to https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md

First I tried with the latest
jitsi-meet/stable,now 2.0.4384-1 all [installed]
and
prosody/stable,now 0.11.5-1~buster6 amd64 [installed].

The result:

root@vc:/home/rocket# apt-get install jitsi-meet-tokens
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  lua-bitop
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libssl-dev lua-any luarocks unzip zip
Suggested packages:
  libssl-doc
The following NEW packages will be installed:
  jitsi-meet-tokens libssl-dev lua-any luarocks unzip zip
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2,308 kB of archives.
After this operation, 10.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package libssl-dev:amd64.
(Reading database ... 44691 files and directories currently installed.)
Preparing to unpack .../0-libssl-dev_1.1.1d-0+deb10u2_amd64.deb ...
Unpacking libssl-dev:amd64 (1.1.1d-0+deb10u2) ...
Selecting previously unselected package lua-any.
Preparing to unpack .../1-lua-any_25_all.deb ...
Unpacking lua-any (25) ...
Selecting previously unselected package zip.
Preparing to unpack .../2-zip_3.0-11+b1_amd64.deb ...
Unpacking zip (3.0-11+b1) ...
Selecting previously unselected package unzip.
Preparing to unpack .../3-unzip_6.0-23+deb10u1_amd64.deb ...
Unpacking unzip (6.0-23+deb10u1) ...
Selecting previously unselected package luarocks.
Preparing to unpack .../4-luarocks_2.4.2+dfsg-1_all.deb ...
Unpacking luarocks (2.4.2+dfsg-1) ...
Selecting previously unselected package jitsi-meet-tokens.
Preparing to unpack .../5-jitsi-meet-tokens_1.0.3969-1_all.deb ...
Unpacking jitsi-meet-tokens (1.0.3969-1) ...
Setting up unzip (6.0-23+deb10u1) ...
Setting up lua-any (25) ...
Setting up zip (3.0-11+b1) ...
Setting up libssl-dev:amd64 (1.1.1d-0+deb10u2) ...
Setting up luarocks (2.4.2+dfsg-1) ...
Making manifest for /usr/local/lib/luarocks/rocks
Warning: This looks like a local rocks tree, but you did not pass --local-tree.
Generating index.html for /usr/local/lib/luarocks/rocks
Setting up jitsi-meet-tokens (1.0.3969-1) ...
Installing https://luarocks.org/luajwtjitsi-1.3-7.rockspec
Missing dependencies for luajwtjitsi 1.3-7:
   luacrypto >= 0.3.2-1 (not installed)
   lua-cjson >= 2.1.0 (not installed)
   lbase64 >= 20120807-3 (not installed)

luajwtjitsi 1.3-7 depends on luacrypto >= 0.3.2-1 (not installed)
Installing https://luarocks.org/luacrypto-0.3.2-2.src.rock
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/lcrypto.c -o src/lcrypto.o -I/usr/include
src/lcrypto.c: In function ‘digest_pnew’:
src/lcrypto.c:81:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’ {aka ‘struct evp_md_ctx_st’}
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘digest_reset’:
src/lcrypto.c:120:10: warning: implicit declaration of function ‘EVP_MD_CTX_cleanup’; did you mean ‘EVP_MD_CTX_create’? [-Wimplicit-function-declaration]
     if (!EVP_MD_CTX_cleanup(c))
          ^~~~~~~~~~~~~~~~~~
          EVP_MD_CTX_create
src/lcrypto.c: In function ‘encrypt_pnew’:
src/lcrypto.c:331:69: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     EVP_CIPHER_CTX *c = (EVP_CIPHER_CTX *)lua_newuserdata(L, sizeof(EVP_CIPHER_CTX));
                                                                     ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘encrypt_fencrypt’:
src/lcrypto.c:425:20: error: storage size of ‘c’ isn’t known
     EVP_CIPHER_CTX c;
                    ^
src/lcrypto.c: In function ‘decrypt_pnew’:
src/lcrypto.c:470:69: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     EVP_CIPHER_CTX *c = (EVP_CIPHER_CTX *)lua_newuserdata(L, sizeof(EVP_CIPHER_CTX));
                                                                     ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘decrypt_fdecrypt’:
src/lcrypto.c:561:20: error: storage size of ‘c’ isn’t known
     EVP_CIPHER_CTX c;
                    ^
src/lcrypto.c: In function ‘hmac_pnew’:
src/lcrypto.c:604:57: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’ {aka ‘struct hmac_ctx_st’}
     HMAC_CTX *c = (HMAC_CTX *)lua_newuserdata(L, sizeof(HMAC_CTX));
                                                         ^~~~~~~~
src/lcrypto.c: In function ‘hmac_fnew’:
src/lcrypto.c:621:5: warning: implicit declaration of function ‘HMAC_CTX_init’; did you mean ‘HMAC_CTX_new’? [-Wimplicit-function-declaration]
     HMAC_CTX_init(c);
     ^~~~~~~~~~~~~
     HMAC_CTX_new
src/lcrypto.c: In function ‘hmac_clone’:
src/lcrypto.c:631:5: error: dereferencing pointer to incomplete type ‘HMAC_CTX’ {aka ‘struct hmac_ctx_st’}
     *d = *c;
     ^~
src/lcrypto.c: In function ‘hmac_gc’:
src/lcrypto.c:697:5: warning: implicit declaration of function ‘HMAC_CTX_cleanup’; did you mean ‘HMAC_CTX_get_md’? [-Wimplicit-function-declaration]
     HMAC_CTX_cleanup(c);
     ^~~~~~~~~~~~~~~~
     HMAC_CTX_get_md
src/lcrypto.c: In function ‘hmac_fdigest’:
src/lcrypto.c:711:14: error: storage size of ‘c’ isn’t known
     HMAC_CTX c;
              ^
src/lcrypto.c: In function ‘sign_pnew’:
src/lcrypto.c:747:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’ {aka ‘struct evp_md_ctx_st’}
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘sign_fsign’:
src/lcrypto.c:828:20: error: storage size of ‘c’ isn’t known
         EVP_MD_CTX c;
                    ^
src/lcrypto.c: In function ‘verify_pnew’:
src/lcrypto.c:857:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’ {aka ‘struct evp_md_ctx_st’}
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘verify_fverify’:
src/lcrypto.c:940:20: error: storage size of ‘c’ isn’t known
         EVP_MD_CTX c;
                    ^
src/lcrypto.c: In function ‘rand_pseudo_bytes’:
src/lcrypto.c:992:5: warning: ‘RAND_pseudo_bytes’ is deprecated [-Wdeprecated-declarations]
     return rand_do_bytes(L, RAND_pseudo_bytes);
     ^~~~~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/rand.h:44:1: note: declared here
 DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
 ^~~~~~~~~~~~~~~~~~
src/lcrypto.c: In function ‘pkey_generate’:
src/lcrypto.c:1064:9: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
         RSA *rsa = RSA_generate_key(key_len, RSA_F4, NULL, NULL);
         ^~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/rsa.h:234:1: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^~~~~~~~~~~~~~~~~~
src/lcrypto.c:1074:9: warning: ‘DSA_generate_parameters’ is deprecated [-Wdeprecated-declarations]
         DSA *dsa = DSA_generate_parameters(key_len, NULL, 0, NULL, NULL, NULL, NULL);
         ^~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/dsa.h:117:1: note: declared here
 DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
 ^~~~~~~~~~~~~~~~~~
src/lcrypto.c: In function ‘pkey_to_pem’:
src/lcrypto.c:1164:27: error: dereferencing pointer to incomplete type ‘struct evp_pkey_st’
     if (private && pkey_st->type == EVP_PKEY_DSA)
                           ^~
src/lcrypto.c: In function ‘pkey_tostring’:
src/lcrypto.c:1277:60: error: dereferencing pointer to incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
     sprintf(buf, "%s %s %d %p", LUACRYPTO_PKEYNAME, (*pkey)->type == EVP_PKEY_DSA ? "DSA" : "RSA", EVP_PKEY_bits(*pkey), pkey);
                                                            ^~
src/lcrypto.c: In function ‘seal_pnew’:
src/lcrypto.c:1299:46: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     c->ctx = (EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX));
                                              ^~~~~~~~~~~~~~
In file included from src/lcrypto.c:8:
src/lcrypto.c: In function ‘seal_tostring’:
src/lcrypto.c:1320:81: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     sprintf(s, "%s %p %s", LUACRYPTO_SEALNAME, (void *)c, EVP_CIPHER_name(c->ctx->cipher));
                                                                                 ^~
src/lcrypto.c: In function ‘seal_fseal’:
src/lcrypto.c:1400:20: error: storage size of ‘ctx’ isn’t known
     EVP_CIPHER_CTX ctx;
                    ^~~
src/lcrypto.c: In function ‘open_pnew’:
src/lcrypto.c:1483:46: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     c->ctx = (EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX));
                                              ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘open_fopen’:
src/lcrypto.c:1602:20: error: storage size of ‘ctx’ isn’t known
     EVP_CIPHER_CTX ctx;
                    ^~~

Error: Failed installing dependency: https://luarocks.org/luacrypto-0.3.2-2.src.rock - Build error: Failed compiling object src/lcrypto.o
Failed to install luajwtjitsi - try installing it manually
Installing https://luarocks.org/basexx-0.4.1-1.rockspec
Warning: /usr/local/share/lua/5.1/basexx.lua is not tracked by this installation of LuaRocks. Moving it to /usr/local/share/lua/5.1/basexx.lua~~
basexx 0.4.1-1 is now installed in /usr/local (license: MIT)

Processing triggers for mime-support (3.62) ...
Processing triggers for man-db (2.8.5-2) ...

When I manually do apt-get install liblua5.2-0 liblua5.2-dev its the same.

With: prosody-trunk/stable,now 1nightly1247-1~buster amd64 [installed]

root@vc:/home/rocket# apt-get install jitsi-meet-tokens
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libssl-dev lua-any luarocks unzip zip
Suggested packages:
  libssl-doc
The following NEW packages will be installed:
  jitsi-meet-tokens libssl-dev lua-any luarocks unzip zip
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2,308 kB of archives.
After this operation, 10.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package libssl-dev:amd64.
(Reading database ... 44695 files and directories currently installed.)
Preparing to unpack .../0-libssl-dev_1.1.1d-0+deb10u2_amd64.deb ...
Unpacking libssl-dev:amd64 (1.1.1d-0+deb10u2) ...
Selecting previously unselected package lua-any.
Preparing to unpack .../1-lua-any_25_all.deb ...
Unpacking lua-any (25) ...
Selecting previously unselected package zip.
Preparing to unpack .../2-zip_3.0-11+b1_amd64.deb ...
Unpacking zip (3.0-11+b1) ...
Selecting previously unselected package unzip.
Preparing to unpack .../3-unzip_6.0-23+deb10u1_amd64.deb ...
Unpacking unzip (6.0-23+deb10u1) ...
Selecting previously unselected package luarocks.
Preparing to unpack .../4-luarocks_2.4.2+dfsg-1_all.deb ...
Unpacking luarocks (2.4.2+dfsg-1) ...
Selecting previously unselected package jitsi-meet-tokens.
Preparing to unpack .../5-jitsi-meet-tokens_1.0.3969-1_all.deb ...
Unpacking jitsi-meet-tokens (1.0.3969-1) ...
Setting up unzip (6.0-23+deb10u1) ...
Setting up lua-any (25) ...
Setting up zip (3.0-11+b1) ...
Setting up libssl-dev:amd64 (1.1.1d-0+deb10u2) ...
Setting up luarocks (2.4.2+dfsg-1) ...
Making manifest for /usr/local/lib/luarocks/rocks
Warning: This looks like a local rocks tree, but you did not pass --local-tree.
Generating index.html for /usr/local/lib/luarocks/rocks
Setting up jitsi-meet-tokens (1.0.3969-1) ...
Installing https://luarocks.org/luajwtjitsi-1.3-7.rockspec
Missing dependencies for luajwtjitsi 1.3-7:
   luacrypto >= 0.3.2-1 (not installed)
   lua-cjson >= 2.1.0 (not installed)
   lbase64 >= 20120807-3 (not installed)

luajwtjitsi 1.3-7 depends on luacrypto >= 0.3.2-1 (not installed)
Installing https://luarocks.org/luacrypto-0.3.2-2.src.rock
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/lcrypto.c -o src/lcrypto.o -I/usr/include
src/lcrypto.c: In function ‘digest_pnew’:
src/lcrypto.c:81:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’ {aka ‘struct evp_md_ctx_st’}
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘digest_reset’:
src/lcrypto.c:120:10: warning: implicit declaration of function ‘EVP_MD_CTX_cleanup’; did you mean ‘EVP_MD_CTX_create’? [-Wimplicit-function-declaration]
     if (!EVP_MD_CTX_cleanup(c))
          ^~~~~~~~~~~~~~~~~~
          EVP_MD_CTX_create
src/lcrypto.c: In function ‘encrypt_pnew’:
src/lcrypto.c:331:69: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     EVP_CIPHER_CTX *c = (EVP_CIPHER_CTX *)lua_newuserdata(L, sizeof(EVP_CIPHER_CTX));
                                                                     ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘encrypt_fencrypt’:
src/lcrypto.c:425:20: error: storage size of ‘c’ isn’t known
     EVP_CIPHER_CTX c;
                    ^
src/lcrypto.c: In function ‘decrypt_pnew’:
src/lcrypto.c:470:69: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     EVP_CIPHER_CTX *c = (EVP_CIPHER_CTX *)lua_newuserdata(L, sizeof(EVP_CIPHER_CTX));
                                                                     ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘decrypt_fdecrypt’:
src/lcrypto.c:561:20: error: storage size of ‘c’ isn’t known
     EVP_CIPHER_CTX c;
                    ^
src/lcrypto.c: In function ‘hmac_pnew’:
src/lcrypto.c:604:57: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’ {aka ‘struct hmac_ctx_st’}
     HMAC_CTX *c = (HMAC_CTX *)lua_newuserdata(L, sizeof(HMAC_CTX));
                                                         ^~~~~~~~
src/lcrypto.c: In function ‘hmac_fnew’:
src/lcrypto.c:621:5: warning: implicit declaration of function ‘HMAC_CTX_init’; did you mean ‘HMAC_CTX_new’? [-Wimplicit-function-declaration]
     HMAC_CTX_init(c);
     ^~~~~~~~~~~~~
     HMAC_CTX_new
src/lcrypto.c: In function ‘hmac_clone’:
src/lcrypto.c:631:5: error: dereferencing pointer to incomplete type ‘HMAC_CTX’ {aka ‘struct hmac_ctx_st’}
     *d = *c;
     ^~
src/lcrypto.c: In function ‘hmac_gc’:
src/lcrypto.c:697:5: warning: implicit declaration of function ‘HMAC_CTX_cleanup’; did you mean ‘HMAC_CTX_get_md’? [-Wimplicit-function-declaration]
     HMAC_CTX_cleanup(c);
     ^~~~~~~~~~~~~~~~
     HMAC_CTX_get_md
src/lcrypto.c: In function ‘hmac_fdigest’:
src/lcrypto.c:711:14: error: storage size of ‘c’ isn’t known
     HMAC_CTX c;
              ^
src/lcrypto.c: In function ‘sign_pnew’:
src/lcrypto.c:747:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’ {aka ‘struct evp_md_ctx_st’}
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘sign_fsign’:
src/lcrypto.c:828:20: error: storage size of ‘c’ isn’t known
         EVP_MD_CTX c;
                    ^
src/lcrypto.c: In function ‘verify_pnew’:
src/lcrypto.c:857:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’ {aka ‘struct evp_md_ctx_st’}
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘verify_fverify’:
src/lcrypto.c:940:20: error: storage size of ‘c’ isn’t known
         EVP_MD_CTX c;
                    ^
src/lcrypto.c: In function ‘rand_pseudo_bytes’:
src/lcrypto.c:992:5: warning: ‘RAND_pseudo_bytes’ is deprecated [-Wdeprecated-declarations]
     return rand_do_bytes(L, RAND_pseudo_bytes);
     ^~~~~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/rand.h:44:1: note: declared here
 DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
 ^~~~~~~~~~~~~~~~~~
src/lcrypto.c: In function ‘pkey_generate’:
src/lcrypto.c:1064:9: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
         RSA *rsa = RSA_generate_key(key_len, RSA_F4, NULL, NULL);
         ^~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/rsa.h:234:1: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^~~~~~~~~~~~~~~~~~
src/lcrypto.c:1074:9: warning: ‘DSA_generate_parameters’ is deprecated [-Wdeprecated-declarations]
         DSA *dsa = DSA_generate_parameters(key_len, NULL, 0, NULL, NULL, NULL, NULL);
         ^~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/dsa.h:117:1: note: declared here
 DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
 ^~~~~~~~~~~~~~~~~~
src/lcrypto.c: In function ‘pkey_to_pem’:
src/lcrypto.c:1164:27: error: dereferencing pointer to incomplete type ‘struct evp_pkey_st’
     if (private && pkey_st->type == EVP_PKEY_DSA)
                           ^~
src/lcrypto.c: In function ‘pkey_tostring’:
src/lcrypto.c:1277:60: error: dereferencing pointer to incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
     sprintf(buf, "%s %s %d %p", LUACRYPTO_PKEYNAME, (*pkey)->type == EVP_PKEY_DSA ? "DSA" : "RSA", EVP_PKEY_bits(*pkey), pkey);
                                                            ^~
src/lcrypto.c: In function ‘seal_pnew’:
src/lcrypto.c:1299:46: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     c->ctx = (EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX));
                                              ^~~~~~~~~~~~~~
In file included from src/lcrypto.c:8:
src/lcrypto.c: In function ‘seal_tostring’:
src/lcrypto.c:1320:81: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     sprintf(s, "%s %p %s", LUACRYPTO_SEALNAME, (void *)c, EVP_CIPHER_name(c->ctx->cipher));
                                                                                 ^~
src/lcrypto.c: In function ‘seal_fseal’:
src/lcrypto.c:1400:20: error: storage size of ‘ctx’ isn’t known
     EVP_CIPHER_CTX ctx;
                    ^~~
src/lcrypto.c: In function ‘open_pnew’:
src/lcrypto.c:1483:46: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
     c->ctx = (EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX));
                                              ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘open_fopen’:
src/lcrypto.c:1602:20: error: storage size of ‘ctx’ isn’t known
     EVP_CIPHER_CTX ctx;
                    ^~~

Error: Failed installing dependency: https://luarocks.org/luacrypto-0.3.2-2.src.rock - Build error: Failed compiling object src/lcrypto.o
Failed to install luajwtjitsi - try installing it manually
Installing https://luarocks.org/basexx-0.4.1-1.rockspec
Warning: /usr/local/share/lua/5.1/basexx.lua is not tracked by this installation of LuaRocks. Moving it to /usr/local/share/lua/5.1/basexx.lua~
basexx 0.4.1-1 is now installed in /usr/local (license: MIT)

Processing triggers for mime-support (3.62) ...
Processing triggers for man-db (2.8.5-2) ...

I even tried:
apt install git cmake lua5.1-dev luarocks
AND after removing that
apt install git cmake lua5.2-dev luarocks

the result is the same, it’s not working:

git clone https://github.com/evanlabs/luacrypto
cd luacrypto
/srv/luacrypto# luarocks make
Warning: unmatched variable INCONCERT_DEVEL
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CRYPTO_LIBRARY
    linked by target "crypto" in directory /srv/luacrypto
OPENSSL_INCLUDE_DIR
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
   used as include directory in directory /srv/luacrypto
SSL_LIBRARY
    linked by target "crypto" in directory /srv/luacrypto

-- Configuring incomplete, errors occurred!
See also "/srv/luacrypto/build.luarocks/CMakeFiles/CMakeOutput.log".

Error: Build error: Failed cmake.

I am running the latest debian stable and installed everything from their repos.

Now I went back to prosody stable and removed jitsi-meet-tokens.
I really would appreciate your help. Seems like something is messed up with the dependencies…

Greetz :slight_smile:

Just found out some interesting facts.
jitsi-meet-tokens depends on luajwtjitsi, and luajwtjitsi depends on luacrypto luajwtjitsi 1.3-7 depends on luacrypto >= 0.3.2-1.
I am using lua5.2 and luarocks fails to compile luacrypto.
As written here: https://luarocks.org/modules/starius/luacrypto it seems that it was just tested on lua5.1 and is compatible to lua5.0. Latest Prosody requires lua5.2.

Looking at the github project https://github.com/starius/luacrypto it says, that “this project is deprecated, use luaossl”. Was wondering while the latest commit for a crypto lib was three years ago :smiley:

Looking at https://luarocks.org/modules/daurnimator/luaossl it says, that it’s
a dependency for jwt-jitsi.
Ok, guess what, tried to install jwt-jitsi, as luajwtjitsi, which is deprecated also? and installing with jitsi-meet-tokens does not work. It seems to work jwt-jitsi 0.6-2 is now installed in /usr/local .

Installing luajwt on the other side fails, because it is depending on luacrypto.

Gonna test this setup now, but it seems that apt-get install jitsi-meet-tokens is just installing luajwtjitsi but should install jwt-jitsi.

Steps done by me to get apt-get install jitsi-meet-tokens run without failures:
echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/prosody.list
wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add -
update Prosody (because the debian stable prosody uses lua5.1, which was not working) and then
apt-get install libssl-dev
apt-get install luarocks
apt-get install liblua5.2-0
apt-get install liblua5.2-dev
luarocks install luaossl
luarocks install jwt-jitsi
apt-get install jitsi-meet-tokens

Unfortunately it fails starting prosody with the new module, seems like luajwtjitsi is somewhere hardcoded when using “token_verification”:

Apr 06 17:11:40 ***  prosody[12845]: modulemanager: Error initializing module 'token_verification' on 'conference.*** ': /usr/lib/prosody/util/startup.lua:199: module 'luajwtjitsi' not found:No LuaRocks module found for luajwtjitsi
                                                  no field package.preload['luajwtjitsi']
                                                  no file '/usr/lib/prosody/luajwtjitsi.lua'
                                                  no file '/usr/local/share/lua/5.2/luajwtjitsi.lua'
                                                  no file '/usr/local/share/lua/5.2/luajwtjitsi/init.lua'
                                                  no file '/usr/local/lib/lua/5.2/luajwtjitsi.lua'
                                                  no file '/usr/local/lib/lua/5.2/luajwtjitsi/init.lua'
                                                  no file '/usr/share/lua/5.2/luajwtjitsi.lua'
                                                  no file '/usr/share/lua/5.2/luajwtjitsi/init.lua'
                                                  no file '/var/lib/prosody/.luarocks/share/lua/5.2/luajwtjitsi.lua'
                                                  no file '/var/lib/prosody/.luarocks/share/lua/5.2/luajwtjitsi/init.lua'
                                                  no file '/usr/lib/prosody/luajwtjitsi.so'
                                                  no file '/usr/local/lib/lua/5.2/luajwtjitsi.so'
                                                  no file '/usr/lib/x86_64-linux-gnu/lua/5.2/luajwtjitsi.so'
                                                  no file '/usr/lib/lua/5.2/luajwtjitsi.so'
                                                  no file '/usr/local/lib/lua/5.2/loadall.so'
                                                  no file '/var/lib/prosody/.luarocks/lib/lua/5.2/luajwtjitsi.so'
                                          stack traceback:
                                                  [C]: in function '_real_require'
                                                  /usr/lib/prosody/util/startup.lua:199: in function 'require'
                                                  /usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:7: in main chunk
                                                  (...tail calls...)
                                                  ...re/jitsi-meet/prosody-plugins/mod_token_verification.lua:24: in main chunk
                                                  [C]: in function 'xpcall'
                                                  /usr/lib/prosody/core/modulemanager.lua:183: in function 'do_load_module'
                                                  /usr/lib/prosody/core/modulemanager.lua:261: in function 'load'
                                                  /usr/lib/prosody/core/modulemanager.lua:83: in function '?'
                                                  /usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
                                                  (...tail calls...)
                                                  /usr/lib/prosody/core/hostmanager.lua:108: in function 'activate'
                                                  /usr/lib/prosody/core/hostmanager.lua:58: in function '?'
                                                  /usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
                                                  (...tail calls...)
                                                  /usr/lib/prosody/util/startup.lua:391: in function 'prepare_to_start'
                                                  /usr/lib/prosody/util/startup.lua:613: in function 'f'
                                                  /usr/lib/prosody/util/async.lua:139: in function 'func'
                                                  /usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>

Does someone know if the nigthly version from jitsi-meet is somehow depending on luajwtjitsi or rather jwt-jitsi?
Or is there somewhere an option to configure this?
@damencho : maybe you know this? I saw you in some recent posts and commiting to prosody-plugins on github

Here: https://github.com/jitsi/jitsi-meet/blob/fix-tokens-plugin-verification/resources/prosody-plugins/token/util.lib.lua
it’s mentioned:
local jwt = require “luajwtjitsi”;
Why are we using this old plugin here?

Okay, got solved that problem (and some other problems after that) with:

apt-get install libssl-dev
apt-get install luarocks
apt-get install liblua5.2-0
apt-get install liblua5.2-dev
luarocks install luaossl
luarocks install jwt-jitsi
apt-get install jitsi-meet-tokens
luarocks install net-url
apt install cmake
git clone https://github.com/evanlabs/luacrypto
cd luacrypto
luarocks make
luarocks install lua-cjson
luarocks install lbase64
luarocks install luajwtjitsi --> funzt nicht, also:
luarocks install --server=http://rocks.moonscript.org luajwt
git clone https://github.com/LuaDist2/luajwtjitsi
cd luajwtjitsi
luarocks make
luarocks remove lua-cjson --force
luarocks install lua-cjson 2.1.0-1

and
ln -s /usr/local/lib/lua/crypto.so /usr/local/lib/lua/5.2/crypto.so

Now Prosody doesn’t start at all, but there are no errors in the logs.

root@vc:/var/log/prosody# systemctl status prosody
● prosody.service - Prosody XMPP Server
   Loaded: loaded (/lib/systemd/system/prosody.service; enabled; vendor preset: enabled)
   Active: failed (Result: signal) since Mon 2020-04-06 18:51:02 CEST; 3s ago
     Docs: https://prosody.im/doc
  Process: 17573 ExecStart=/usr/bin/prosody -F (code=killed, signal=SEGV)
 Main PID: 17573 (code=killed, signal=SEGV)

Apr 06 18:51:02 *** systemd[1]: prosody.service: Service RestartSec=100ms expired, scheduling restart.
Apr 06 18:51:02 *** systemd[1]: prosody.service: Scheduled restart job, restart counter is at 5.
Apr 06 18:51:02 *** systemd[1]: Stopped Prosody XMPP Server.
Apr 06 18:51:02 *** systemd[1]: prosody.service: Start request repeated too quickly.
Apr 06 18:51:02 *** systemd[1]: prosody.service: Failed with result 'signal'.
Apr 06 18:51:02 *** systemd[1]: Failed to start Prosody XMPP Server.

Error Log:
Apr 06 18:51:01 certmanager error SSL/TLS: Failed to load ‘/etc/prosody/certs/localhost.key’: Check that the permissions allow Prosody to read this file. (for localhost)
Apr 06 18:51:01 localhost:tls error Error creating context for c2s: error loading private key (Permission denied)
Apr 06 18:51:01 certmanager error SSL/TLS: Failed to load ‘/etc/prosody/certs/localhost.key’: Previous error (see logs), or other system error. (for localhost)
Apr 06 18:51:01 localhost:tls error Error creating contexts for s2sout: error loading private key (system lib)
Apr 06 18:51:01 certmanager error SSL/TLS: Failed to load ‘/etc/prosody/certs/localhost.key’: Previous error (see logs), or other system error. (for localhost)
Apr 06 18:51:01 localhost:tls error Error creating contexts for s2sin: error loading private key (system lib)

Log:

Apr 06 18:51:00 startup info    Hello and welcome to Prosody version 0.11.5
Apr 06 18:51:00 startup info    Prosody is using the select backend for connection handling
Apr 06 18:51:00 portmanager     info    Activated service 's2s' on [::]:5269, [*]:5269
Apr 06 18:51:01 startup info    Hello and welcome to Prosody version 0.11.5
Apr 06 18:51:01 startup info    Prosody is using the select backend for connection handling
Apr 06 18:51:01 portmanager     info    Activated service 'component' on [::1]:5347, [127.0.0.1]:5347
Apr 06 18:51:01 portmanager     info    Activated service 's2s' on [*]:5269, [::]:5269
Apr 06 18:51:01 portmanager     info    Activated service 'c2s' on [*]:5222, [::]:5222
Apr 06 18:51:01 portmanager     info    Activated service 'legacy_ssl' on no ports
Apr 06 18:51:01 certmanager     error   SSL/TLS: Failed to load '/etc/prosody/certs/localhost.key': Check that the permissions allow Prosody to read this file. (for localhost)
Apr 06 18:51:01 localhost:tls   error   Error creating context for c2s: error loading private key (Permission denied)
Apr 06 18:51:01 certmanager     error   SSL/TLS: Failed to load '/etc/prosody/certs/localhost.key': Previous error (see logs), or other system error. (for localhost)
Apr 06 18:51:01 localhost:tls   error   Error creating contexts for s2sout: error loading private key (system lib)
Apr 06 18:51:01 certmanager     error   SSL/TLS: Failed to load '/etc/prosody/certs/localhost.key': Previous error (see logs), or other system error. (for localhost)
Apr 06 18:51:01 localhost:tls   error   Error creating contexts for s2sin: error loading private key (system lib)
Apr 06 18:51:01 startup info    Hello and welcome to Prosody version 0.11.5
Apr 06 18:51:01 startup info    Prosody is using the select backend for connection handling
Apr 06 18:51:01 portmanager     info    Activated service 'component' on [::1]:5347, [127.0.0.1]:5347
Apr 06 18:51:01 portmanager     info    Activated service 's2s' on [*]:5269, [::]:5269
Apr 06 18:51:01 portmanager     info    Activated service 'c2s' on [*]:5222, [::]:5222
Apr 06 18:51:01 portmanager     info    Activated service 'legacy_ssl' on no ports
Apr 06 18:51:01 startup info    Hello and welcome to Prosody version 0.11.5
Apr 06 18:51:01 startup info    Prosody is using the select backend for connection handling
Apr 06 18:51:01 startup info    Hello and welcome to Prosody version 0.11.5
Apr 06 18:51:01 startup info    Prosody is using the select backend for connection handling
Apr 06 18:51:01 portmanager     info    Activated service 'component' on [127.0.0.1]:5347, [::1]:5347
Apr 06 18:51:01 portmanager     info    Activated service 's2s' on [*]:5269, [::]:5269
Apr 06 18:51:01 portmanager     info    Activated service 'c2s' on [*]:5222, [::]:5222
Apr 06 18:51:01 portmanager     info    Activated service 'legacy_ssl' on no ports

After some trying all the errors were gone, but prosody with token enabled in conf was not starting and not throwing errors in the logs.
I took the docker version, now everything is working.

So seems I’ve found a solution thanks to the fork from https://github.com/ASolomatin/luajwt/tree/replace_luacrypto

Deps:

apt install git cmake luarocks libssl-dev liblua5.2

My luajwtjitsi.rockspec:

package = "luajwtjitsi"
version = "1.3-7"

source = {
        -- Use fork from ASolomatin which uses luaossl
        url = "git://github.com/ASolomatin/luajwt/",
        tag = "replace_luacrypto"
}

description = {
        summary = "JSON Web Tokens for Lua",
        detailed = "Very fast and compatible with pyjwt, php-jwt, ruby-jwt, node-jwt-simple and others",
        homepage = "https://github.com/jitsi/luajwt/",
        license = "MIT <http://opensource.org/licenses/MIT>"
}

dependencies = {
        -- Prosody uses lua 5.2
        "lua >= 5.2",
        "luaossl >= 20190731-0",
        -- Use exact version 2.1, see https://github.com/mpx/lua-cjson/issues/56
        "lua-cjson = 2.1.0",
        "lbase64 >= 20120807-3"
}

build = {
        type = "builtin",
        modules = {
                luajwtjitsi = "luajwtjitsi.lua"
        }
}

Just create the file with this content and install the lua deps with

luarocks install luajwtjitsi.rockspec
luarocks install basexx

Works for me on Debian Buster and prosody 0.11.5-1~buster6

For explanation: Problem is that Buster comes with libssl-1.1 which is not supported by luacrypto so the fork uses luaossl which compiles fine with libssl-dev-1.1

2 Likes

Using @Psi’s rockspec on Raspberry Pi 4 running Ubuntu 20.04 I had to

  1. Rename luajwtjitsi.rockspec to luajwtjitsi-1.3-7.rockspec

  2. Run the following command:

luarocks install ./luajwtjitsi-1.3-7.rockspec CRYPTO_LIBDIR=/usr/lib/aarch64-linux-gnu/ CRYPTO_INCDIR=/usr/include/ OPENSSL_LIBDIR=/usr/lib/aarch64-linux-gnu/ OPENSSL_INCDIR=/usr/include/