louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
60.21k stars 5.38k forks source link

Compiling Changes Made to Front End #3509

Closed btmolloy closed 1 year ago

btmolloy commented 1 year ago

⚠️ Please verify that this bug has NOT been raised before.

🛡️ Security Policy

📝 Describe your problem

Alright, I love Kuma as it has tons of features that make it better than Uptime Robot, however, there is one that I cannot go without which is the ability to have only SSL/CERT messages go to a notification provider (In my case Google Chat) A.K.A. Filtered Alerts. This isn't an issue though because I am more than fine with adding this feature myself for my copy of Kuma, however, whenever I make changes to any file within the /src/ directory, the changes to not apply to the active build. I have been spending the past few weeks trying to troubleshoot/research this issue however I have had no luck. I have read almost every page of the Wiki and have read every discussion post that has similarities to this issue. I have followed all of the steps on the CONTRIBUTING wiki page but have had no luck. No matter what command or research I do, nothing works to compile the src files. Has anyone experienced a similar issue or and I having some sort of user error?

📝 Error Message(s) or Log

No response

🐻 Uptime-Kuma Version

1.22.1

💻 Operating System and Arch

Ubuntu 22.04

🌐 Browser

Chrome

🐋 Docker Version

N/A

🟩 NodeJS Version

v18.16.0

CommanderStorm commented 1 year ago

What files have you changed (and how)? The changes I made to src always applied to development builds without any problems. (we are talking about dev-builds, right?)

btmolloy commented 1 year ago

Hi Commander, I have changed a number of files such as /src/components/NotificationDialog.vue /src/components/notifications/GoogleChat.vue /src/components/notifications/index.js and Ive even tried changing simple phrases in /src/pages/Settings.vue just to see if any file will reflect the changes made. How I changed these files are with the command "sudo nano FILE_NAME" from the command line of the ssh session. Could you provide more information on what you mean by "applied to development builds"? (are you referencing the "Frontend Dev Server" section of the CONTRIBUTING wiki page when you say dev-builds?)

EDIT: Didn't mean to close this issue when submitting comment.

CommanderStorm commented 1 year ago

I mean, have you followed the guide for getting a dev-environment vs a production-environemt.

(what do you mean by active build in the changes to not apply to the active build?)

How are you running your code? (docker vs native using nodejs vs native using pm2)

btmolloy commented 1 year ago

Ah... I see this is where my issue is... Maybe? I followed the production-environment guide when initially setting it up so I guess that means I have a production environment, right? In my troubleshooting initially, when I tried following the dev-environment steps I got stopped at the "npm run build" command as it errored out saying:

ubuntu@uptime:/opt/uptime-kuma$ sudo npm run build

uptime-kuma@1.22.1 build vite build --config ./config/vite.config.js

sh: 1: vite: not found

Also, my apologies about the incorrect terminology, when I said active build I was referencing the current compiled code that is being shown on the front end. And to answer your last question, I believe I am running my code native using pm2 to keep it running always.

CommanderStorm commented 1 year ago

So this is resolved?

First of all: please don't (!) develop in production. That sounds horrifying. Also note that npm run setup (because it is being used as a production deployment) is an alias for

https://github.com/louislam/uptime-kuma/blob/157cf47d38fb0aa7e35aaea1f32c5818965314d2/package.json#L43

Depending on what you are trying to achieve (and what git commands you have run previously), this might be one of your frustrations. ^^

btmolloy commented 1 year ago

Haha, the last few weeks have been horrifying trying to do so. Alright, almost resolved, just one last relating question. For moving forward would you suggest that I just get a fresh copy of the kuma directory and then start following the "Install Dependencies for Development" guide/instruction and so on, in order to get a dev-env that I can add frontend/backend features?

CommanderStorm commented 1 year ago

Yes, forking this Repo is required by the contribution guide if you want to be able to contribute them upstream.

You will notice that the dev-workflow is much nicer with hot-module-replacement on the frontend.

For the next time, don't wait for weeks to reach out (you should obviously debug before asking for help, but debugging for weeks is probably excessive) and please stop developing in production!

btmolloy commented 1 year ago

Alright thank you for all of the help! If I have any other questions, that don't have issue discussions, I will reach out again!