LibreSign / libresign

✍️ Nextcloud app to sign PDF documents
https://libresign.coop
488 stars 57 forks source link

Delete .zip files and .tar.gz files after installing java and jsignpdf #2487

Closed DazeEnd closed 5 months ago

DazeEnd commented 8 months ago

Describe the bug After installing java with occ libresign:install --java and jsignpdf with occ libresign:install --jsignpdf, compressed archive files are left behind that consume about 70 MB in total. These archive files should be deleted after they are used.

To Reproduce

  1. Install the LibreSign app into a new Nextcloud installation.

  2. Log into the server change directories to the web server's DocumentRoot.

  3. Install additional binaries that are required for LibreSign:

    sudo -u apache php occ libresign:install --java
    sudo -u apache php occ libresign:install --pdftk
    sudo -u apache php occ libresign:install --jsignpdf
  4. Open a shell as root and change directories to the LibreSign appdata directory:

    [ceperry@newton nextcloud]$ sudo su -
    [root@newton ~]# cd /var/www/newton-test.relanet.com/nextcloud/public_html/data/appdata_ocnb4cjpki06/libresign
  5. Do a directory listing:

    [root@newton libresign]# ls -alh
    total 26M
    drwxr-xr-x.  5 apache apache 4.0K Mar  7 15:33 .
    drwxr-xr-x. 10 apache apache 4.0K Mar  7 15:29 ..
    -rw-r--r--.  1 apache apache  116 Mar  7 15:31 checksums_java_21.0.2_13.txt
    drwxr-xr-x.  3 apache apache 4.0K Mar  7 15:31 java
    drwxr-xr-x.  5 apache apache 4.0K Mar  7 15:33 jsignpdf-2.2.2
    -rw-r--r--.  1 apache apache  19M Mar  7 15:33 jsignpdf-2.2.2.zip
    drwxr-xr-x.  2 apache apache 4.0K Mar  7 15:29 openssl_config
    -rw-r--r--.  1 apache apache 6.9M Mar  7 15:32 pdftk.jar
  6. Change directories to the java installation directory for LibreSign: cd /var/www/newton-test.relanet.com/nextcloud/public_html/data/appdata_ocnb4cjpki06/libresign/java

  7. Do a directory listing:

    
    [root@newton java]# ls -alh
    total 51M
    drwxr-xr-x. 3 apache apache 4.0K Mar  7 15:31 .
    drwxr-xr-x. 5 apache apache 4.0K Mar  7 15:33 ..
    drwxr-xr-x. 6 apache apache 4.0K Mar  7 15:31 jdk-21.0.2+13-jre
    -rw-r--r--. 1 apache apache  51M Mar  7 15:31 OpenJDK21U-jre_x64_linux_hotspot_21.0.2_13.tar.gz


**Expected behavior**
After installing java and jsignpdf, LibreSign should delete the `.zip` and `.tar.gz` files that were needed for the installation.

**Actual behavior**
LibreSign left behind a `jsignpdf-2.2.2.zip` file (that takes up 19 MB) and a `OpenJDK21U-jre_x64_linux_hotspot_21.0.2_13.tar.gz` file (that takes up 51 MB).

**Screenshots**
N/A

**Environment information (please complete the following information):**
 - OS: AlmaLinux 8.9
 - Browser: Chrome
 - LibreSign Version: v8.0.0-rc7
 - Nextcloud Server Version: v28.0.2
 - Logs (get the entries from nextcloud.log related with LibreSign i.e `tail -f data/nextcloud.log|grep libresign`): None

**Additional context**
I know that 70 MB doesn't seem like a lot, but I host around 65 Nextcloud instances (and growing). After installing LibreSign on each of those Nextcloud instance, these unnecessary files would take up more than 4.5 GB of disk space.
vitormattos commented 8 months ago

I maintain these files to be possible run the command to check if the setup is OK. The check routine now is:

Maybe another way is, after extract all files, generate a text file containing the hash of all extracted files to be possible validate if have any file changed, like Nextcloud do with all apps that is signed. Following by this way, will be possible delete the compressed file.

vitormattos commented 8 months ago

I classified as feature request and not as bug because this don't block the work of LibreSign.

vitormattos commented 5 months ago

Could you check again at the newest release of LibreSign?

I made a lot of improvements.

Closing this issue as solved.

If this issue persists, don't hesitate to open a new issue making reference to this.

[!NOTE]

If you like this app, don't hesitate to help us

Ways to help this project:

DazeEnd commented 5 months ago

@vitormattos I am in the middle of a project that will keep me occupied until the second week of July. I have made a note in my calendar to test issues #2495 and #2484 once this project is complete. Thanks for all your work!

Unrelated, I'm looking forward to starting the rollout of LibreSign to my customers in early August. I think they will be pleased.

DazeEnd commented 4 months ago

This issue appears to be fixed for me using LibreSign 8.1.3. Thanks!