I’m fighting the docker install of invoice ninja behind caddy.
The current main issue is files.
If I upload a company logo - it uploads. But pdf generation breaks (if I go to invoice preview in settings it doesn’t show anything)
I can’t upload any files/images with error 500.
So I was thinking to move everything to S3.
Could somebody provide an example env config for S3 in docker?
Currently, I can’t even make to knock on S3 door.
Documentation is lucking straightness.
Using - Free Source Available Invoicing, Expenses & Time-Tracking | Invoice Ninja
And - https://github.com/invoiceninja/invoiceninja/blob/v5-stable/config/filesystems.php
as sources
My logs when trying to upload
storage/logs/laravel.log
[2023-09-02 16:00:55] production.ERROR: file_get_contents(https://invoices."REDUCTED"/storage/jqVyLkEx3rmFjywCD4PZMBDhVzsYt6RX/documents/8VldP0AWUWTrHYxNiuiUQQB592fbg7DTIttbxfQd.png): Failed to open stream: Operation timed out {"userId":1,"exception":"[object] (ErrorException(code: 0): file_get_contents(https://invoices."REDUCTED"/storage/jqVyLkEx3rmFjywCD4PZMBDhVzsYt6RX/documents/8VldP0AWUWTrHYxNiuiUQQB592fbg7DTIttbxfQd.png): Failed to open stream: Operation timed out at /var/www/app/app/Http/Controllers/DocumentController.php:124)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(254): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /var/www/app/app/Http/Controllers/DocumentController.php(124): file_get_contents()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\\Http\\Controllers\\DocumentController->App\\Http\\Controllers\\{closure}()
#4 /var/www/app/vendor/symfony/http-foundation/StreamedResponse.php(102): Illuminate\\Routing\\ResponseFactory->Illuminate\\Routing\\{closure}()
#5 /var/www/app/vendor/symfony/http-foundation/Response.php(423): Symfony\\Component\\HttpFoundation\\StreamedResponse->sendContent()
#6 /var/www/app/public/index.php(61): Symfony\\Component\\HttpFoundation\\Response->send()
#7 {main}
"}
Config
.env
IS_DOCKER=true
APP_NAME="REDUCTED"
APP_ENV=production
APP_URL="REDUCTED"
APP_KEY="REDUCTED"
APP_DEBUG=true
EXPANDED_LOGGING=true
UPDATE_SECRET="REDUCTED"
TRUSTED_PROXIES=*
APP_CIPHER=AES-256-CBC
APP_LOCALE=en
REQUIRE_HTTPS=true
IN_USER_EMAIL="REDUCTED"
IN_PASSWORD="REDUCTED"
QUEUE_CONNECTION=database
DB_TYPE=mysql
DB_STRICT=false
DB_HOST="REDUCTED"
DB_DATABASE="REDUCTED"
DB_USERNAME="REDUCTED"
DB_PASSWORD="REDUCTED"
caddyfile
################################################################################
# invoices
################################################################################
REDUCTED {
import header_noindex
import tls_standard_email
import logerror
root * /var/www/app/public
php_fastcgi Invoice_Ninja:9000
encode zstd gzip
file_server browse
}
After changing .env i’m doing docker-compose up -d to recreate container and
php artisan optimize
in container shell after.
The worst part is - it doesn’t tell you that the upload was unsuccessful. Quite opposite - the upload is successful according to UI messages (web or android app) but downloading the uploaded file - it’s damaged.