-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Subdirectory deployment #1092
base: master
Are you sure you want to change the base?
Subdirectory deployment #1092
Conversation
configurable using BASE_PATH env variable
change icon paths to relative
remove unnecessary regex escape
Co-authored-by: Adam Stachowicz <[email protected]>
@louislam can you please help me with the implementation details? I have a few questions in TODO in the first comment. |
I have merged this PR in my fork and experienced a strange behaviour. When pressing the Edit Button on an already existing Notification it redirects me to the Status page. I wanted to open a Issue to Kuma directly when it occurred to me that I have this probably "not fully tested" PR in my fork. Maybe @trogper can you check if this happens on your site too? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This is helpful, but It seems that this Pull Request in its current state is not compatible with current master as your Dockerfile describes. |
Yes, the are minor conflicts. I'll solve them when I get some time for it |
@ckocyigit That is true. At the time I posted there were no conflicts. If you need it immediately I do have an older version on dockerhub you can use in the interim: https://hub.docker.com/r/zacharlie/dbstack-monitor |
@trogper just a heads up I also tested and noticed the issue described above with notification editing when merging this |
Thanks, I know about the issue already |
This comment was marked as resolved.
This comment was marked as resolved.
replaced <a> with <router-link>, replaced 'location.href =' navigation by router.push()
Question to @CommanderStorm or @louislam: could we run a I'm checking on my side, and it seems I only need to change a few files (including the times I change Here is my WIP branch about how we could use Vite base: https://github.com/Ionys320/uptime-kuma/tree/feat/subpath. Matching commit: Ionys320@8ccbbee |
Cannot, unless the docker image includes all dev dependencies / build tools which probably is more complicated and I don't want to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on these changes? I was reading the diffs to try to understand them with my very limited frontend skills and didn't understand how these are related to subdirectories in any way.
Sorry for jumping in, great tool, thanks! I just wanted to share that the first thing I wanted to do when learning about and starting to deploy kuma was to deploy the app with the context path set not to the root dir but to a prefix dir in order to deal with the "subfolder problem". I saw here that a configurable URL Base is in the works, nice! It would be great to easily being able to avoid to give up the web root context for the subdomain entirely to kuma, but having it co-exist alongside other services under the same subdomain. I found the nginx config which is great but also rather extensive and possibly prone to breaking (by becoming obsolete quickly as the app changes or potentially from clashing with other services running on the same subdomain). I will try that solution/workaround out but it would be so nice if the app could be deployed in a subdir by setting the URL Base. With the contribution from #1092 (comment) getting configurable URL Base seems to progress nicely, but there are concerns about the need to avoid working with a "fat image" with too many dev deps bundled. I'd therefore just like to share that I have had good experiences from using multi stage builds (see https://v2.vuejs.org/v2/cookbook/dockerize-vuejs-app.html?redirect=true#Real-World-Example) which essentially makes it possible to have a build with a full dev environment from a base layer and in a subsequent step (in the same Containerfile or Dockerfile) use the outputs in a slimmed down production image which I believe could alleviate the concerns raised. So just a suggestion that maybe using a multi stage Containerfile/Dockerfile may allow to achive the equivalence of being able to "run a npm run build after Docker pull process" without significant disruption of the existing procedures and without introducing new tooling? |
Description
This adds support for Kuma deployment in http path subfolder. I have added two environment variables,
UPTIME_KUMA_BASE_PATH
andBASE_PATH
. The value should start and end with/
, but there is sanitization, which will add them.I have changed relevant paths in vue and html from absolute to relative and added html base tag, which is used byt the browser to build absolute paths from relative. Then I made express mount the former root to the specified
BASE_PATH
. Additionally I have fixed a few<a>
tags in vue to proper<router-link>
Socket.io does not support base tag by itself (it builds the connection url manually), so we have to prepend the basePath manually.
Fixes #147
TODO
There are a few things I would like someone to help me with:
basePath
calculation/variable? Currently it is inuptime-kuma/src/mixins/socket.js
Lines 116 to 120 in 812b4ad
uptime-kuma/src/components/settings/General.vue
Lines 268 to 271 in 812b4ad
Type of change
Checklist