Hello
I am trying to use snappdf. When trying to download, errors occur. Am I doing something wrong? Is there a solution/workaround for this?
root@invoice:/var/www/invoice/vendor/beganovich/snappdf# php snappdf download
PHP Warning: file_get_contents(https://download-chromium.appspot.com/rev/Linux_x64?type=snapshots): Failed to open stream: Connection timed out in /var/www/invoice/vendor/beganovich/snappdf/src/Command/DownloadChromiumCommand.php on line 70
PHP Warning: Attempt to read property "content" on null in /var/www/invoice/vendor/beganovich/snappdf/src/Command/DownloadChromiumCommand.php on line 73
Starting download. Revision:
PHP Warning: fopen(https://download-chromium.appspot.com/dl/Linux_x64?type=snapshots): Failed to open stream: Connection timed out in /var/www/invoice/vendor/beganovich/snappdf/src/Command/DownloadChromiumCommand.php on line 87
Download completed. Extracting the zip archive.
Archive extracted.
PHP Warning: chmod(): No such file or directory in /var/www/invoice/vendor/beganovich/snappdf/src/Command/DownloadChromiumCommand.php on line 105
Completed! -Linux_x64 currently in use.
If I disable UFW on my Debian server then it works.
I have yet to figure out why the firewall is blocking this. The only thing I have configured is two ports open for incoming connections (80 and 443). As far as i know, by default, UFW is configured to deny all incoming traffic and allow all outgoing traffic.
I noticed that when I use file_get_contents, only requests with https are blocked, it works with http.
did you get around to pinpoint the problem with ufw?
I’m running many docker containers behind caddy. And caddy is allowed to converse via 443/80. All work just fine.
But the invoice ninja is picky and still does something that results in
I had the problem that I couldn’t download Snapdf on my vps when ufw was enabled. In order to download it I temporarily disabled the firewall. After download and installation of Snappdf I reactivated the firewall and the PDF views and files were generated. It’s been running fine for 9 months now.
This is all what i found i my own documentation:
Installing and configure SnapPDF as PDF Generator
cd /var/www/invoiceninja
from the root of the project run:
vendor/bin/snappdf download
After some time and errors:
Completed! -Linux_x64 currently in use.
nano .env
PDF_GENERATOR=snappdf
php8.1 artisan optimize
chown -R www-data:www-data /var/www/invoiceninja
BTW: I’m not using docker containers. I installed InvoiceNinja on a Debian Linux VPS using git clone and Composer.