Giter Site home page Giter Site logo

Comments (5)

ggrossetie avatar ggrossetie commented on June 5, 2024

Interesting... Could you please submit a pull request with your change? Thanks!

from kroki.

gerlingsm avatar gerlingsm commented on June 5, 2024

yes, i will submit a pull request asap.
But i have to add something, which i didn't see before:
When the "window.EXCALIDRAW_ASSET_PATH" is set, the links to the fronts are also replaced.
This is the desired behaviour.
For example the kroki original example for excalidraw is using "Virgil" and "Cascadia" as fonts and loading them from https://unpkg.com/@excalidraw/[email protected]/dist/excalidraw-assets/
With window.EXCALIDRAW_ASSET_PATH="excalidraw/" set, the url is changed to "excalidraw//dist/excalidraw-assets/".
It is relative to the basepath, so with a standard kroki installation it will try to load the fonts from https://example.com/excalidraw/svg/excalidraw//dist/excalidraw-assets/Virgil.woff2 which results in an 404 error from kroki.
In my case this is not a problem. I am using an Apache2 reverse proxy before kroki so i can exclude this specific url from proxy pass.

Maybe it's possible to make a new ENVIRONMENT variable for this case, for example "KROKI_EXCALIDRAW_ASSET_PATH" and set default to an empty string?
An empty string behaves actually the same as if the variable were not set so it should work in the default place, when everything is connected to the internet.
But i am not familiar enough with the software to say if it is possible to implement like that...

from kroki.

ggrossetie avatar ggrossetie commented on June 5, 2024

Indeed, we need to load assets used server-side locally but on the client side we should load assets from the CDN or provide an option to load them from elsewhere. I don't want to serve these assets from kroki.io.

from kroki.

gerlingsm avatar gerlingsm commented on June 5, 2024

I have opened a pull request.
I have now implemented the change slightly differently via an environment variable, which is empty by default so that the standard behaviour (reloading via CDN) does not change.

from kroki.

ggrossetie avatar ggrossetie commented on June 5, 2024

Fixed in 2965a67
Thanks @gerlingsm 🙌🏻

from kroki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.