Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Asset Management broken? #5

Open
Dschogo opened this issue Feb 20, 2024 · 3 comments
Open

[Bug] Asset Management broken? #5

Dschogo opened this issue Feb 20, 2024 · 3 comments

Comments

@Dschogo
Copy link

Dschogo commented Feb 20, 2024

Describe the bug
Updating user/company avatars uploads the files correctly to /invoiceshelf/data/app/public/<asset_number>/<filename> but the get request to /storage/<asset_number>/<filename> results in a 404.

Expected behavior
Return the (correct) asset.

Additional info
Seems to be related to crater issue 1222 and crater PR 1226

Please complete the following information:

  • InvoiceShelf version: docker-compose (invoiceshelf/invoiceshelf:latest) - 1.1.0
  • PHP version: bundled
  • Database type and version: bundled

Optional info

  • OS: docker host: debian arm64
  • Browser: Firefox
docker-compose.yml
#-------------------------------------------
#  Docker Compose
#  - Darko Gjorgjijoski
# Repo : https://github.com/InvoiceShelf/docker
#-------------------------------------------

version: '3'

services:
   invoiceshelf_db:
     container_name: invoiceshelf_db
     image: mariadb:10
     environment:
       - MYSQL_ROOT_PASSWORD=randompw
       - MYSQL_DATABASE=invoiceshelf
       - MYSQL_USER=invoiceshelf
       - MYSQL_PASSWORD=randompw
     expose: 
       - 3306
     volumes:
       - mysql:/var/lib/mysql
     networks:
       - invoiceshelf
     restart: unless-stopped

   invoiceshelf:
     image: invoiceshelf/invoiceshelf
     container_name: invoiceshelf
     ports:
       - 90:80
     volumes:
       - ./invoiceshelf/data:/data
     networks:
       - invoiceshelf
     environment:
       - PUID=1000
       - PGID=1000
       - USER=invoiceshelf
       - PHP_TZ=UTC
       - TIMEZONE=UTC
       - DB_CONNECTION=mysql
       - DB_HOST=invoiceshelf_db
       - DB_PORT=3306
       - DB_DATABASE=invoiceshelf
       - DB_USERNAME=invoiceshelf
       - DB_PASSWORD=randompw
       - STARTUP_DELAY=0
     restart: unless-stopped
     depends_on:
       - invoiceshelf_db

networks:
   invoiceshelf:

volumes:
    mysql:
@gdarko gdarko transferred this issue from InvoiceShelf/InvoiceShelf Feb 20, 2024
@Dschogo
Copy link
Author

Dschogo commented Feb 24, 2024

It's working more now, uploaded asses show correctly in the UI (avatar and company logo)

Think there is a variable issue, since there are two ip fields in the setup wizard (one for the database connection and one for the site). The ip substituted for the assets was the one for the DB connection and not for the actual site with the assets. (Saw this behavior on the previous install) Maybe that was a caching issue from the browser tho.

PS: both runs on the same stack in docker, but for the DB i've set 127.0.0.1 since its internal and not the DHCP IP - which is the site accessing ip.

Creating an invoice results now in an "image not found or type unknown"
image

Not sure if thats an issue with docker, or generally broken currently. (Tried jpg, jpeg, png)

@Firesphere
Copy link

I'm encountering the same problem.
But for me, the files are uploaded, I can see them in my docker mount (I've mounted /data to the host), but the file path
example.com/storage/{id}/{filename}.jpg don't work at all.

I think it may be a configuration issue, or a file rewrite issue?

@Firesphere
Copy link

Firesphere commented Mar 11, 2024

If, in app/Models/Invoice::getPDFData() the $company->logo_path is replaced with $company->logo, I found that PDFs render okay.
I guess this is a problem between the PDF renderer and the absolute path needing to be relative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants