Git Product home page Git Product logo

Comments (9)

rubenfiszel avatar rubenfiszel commented on September 6, 2024 1

It should work but regardless, you should find out in your tests soon enough. Yes, if you can do the work, we will be gladly accepting your PR, thank you very much!

from windmill.

bigcat88 avatar bigcat88 commented on September 6, 2024

I noticed a similar request regarding subpath support in this previous issue

As mentioned in that issue, it was considered too niche and required a lot of work.

We are willing to work on this feature and submit a PR to address the necessary changes. Before proceeding, could you please confirm if the team would be open to reviewing and merging a PR that adds support for non-root iFrame embedding by respecting config.kit.paths.base in goto operations?

from windmill.

rubenfiszel avatar rubenfiszel commented on September 6, 2024

The issue with svelte.config.js approach is that it require to maintain your own fork of windmill which will be a heavy burden. Ideally, we can find a solution that work with the stock image of windmill and can be passed as env variable without requiring a re-build of the frontend.

from windmill.

rubenfiszel avatar rubenfiszel commented on September 6, 2024

Do you have any possibility to have windmill be hosted as a subdomain, for instance:
http://windmill.nextcloud.local ?

from windmill.

rubenfiszel avatar rubenfiszel commented on September 6, 2024

The other possibility that i see is that we have a new image that support windmill not as a SPA with fallback mode, but as a server rendered website (running the frontend on node.js) that you can pass the base as an env variable to the image.

from windmill.

bigcat88 avatar bigcat88 commented on September 6, 2024

From what I know, we still want to install Windmill as a container, and it’s not difficult for us to rebuild only the frontend without rebuilding the entire binary when we creating that container.
And to serve frontend from that folder(let's call it static_frontend)

We need all the “goto” to add the 'base' value from svelte.config.js as a prefix. And maybe some "hrefs" with absolute urls need to respect 'base' too.

Something like this:

function customGoto(href, options) {
  const prefix = '/custom-prefix'; // we will take it from "svelte.config.js"
  const modifiedHref = prefix + href;

  // Call the original goto function with the modified URL
  return originalGoto(modifiedHref, options);
}

from windmill.

rubenfiszel avatar rubenfiszel commented on September 6, 2024

it’s not difficult for us to rebuild only the frontend without rebuilding the entire binary when we creating that container.

It may reveal itself more complex than it first appears. We use multi-stage build so the frontend doesn't exist in the container anymore when you run it, there is only the static assets. And if you want to re-pull the frontend from source, you will need to make sure the commit match exactly the image. It's a lot of machinery.

Are you absolutely certain you cannot use a subdomain ?

from windmill.

bigcat88 avatar bigcat88 commented on September 6, 2024

And if you want to re-pull the frontend from source, you will need to make sure the commit match exactly the image. It's a lot of machinery.

ARG WINDMILL_VERSION=1.338.3
FROM ghcr.io/windmill-labs/windmill:${WINDMILL_VERSION}

# Clone Windmill to build it's frontend with our custom URL for AppAPI
RUN git clone --depth 1 --branch v${WINDMILL_VERSION} https://github.com/windmill-labs/windmill.git /windmill_tmp

RUN cd /windmill_tmp/frontend && \
    npm install
    
# Change svelte base URL
RUN cd /windmill_tmp/frontend && \
    basePath="/apps/app_api/proxy/windmill_app" && \
    configFilePath="svelte.config.js" && \
    sed -i "/kit: {/a \
            paths: {\
                base: '${basePath}'\
            }," "$configFilePath"

# Generate OpenAPI data
RUN cd /windmill_tmp/frontend && \
    npm run generate-backend-client

# Set URL for backend in generated OpenAPI data
RUN sed -i "s|BASE: '/api'|BASE: '/apps/app_api/proxy/windmill_app/api'|" /windmill_tmp/frontend/src/lib/gen/core/OpenAPI.ts

# Build Windmill's frontend
RUN cd /windmill_tmp/frontend && \
    NODE_OPTIONS=--max_old_space_size=8096 npm run build && \
    rm -rf /static_frontend && \
    mv build /static_frontend

/api/ and /user(except user/login) requests go to windmill

all other requests takes stuff from /static_frontend

Will this work or I have missed something?

from windmill.

bigcat88 avatar bigcat88 commented on September 6, 2024

Does frontend for EE differs from default one?
As we change basePath and plan use frontend from standart image for EE edition - will it work, or the source for EE are different?

from windmill.

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.