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

[feature] Add support for fetching images from the Web #425

Open
kacper-ka opened this issue Oct 4, 2024 · 3 comments
Open

[feature] Add support for fetching images from the Web #425

kacper-ka opened this issue Oct 4, 2024 · 3 comments

Comments

@kacper-ka
Copy link

Problem description

We are using our own private instance of Gitlab where we hold wiring documentation, rendered by wireviz. In each wiring diagram we use image directive, whose field src points to a file inside the repository. All is good as long as the diagrams are generated locally, when all the image files are accessible. Recently we have instantiated our own self-hosted kroki service, which was intended to be used as the diagram generation endpoint for documentation rendered by Gitlab (instead of embedding generated diagrams in the text documents we were intending to embed just the wireviz source code and have Gitlab take care of the rendering using appropriate kroki endpoint). We have stumbled upon an issue that the wireviz component of the kroki service does not have access to the static files inside the repository (which is pretty obvious). We have thought about possible solutions and the most straightforward one which is to have the repository cloned and mounted in the server the kroki service runs doesn't seem very elegant, apart from the questions how often and what branches to synchronize.

Proposed solution

It was the first thing we tried but unfortunately that didn't work: specify a URI location of the image source. If URI started with a file:// protocol (the default) then it would mean the image should be accessed on a local file system. If the URI started with a http:// or https:// protocol then the file would be accessed via the Internet. That would resolve our use case as we simply could place all assets in a common location accessibly from all the machines and the diagram generation process would succeed.

@kvid
Copy link
Collaborator

kvid commented Oct 4, 2024

The Graphviz utility we use doesn't support reading URIs. It only support reading the local file system. See https://gitlab.com/graphviz/graphviz/-/issues/1664

@kacper-ka
Copy link
Author

Well, one possible solution would be to fetch the image before processing and store it in a temporary folder. Having the data available locally the processing could continue.

@kacper-ka
Copy link
Author

Moreover, a preprocessor for that purpose has been added to the Graphviz repository over a year ago: https://gitlab.com/graphviz/graphviz/-/commit/af8a77c49b2aef720344f0a1b90a429ca1da5931

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