Delete .zip files and .tar.gz files after installing java and jsignpdf
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
-
Install the LibreSign app into a new Nextcloud installation.
-
Log into the server change directories to the web server's DocumentRoot.
-
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
- Open a shell as
rootand 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
- 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
-
Change directories to the java installation directory for LibreSign:
cd /var/www/newton-test.relanet.com/nextcloud/public_html/data/appdata_ocnb4cjpki06/libresign/java -
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.
I maintain these files to be possible run the command to check if the setup is OK. The check routine now is:
- Check if exists the downloaded file, if not, download
- When the downloaded file exists, check if isn't corrupted using the hash of file
- If the hash is different, will download the files
- Extract the file to destination folder
- Run post check steps
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.
I classified as feature request and not as bug because this don't block the work of LibreSign.
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:
- Creating a very nice review of this project at:
- social networks like LinkedIn, Instagram, etc and putting the @LibreSign and @LibreCodeCoop
- AlternativeTo https://alternativeto.net/software/libresign/
- Nextcloud apps store: https://apps.nextcloud.com/apps/libresign
- Sponsoring the development by GitHub sponsor https://github.com/sponsors/LibreSign
- helping the translations on Transifex
- contacting us to have Enterprise support: https://libresign.coop
@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.
This issue appears to be fixed for me using LibreSign 8.1.3. Thanks!