libresign icon indicating copy to clipboard operation
libresign copied to clipboard

Error: Remove the CFSSL API URI and Config path to use the default values. When left empty (NC 27.0.0)

Open feefladder opened this issue 2 years ago • 5 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  • Fresh install of Nextcloud 27.0.0
  • Install Libresign (ignore the warning about incompatible versions)
  • Download binaries - here there is some error and you have to mkdir
  • Run everything through php occ libresign:install --all (inside container)
  • Get error when trying to generate root cert
  • read logs tail -f data/nextcloud.log|grep libresign
  • mkdir data/appdata_ocjbciguuehu/libresign/cfssl_config inside container
  • Don't get error when trying to generate root cert

Expected behavior

The folder should be created or the error should make more sense

Screenshots

image

Environment information (please complete the following information):

  • OS: Ubuntu 22, custom Docker (with S3, I think irrelevant)
  • Browser: firefox
  • LibreSign: Version [e.g. 3.2.1]
  • Nextcloud: 27.0.0
  • Logs (get the entries from nextcloud.log related with LibreSign i.e tail -f data/nextcloud.log|grep libresign)
{"reqId":"xvZU8piPvUvFf7BdJACD","level":3,"time":"2023-07-03T08:42:31+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"file_put_contents(/var/www/html/data/appdata_ocjbciguuehu/libresign/cfssl_config/csr_server.json): Failed to open stream: No such file or directory at /var/www/html/custom_apps/libresign/lib/Handler/CfsslServerHandler.php#42","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"Y25o03TvkNEHyp1XrAJw","level":3,"time":"2023-07-03T08:50:30+00:00","remoteAddr":"172.18.0.1","user":"admin","app":"PHP","method":"POST","url":"/apps/libresign/api/0.1/admin/certificate","message":"file_put_contents(/var/www/html/data/appdata_ocjbciguuehu/libresign/cfssl_config/csr_server.json): Failed to open stream: No such file or directory at /var/www/html/custom_apps/libresign/lib/Handler/CfsslServerHandler.php#42","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0","version":"27.0.0.8","data":{"app":"PHP"}}

Additional context Add any other context about the problem here.

feefladder avatar Jul 03 '23 09:07 feefladder

I'm facing the same issue.

clayrisser avatar Jan 26 '24 16:01 clayrisser

I solved it by manually creating the missing directory with mkdir -p.

Make sure you also update the file ownership permissions because they will be root intead of www-data in the docker image by default. chown www-data:www-data <MISSING_FOLDER_PATH

clayrisser avatar Jan 26 '24 17:01 clayrisser

Yeah, I used this script here:

# install libresign
# use --force since libresign is said not to work for nc 27.0.0
php occ app:enable --force libresign
# this one fails, but it makes the folders
php occ libresign:install --jsignpdf
APPDATA_DIR=`ls data/ | grep appdata`
mkdir data/${APPDATA_DIR}/libresign/java
mkdir data/${APPDATA_DIR}/libresign/cfssl_config
ls -la data/
ls -la data/${APPDATA_DIR}
# echo "this may error out, do something like mkdir data/appdata_oc3td5j9a6xp/libresign/java"
php occ libresign:install --java
php occ libresign:install --jsignpdf
php occ libresign:install --cfssl
php occ libresign:configure:cfssl --cn "feefladder"
php occ libresign:configure:check

that I then feed to the docker like:

docker exec -iu www-data nextcloud-app-1 bash < ./install_apps.sh

Notice the -u www-data to directly solve your issue. (also the occ commands won't work as root)

feefladder avatar Jan 26 '24 18:01 feefladder

We will soon have a new release of LbireSign!

At the new release is possible to use OpenSSL instead of CFSSL:

Spoiler:

Screenshot_20240126_173815

vitormattos avatar Jan 26 '24 20:01 vitormattos

Hi @feefladder and @clayrisser, if you are using Nextcloud 28, I'm creating pre releases and is very close to create the stable release compatible with Nextcloud 28.

Will be very nice to receive your feedbacks about this release.

vitormattos avatar Mar 01 '24 21:03 vitormattos

I created a new release to LibreSign with a lot of changes.

Could you check if this issue was fixed?

Closing for now.

If the problem persists, open a new issue making reference to this issue using the #1773.

PS: If you like this app, don't hesitate to help us to maintain the development sponsoring by GitHub sponsor https://github.com/sponsors/LibreSign or also contacting us to have Enterprise support: https://libresign.coop

vitormattos avatar Apr 24 '24 15:04 vitormattos