Dirty Docker Hack for WikiJS PlantUML

WikiJS 2 is a great wiki server that includes support for PlantUML in markdown. If you want it to use your own PlantUML server for rendering, it’s a simple matter of changing a setting. Unfortunately, the editor is essentially hard-coded to use https://plantuml.requarks.io, and there isn’t currently a way to override it (there’s a two year old pull request that hasn’t been merged yet).

However, if you’re hosting WIkiJS in a container and super lazy, you may find this diabolical Dockerfile hack useful until WikiJS 3 is released:

FROM ghcr.io/requarks/wiki:2

RUN grep -rl plantuml.requarks.io /wiki/server | xargs sed -i 's,https://plantuml.requarks.io,https://MY_PLANTUML_URL,g' && \
    grep -rl plantuml.requarks.io /wiki/assets/js | xargs sed -i 's,https://plantuml.requarks.io,https://MY_PLANTUML_URL,g'

Basically it’s just creating a new image and replacing the https://plantuml.requarks.io URL with your own.

One Comment

  1. The PlantUML renderer does respect the PlantUML server setting, you just need to rerender all pages in order for this to take effect as otherwise pages are served from the cache based on their hash with the previous PlantUML server (the hash of the page contents does not change when changing the PlantUML server). The rerendering of all pages can be done in the Utilities section under the Content subsection.

    Reply

Leave a comment