docker-draw.io icon indicating copy to clipboard operation
docker-draw.io copied to clipboard

Offline redirection

Open VirtualEvan opened this issue 7 years ago • 5 comments

Would be possible to have the server configured to set the param ?offline=1 automatically? Maybe with some env variable

VirtualEvan avatar Oct 16 '18 14:10 VirtualEvan

Do you really mean offline (i.e. use the application cache), or stealth=1, stop all external connections?

davidjgraph avatar Oct 16 '18 15:10 davidjgraph

The idea is to remove the external connections, I guess is stealth then. I thought that that was the purpose of "offline", sorry.

VirtualEvan avatar Oct 16 '18 16:10 VirtualEvan

I'm used to acheive this by implementing URL redirection on a load-balancer/reverse-proxy sitting in front of draw.io container.

  • docker: using nginx/alpine
  • k8s: using Istio-ingressgateway + routing CRD

I can add an optional env variable to create an index.jsp containing the following command.

<%
    response.sendRedirect("/?offline=1")
%>

fjudith avatar Oct 17 '18 06:10 fjudith

That would be nice, thanks you After some tests I think that for me, offline will be enough. Maybe you can think about if it is worth to add both offline and stealth, it might be useful

But as I said, for me, offline will do the job

VirtualEvan avatar Oct 17 '18 07:10 VirtualEvan

This is the index.jsp I am using in the meanwhile to add the "offline" param

<%

    String params = request.getQueryString();

    if(params == null)
        response.sendRedirect("/index.html?offline=1");
    else if(!params.contains("offline=1"))
        response.sendRedirect("/index.html?offline=1&" + request.getQueryString());
    else
        response.sendRedirect("/index.html?" + request.getQueryString());

%>

VirtualEvan avatar Nov 08 '18 14:11 VirtualEvan