LibreSign / libresign

✍️ Nextcloud app to sign PDF documents
https://libresign.coop
GNU Affero General Public License v3.0
460 stars 53 forks source link

libresign deployed in kubernetes #535

Closed DrZoidberg09 closed 1 year ago

DrZoidberg09 commented 2 years ago

Hi there,

I am trying to depoly a nextcloud instance with libresign in my kubernetes cluster.

However, I am issues using cfssl. I cannot deploy it from a docker container.

Is there a way to use the cert api of kubernetes? Maybe even with the cfssl-issuer?

Any help would be greatly appreciated!

Thank you so much

DrZoidberg09 commented 2 years ago

Hi again,

I managed to get it almost runnning.

So far, I installed a separate deployment for CFSSL that can share the /cfssl/ folder from nextcloud. So basically, the ca.pem and ca-key.pem are genared using the settings from nextcloud / libresign. I can also sign the documents and it is running well. Still it shows an error and gives me this in the logs: Error to sign PDF. [] This is very irritating for the users and honestly also for me :)

Is there a way to get more detailed logs in order to understand what the issue is?

Again thank you so much!

vitormattos commented 2 years ago

Hi, Very happy with the news of having completed the setup. Dependency on CFSSL and Java makes setup a little more complex. Congratulations on completing the setup.

I tested it using:

server: 21, 22 and 23
LibreSign: 2.4.5
java --version
     openjdk 11.0.13 2021-10-19
JSignPDF: 1.6.5
cfssl version
     Version: 1.5.0
     Runtime: go1.14.1

I didn't find problems

Check if you have JSignPDF version 1.6.5. LibreSign version 2.4.5 (latest stable) is not yet compatible with newer versions of JSignPDF. https://github.com/LibreSign/libresign/blob/v2.4.5/lib/Handler/JSignPdfHandler.php#L46

Soon we will create a new version, we need to make UX improvements in the new version before releasing it. We are a little slow to launch as we are in need of funding to keep the team going.

DrZoidberg09 commented 2 years ago

Thanks for the hint!

Unfortunately, it does not help. It still says: Internal error. Please contact an administrator.

At least it gives me a little more output in the log:

[libresign] Fehler: Error to sign PDF. ["WARN net.sf.jsignpdf.utils.PropertyProvider$ProperyProviderException: Property file \/var\/www\/.JSignPdf doesn't exist.","WARN net.sf.jsignpdf.utils.PropertyProvider$ProperyProviderException: Property file conf\/conf.properties doesn't exist.","INFO Checking input and output PDF paths.","WARN Keystore was not loaded succesfully. Check if the keystore type, path and password are valid.","ERROR Problem occured","java.lang.NullPointerException: Keystore was not loaded succesfully. Check if the keystore type, path and password are valid.","\tat net.sf.jsignpdf.utils.KeyStoreUtils.getKeyAliasInternal(KeyStoreUtils.java:225)","\tat net.sf.jsignpdf.utils.KeyStoreUtils.getPkInfo(KeyStoreUtils.java:417)","\tat net.sf.jsignpdf.SignerLogic.signFile(SignerLogic.java:149)","\tat net.sf.jsignpdf.Signer.signFiles(Signer.java:242)","\tat net.sf.jsignpdf.Signer.main(Signer.java:137)","INFO Finished: Creating of signature failed."] POST /apps/libresign/api/0.1/sign/file_id/2366 from 92.116.141.214 by Thorsten at 2022-01-24T19:42:07+00:00

Any further clue?

And btw: I did not find a way to support you. Is there something like patreon or so?

vitormattos commented 2 years ago

What is the version of your JSignPdf?

About support to project: https://www.patreon.com/libresign or, if you want talk about other questions, send a mail to: contact [at] librecode {dot} coop

DrZoidberg09 commented 2 years ago

Meanwhile I tried versions: 2.0.0 as described in the Readme.md, 2.1.0 and now 1.6.5 as you recommended. Is there a way to get a more speaking log? Or any other ideas?

And thanks for the Patreon link! Once I get this running and can use it in our start-up, I am happy to contribute to support this. I like the idea of this app very much.

vitormattos commented 2 years ago

The version specified on README.md is on unstable version of LibreSign, compatible with unstable version of Nextcloud Server, at this moment, the version 24 of server.

When we finish the implementation of a feature (developed on main branch), we create a backport from main branch to stable branches (at this moment: stable23, stable22 and stable21).

The compatibility version of JSignPdf is a good point to put one table with compatibility on README.

About logs of LibreSign, the only way is changing the log level on config.php of Nextcloud Server

Lapotor commented 1 year ago

Hey i'm currently also on my try to setup nextcloud with libresign.

I got to the point of creating an certificate in the /cfssl/ folder

But currently I see an error from LibreSign:

error in loadState:  Error: Could not find initial state config of libresign
loadState https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1
    ok https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1
    <anonymous> https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1
    <anonymous> https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1
    <anonymous> https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1
[libresign-tab.js:1:1139706](https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0)
    ok https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1
    <anonym> https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1
    <anonym> https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1
    <anonym> https://domain.tld/custom_apps/libresign/js/libresign-tab.js?v=51d47b9f-0:1

May someone have an Idea here or is this a diffrent issue?

Here my kubernetes setup for nextcloud and cfssl: https://gist.github.com/Lapotor/ce2e36223404e8bcf391149c7feae042

vitormattos commented 1 year ago

LibreSign was updated and the setup now don't need more to run commands in terminal, check if the problem persist in latest version.

But, also have commands to complete all the setup and configure using CLI.

I recommend to use with server in version 25.

If the problem persists, reopen this issue with more details.