kylec32 / dokuwiki_plantumlparser

A plugin to have a user's browser display a SVG PlantUML diagram generated at http://plantuml.com/
MIT License
8 stars 12 forks source link

No internet access required for wiki server #31

Open sebmaynard opened 4 years ago

sebmaynard commented 4 years ago

Hi, In the README, it says:

No internet access required for wiki server.

However, in PlantUmlDiagram.php, it generates the diagrams by fetching them from https://www.plantuml.com/plantuml/, with the format appended on the end.

To verify this I replaced the hostname with localhost, and now all my diagrams fail to generate.

Please could you explain what you meant by "No internet access required for wiki server"?

Thank you!

sebmaynard commented 4 years ago

As a second test for this, I ran the plantuml server locally on the same instance as my dokuwiki server:

docker run -d -p 8080:8080 plantuml/plantuml-server:jetty

Then changed the $basePath in PlantUmlDiagram.php to http://localhost:8080/; this then means that my server can now generate PlantUml SVG diagrams (and the other types) without needing to access plantuml.com

Any chance this could become an ini variable? If I get a chance, I'll investigate how plugins work and try and figure it out!

kylec32 commented 4 years ago

With how it's set up the expectation is that it tries to make the request from the server, if it doesn't succeed it just sends the url to the web browser to have it render. In this way the server doesn't need to have internet access, the browser just has to to be to access the internet. The code that performs this action can be seen here. https://github.com/kylec32/dokuwiki_plantumlparser/blob/master/syntax/injector.php#L70

I'm supportive of adding the ability to use an alternate PlantUML server if you wanted to contribute that ability.

On Thu, Jan 30, 2020 at 2:59 AM Seb Maynard notifications@github.com wrote:

As a second test for this, I ran the plantuml server locally on the same instance as my dokuwiki server:

docker run -d -p 8080:8080 plantuml/plantuml-server:jetty

Then changed the $basePath in PlantUmlDiagram.php to http://localhost:8080/; this then means that my server can now generate PlantUml SVG diagrams (and the other types) without needing to access plantuml.com

Any chance this could become an ini variable? If I get a chance, I'll investigate how plugins work and try and figure it out!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kylec32/dokuwiki_plantumlparser/issues/31?email_source=notifications&email_token=AABHHP6ANSDLHMM7QQHUUETRAKQI5A5CNFSM4KNSOXG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKKMYJI#issuecomment-580176933, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHHP2EUAHSDOA44UQ3W7DRAKQI5ANCNFSM4KNSOXGQ .

-- Kyle Carter (435) 215-4727