Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubernetes ingress baseURL #157

Open
mihaigalos opened this issue Jun 8, 2024 · 1 comment
Open

Kubernetes ingress baseURL #157

mihaigalos opened this issue Jun 8, 2024 · 1 comment

Comments

@mihaigalos
Copy link

mihaigalos commented Jun 8, 2024

I would like to let this run in a Kubernetes environment. I've already written the chart for it and can contribute when fully operational.

I however am missing an app-side configuration which would allow me to serve content from a specified path.
A change would be required here:

-r.Mount("/", http.FileServer(http.FS(c.frontend)))
+r.Mount(baseURL + "/", http.FileServer(http.FS(c.frontend)))

This is the standard way of handling prefixing in other major apps (Prometheus, Grafana) and could be consumed though a config.yml parameter.

I know you're refactoring the repo which is why I'm not contributing a PR. Also, I cannot build from source with 7ea1c0b, but would love to contribute otherwise:

$ go build ./...
main.go:37:13: pattern frontend/dist/assets/*: no matching files found
@marcopeocchi
Copy link
Owner

Whilst I'll try to set up a local kubernetes cluster I've changed some code according to your requirements:

-r.Mount("/", http.FileServer(http.FS(c.frontend)))
+baseUrl := config.Instance().BaseURL
+r.Mount(baseUrl+"/", http.StripPrefix(baseUrl, http.FileServerFS(c.frontend)))

the BaseURL is configurable through the config.yml file with the base_url key:

...
base_url: "/hello"
...

marcopeocchi added a commit that referenced this issue Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants