grocy / grocy-docker

ERP beyond your fridge - now containerized - this is the docker repo of https://github.com/grocy/grocy
MIT License
418 stars 120 forks source link

How to add custom_js.html file #153

Closed barbax7 closed 1 year ago

barbax7 commented 3 years ago

Hi I would like to add some features and i need custom_js.html file in data directory.

I tried to add the file in data directory and edited docker-compose.yml file (as you can see in my fork, but it doesn't copy the file in the directory.

EDIT: My edits in my fork were causing issues while creating the containers. So I removed them and I'm still looking for a simple way to copy file from outside to inside of container while creating and starting it

jayaddison commented 2 years ago

@barbax7 A message to let you know that I've spent some more time thinking about this functionality.

My recommendation would be to add two more COPY steps in the frontend build in your fork of the repository. You may want to merge from main here first (warning: there have been a few changes, including some file renames -- so some git conflicts may occur).

I thought about adding a custom directory here and having a generic COPY step that includes anything from in there -- but it feels a bit too much like a potential security risk. It's arguable that only a user who knows what they are doing could include custom HTML/CSS/JS -- but a user who knows how to do that might also reasonably be able to edit the build script to add the COPY steps themselves -- or to paste them into the Docker volume.

I'm not completely certain this is ideal -- it would be nice to support this since it's a feature of grocy itself, but I can't currently think of a way to do it that I'm comfortable with.

jayaddison commented 1 year ago

@barbax7 something I might have missed when looking into this previously: is the data directory the same one as the Docker volume in the backend container?

If so.. I don't know what the best tools are to do this, but it feels like there should be a way to copy a file into the volume, without editing the docker-compose.yml or rebuilding the container images.

jayaddison commented 1 year ago

Closing since this issue thread was from a long time ago; but if it's still relevant, please feel free to reopen.

barbax7 commented 1 year ago

Hi thank you for answering again to this topic

actually i'm not using docker anymore, so i don't remember what i did in the past. i'm sure that i didn't find a solution, but it's ok thanks again

jayaddison commented 1 year ago

No problem - sorry this thread wasn't more help :| thanks for responding, anyway!