Closed saheljalal closed 1 year ago
I had the same issue it was because it was blocked by CSP (Content-Security-Policies). You can look in your browsers developer tools to see if the same happens in your case.
Adding the following configuration to app-config.yaml
solved it for me:
backend:
csp:
img-src: ["'self'", 'https://kroki.io/']
Hi @kichristensen thanks for the input. My config is currently set with the following which I think is more permissive:
csp:
connect-src: ['self', 'http:', 'https:']
img-src: ['self', 'http:', 'https:', 'data:']
But the URL link generation is what struck me as wrong since it includes None
like a python failure. The images do get generated but are located a directory above so I think something feels wrong with the link generation and not sure who is responsible for wiring things up π€· .
@saheljalal do you think that this could be mkdocs issue? @kichristensen could you share your mkdocs setup and version numbers etc?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Also facing issue
So I solved this issue with this workaround. By adding an empty site_url
it appears to fix the issue so maybe this can be closed out?
@benjdlambert Seems like this is a plugin issue for mkdocs and kroki. Not sure how they will fix but I was able to fix it with workaround above βοΈ
Alright, closing as there is a workaround!
π Description
I'm not sure what's going on with my Backstage deployment but for TechDocs pages that are using the Kroki service to generate images, the images are not rendering. Seeing this:
Backstage logging shows something like this with 404 response:
The local images appear to be created successfully and are located at the root folder under
my-component/images/kroki_generated
so it looks like the paths generated are incorrect. I can request the svg from the API with the correct path manually usingcurl
. The end to end integration fails withlocal
strategy and GCS in my deployment as well.Additionally, running the same project locally with
mkdocs serve
works perfectly fine so something feels broken between the Backstage TechDocs backend and plugin possibly.The part the doesn't make sense is the
Noneimages/
bit which looks like some Python parsing issue maybe?π Expected behavior
Render all images correctly on the site.
π Actual Behavior with Screenshots
Returns 404 for missing image link, and appears to generate incorrect path.
π Reproduction steps
This is occurring in my project which I've upgraded several times, I haven't tried with a new scaffolded project recently. But the main pieces would be:
mkdocs.yml
includingπ Provide the context for the Bug.
This is a blocker for us to be able to use diagramming with Kroki.
π₯οΈ Your Environment
π Have you spent some time to check if this bug has been raised before?
π’ Have you read the Code of Conduct?
Are you willing to submit PR?
No, I don't have time to work on this right now