invoiceninja / dockerfiles

Docker files for Invoice Ninja
https://hub.docker.com/r/invoiceninja/invoiceninja
GNU General Public License v2.0
419 stars 268 forks source link

Invoices or designer cant include/display logo #398

Closed di9ze closed 3 years ago

di9ze commented 3 years ago

Hello, i've been battling this for a week now. Hope somebody can help out

For some reason our logo is not being displayed on invoices or invoice designer. Everything else seems to be working fine.

I followed the steps listed on github page to deploy and used docker-compose file. Here are the steps that I took:

  1. I followed the standard quick start and installed invoice ninja on my docker instance. Used the directory structure provided by the git clone as the mounted directories without changing anything. For testing used the provided mysql variables. Used the suggested port allocations
    1. Set ownership of mounted directories as: chmod 755 docker/app/public chown -R 1500:1500 docker/app
  1. Ran docker-compose exec php artisan storage:link against the container. Told me the link already existed (and then that it had been created!).
  2. Did /setup on first run. All checks including pdf generation worked properly.
  3. On first login system seems to work as expected except in regards to the company logo appearing on the invoices - tested in the design section of settings. It displayed invoice ninja logo
  4. Uploaded a logo in company details under settings. It appears saved.
  5. Went to the invoice design for the company and viewed the pdf preview. Uploaded logo was not shown.

here is my env file

IN application vars

APP_URL=http://invoice.mydomain.com:8003 APP_KEY=base64:FDAUMuZuHF6p APP_DEBUG=true REQUIRE_HTTPS=false PHANTOMJS_PDF_GENERATION=false PDF_GENERATOR=snappdf LOCAL_DOWNLOAD=true TRUSTED_PROXIES=*

As i mentioned, everything else is working fine.

Any idea what i am missing. I dont think i have name resolution issue, the name can be resolved internally and externally

turbo124 commented 3 years ago

You may want to define your domain name in the hosts files here:

https://github.com/invoiceninja/dockerfiles/blob/master/config/hosts

ie

127.0.0.1 invoice.mydomain.com

di9ze commented 3 years ago

Thanks turbo124 i had it already defined there. Just to clarify, i do not use actual IP i use the the 127.0.0.1 (localhost) in hosts file?

turbo124 commented 3 years ago

yeh try using 127.0.0.1

di9ze commented 3 years ago

thanks, thats what i have setup

i dont see any errors in: /dockerfiles/docker/app/storage/logs/laravel.logs

anything else you can think of?

turbo124 commented 3 years ago

did you try wgetting from inside the container?

wget invoice.mydomain.com
di9ze commented 3 years ago

yes, from web container --2021-09-26 02:48:18-- http://invoice.mydomain.com/ Resolving invoice.mydomai.com (invoice.mydomain.com)... 192.168.11.5, 2606:4700:3034::6815:2383,2606:4700:3037::ac43:de91 Connecting to invoice.mydomain.com (invoice.mydomain.com)|192.168.11.5|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: 'index.html'

index.html [ <=> ] 4.41K --.-KB/s in 0s

from app container, which i think its expected:

~ $ wget invoice.mydomain.com Connecting to invoice.mydomain.com (127.0.0.1:80) wget: can't connect to remote host (127.0.0.1): Connection refused

turbo124 commented 3 years ago

if you inspect the index.html, do you get the HTML of the front page of the webapp? or a random nginx page?

di9ze commented 3 years ago

its a front of webapp, please see below

less index.html

<!DOCTYPE html>
<html data-report-errors="1" data-rc="" data-build="" user-agent="Wget/1.20.1 (linux-gnu)">
<head>
    <!-- Source: https://github.com/invoiceninja/invoiceninja -->
    <!-- Version: 5.3.16 -->
  <meta charset="UTF-8">
  <title>Invoice Ninja</title>
  <meta name="google-signin-client_id" content="">
  <link rel="manifest" href="manifest.json?v=5.3.16">
  <script src="http://invoice.mydomain.com/js/pdf.min.js"></script>
  <script type="text/javascript">
    pdfjsLib.GlobalWorkerOptions.workerSrc = "http://invoice.mydomain.com/js/pdf.worker.min.js";
  </script>
</head> 
di9ze commented 3 years ago

I found something very interesting. If i connect via fqdn ie invoice.mydomain.com the logo is showing up, if i connect locally via IP logo is not there

di9ze commented 3 years ago

I think we can close this issue, its working fine using fqdn

di9ze commented 3 years ago

its working fine using fqdn

IrealiTY commented 3 years ago

I seem to have a very similar issue - didn't open a new ticket as the submission asked if there wasn't already a similar issue. I've been using the full domain for a while now and without problems and since today (no update or anything) the PDFs are being generated poorly

I tried setting my domain to 127.0.0.1 in the hosts file to no avail

image

turbo124 commented 3 years ago

@IrealiTY can you please open an issue on the main repo /invoiceninja/invoiceninja and we can take a look there.