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

Pull Prod #75

Merged
merged 83 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
633a640
Translated using Weblate (Bulgarian)
MrEddX Jul 12, 2024
239c269
Translated using Weblate (German)
marco-doerig Jul 12, 2024
f19be09
Translated using Weblate (French)
cyril59310 Jul 12, 2024
74f8a24
Translated using Weblate (Russian)
Jul 12, 2024
ae4dc06
Translated using Weblate (Turkish)
Genc Jul 12, 2024
a5775df
Translated using Weblate (Ukrainian)
stanol Jul 12, 2024
a87b836
Translated using Weblate (Romanian)
kindercat Jul 12, 2024
fba3eac
Translated using Weblate (French)
nicolasverlhiac Jul 12, 2024
7d728c2
Translated using Weblate (Swedish)
GunnarNorin Jul 12, 2024
9de3e7b
Translated using Weblate (Finnish)
imyller Jul 12, 2024
96e7c13
Translated using Weblate (Czech)
black23 Jul 12, 2024
f84aaf7
Translated using Weblate (Polish)
Saibamen Jul 12, 2024
5113b3f
Translated using Weblate (Hungarian)
gergepalfi Jul 12, 2024
215c572
Translated using Weblate (Japanese)
KEINOS Jul 12, 2024
504e8db
Translated using Weblate (Ukrainian)
hamx01 Jul 12, 2024
a2eee1f
Translated using Weblate (Urdu)
Zaid-maker Jul 12, 2024
1cb6616
Translated using Weblate (Bengali)
navidanindya Jul 12, 2024
c0ff596
Translated using Weblate (Portuguese (Portugal))
ChobPT Jul 12, 2024
e3c4f6d
Translated using Weblate (Persian)
ArianAr Jul 12, 2024
71bb19d
Translated using Weblate (Greek)
ntzallas Jul 12, 2024
2c9782d
Translated using Weblate (Greek)
andyxatz Jul 12, 2024
54acfae
Translated using Weblate (Greek)
SavvasMohito Jul 12, 2024
ee54a3b
Translated using Weblate (Chinese (Traditional, Hong Kong))
hugo0024 Jul 12, 2024
032ba4a
Translated using Weblate (Japanese)
nazo6 Jul 12, 2024
a698069
Translated using Weblate (Japanese)
KEINOS Jul 12, 2024
e08cee2
Translated using Weblate (Portuguese (Brazil))
lucasbaccan Jul 12, 2024
cada9aa
Translated using Weblate (Chinese (Simplified))
AnnAngela Jul 12, 2024
73873d4
Translated using Weblate (Chinese (Traditional))
max-alfred Jul 12, 2024
6fe0358
Translated using Weblate (Belarusian)
k1llo Jul 12, 2024
157e100
Translated using Weblate (Portuguese)
leosgarcia Jul 12, 2024
3028d9b
Translated using Weblate (Dutch)
nl-mulderj Jul 12, 2024
cc8c409
Translated using Weblate (Irish)
aindriu80 Jul 12, 2024
921f1a2
Translated using Weblate (Portuguese (Brazil))
owmsoton Jul 12, 2024
2bdd862
Translated using Weblate (Croatian)
ivanbratovic Jul 12, 2024
dab26b1
Translated using Weblate (Hungarian)
pofagyalu Jul 12, 2024
3bec59a
Translated using Weblate (Polish)
mic-pie Jul 12, 2024
1d29544
Translated using Weblate (Catalan)
erphise Jul 12, 2024
ff37c68
Translated using Weblate (Czech)
black23 Jul 19, 2024
5ae4590
Translated using Weblate (Spanish)
SrIzan10 Jul 19, 2024
da805ce
Translated using Weblate (Slovak)
Phiton12 Jul 19, 2024
26ff2c3
Translated using Weblate (Persian)
ArianAr Jul 23, 2024
5897133
Translated using Weblate (Indonesian)
harsxv Jul 24, 2024
b690376
Translated using Weblate (Dutch)
nl-mulderj Jul 22, 2024
50ec9e5
Translated using Weblate (Dutch)
Zandor300 Jul 22, 2024
36e7266
Translated using Weblate (Slovak)
Phiton12 Jul 23, 2024
8b096a5
Translated using Weblate (Persian)
aljvdi Jul 25, 2024
8138316
Translated using Weblate (Italian)
sausyn Jul 25, 2024
48539c4
Translated using Weblate (Italian)
berry-13 Jul 25, 2024
e8c7445
Translated using Weblate (Spanish)
ethanfiggs Jul 28, 2024
74bb44e
Translated using Weblate (Xhosa)
ethanfiggs Jul 28, 2024
6e8d4e8
Added translation using Weblate (Lithuanian)
Jul 30, 2024
6dddf03
Translated using Weblate (Lithuanian)
Jul 30, 2024
f5f86e5
Translated using Weblate (Thai)
pipemsn Aug 2, 2024
3a2385b
Translated using Weblate (Lithuanian)
Aug 6, 2024
d6e254d
Added translation using Weblate (Macedonian)
dimitrovleonardo Aug 8, 2024
895bf7c
Translated using Weblate (Chinese (Simplified))
brookqin Aug 8, 2024
5fcc8cf
Translated using Weblate (Macedonian)
dimitrovleonardo Aug 8, 2024
8e4b9dd
Added translation using Weblate (Chinese (Literary))
15159617213 Aug 14, 2024
fe5035d
Translated using Weblate (Russian)
RedGuys Aug 22, 2024
643d28c
Extend Prometheus Labels to include tags (requires restart for NEW la…
spali Aug 24, 2024
bde3d0e
Add translation key for `time ago` (#4813)
CommanderStorm Aug 24, 2024
4b68a86
Extend length of status bars in status page (#4376)
amyyeung17 Aug 24, 2024
0ddf35e
Removed now unnecessary version checking (#4815)
CommanderStorm Aug 24, 2024
9486fa2
made sure that the socket handlers have consitent names (#4818)
CommanderStorm Aug 24, 2024
3e88772
Fix: name column in the dashboad being squashed in some aspect ratios…
jaybhanushali3166 Aug 24, 2024
4cb264a
Add translation keys (#5046)
cyril59310 Aug 24, 2024
dc3ad88
Add option to pass cache bust param (#3525)
dansullivan86 Aug 24, 2024
b059c19
Add WPush Notification Provider (#5049)
anhao Aug 26, 2024
f8d34f2
Translated using Weblate (Polish)
krzyssiek Aug 26, 2024
01210ce
Add url to pushover notification (#5055)
aizatto Aug 28, 2024
3d9bbe1
Improve Playwright/E2E testing setup (#5056)
simshaun Aug 28, 2024
716832b
New Notification Provider SIGNL4 (#5058)
rons4 Aug 28, 2024
562de6a
fix: undefined in log while creating a new monitor (#5053)
prabhsharan36 Aug 28, 2024
032ac16
Fixed the url of the SIGNL4 docs as requested in a PR
CommanderStorm Aug 29, 2024
3346111
Translated using Weblate (Catalan)
s3rgi Aug 29, 2024
36f8be0
Monitor Conditions (#5048)
simshaun Aug 30, 2024
362a890
Merge remote-tracking branch 'origin/master' into master-weblate
louislam Aug 31, 2024
ba46945
Fix weblate conflict and new translations (#5071)
louislam Aug 31, 2024
c567e8e
Status Page E2E spec (#5068)
simshaun Sep 1, 2024
11f108b
Remove .devcontainer (#5074)
louislam Sep 2, 2024
935194b
feat: implement very crude and bare-bones RSS feed (#5047)
MrYakobo Sep 3, 2024
3c23a34
Fix missing monitors in subgroups due to missing filterFunc (#5084)
David-Development Sep 4, 2024
dd75890
Added a Belarusian language code (#5103)
whiteonred Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .devcontainer/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions .devcontainer/devcontainer.json

This file was deleted.

1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ README.md
.vscode
.eslint*
.stylelint*
/.devcontainer
/.github
yarn.lock
app.json
Expand Down
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,6 @@ The goal is to make the Uptime Kuma installation as easy as installing a mobile
- IDE that supports [`ESLint`](https://eslint.org/) and EditorConfig (I am using [`IntelliJ IDEA`](https://www.jetbrains.com/idea/))
- A SQLite GUI tool (f.ex. [`SQLite Expert Personal`](https://www.sqliteexpert.com/download.html) or [`DBeaver Community`](https://dbeaver.io/download/))

### GitHub Codespaces

If you don't want to setup an local environment, you can now develop on GitHub Codespaces, read more:

https://github.com/louislam/uptime-kuma/tree/master/.devcontainer

## Git Branches

- `master`: 2.X.X development. If you want to add a new feature, your pull request should base on this.
Expand Down
14 changes: 10 additions & 4 deletions config/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineConfig, devices } from "@playwright/test";

const port = 30001;
const url = `http://localhost:${port}`;
export const url = `http://localhost:${port}`;

export default defineConfig({
// Look for test files in the "tests" directory, relative to this configuration file.
testDir: "../test/e2e",
testDir: "../test/e2e/specs",
outputDir: "../private/playwright-test-results",
fullyParallel: false,
locale: "en-US",
Expand Down Expand Up @@ -40,9 +40,15 @@ export default defineConfig({
// Configure projects for major browsers.
projects: [
{
name: "chromium",
name: "run-once setup",
testMatch: /setup-process\.once\.js/,
use: { ...devices["Desktop Chrome"] },
},
{
name: "specs",
use: { ...devices["Desktop Chrome"] },
dependencies: [ "run-once setup" ],
},
/*
{
name: "firefox",
Expand All @@ -52,7 +58,7 @@ export default defineConfig({

// Run your local dev server before starting the tests.
webServer: {
command: `node extra/remove-playwright-test-data.js && node server/server.js --port=${port} --data-dir=./data/playwright-test`,
command: `node extra/remove-playwright-test-data.js && cross-env NODE_ENV=development node server/server.js --port=${port} --data-dir=./data/playwright-test`,
url,
reuseExistingServer: false,
cwd: "../",
Expand Down
13 changes: 13 additions & 0 deletions db/knex_migrations/2024-08-24-000-add-cache-bust.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.boolean("cache_bust").notNullable().defaultTo(false);
});
};

exports.down = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.dropColumn("cache_bust");
});
};
12 changes: 12 additions & 0 deletions db/knex_migrations/2024-08-24-0000-conditions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.text("conditions").notNullable().defaultTo("[]");
});
};

exports.down = function (knex) {
return knex.schema.alterTable("monitor", function (table) {
table.dropColumn("conditions");
});
};
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
"build": "vite build --config ./config/vite.config.js",
"test": "npm run test-backend && npm run test-e2e",
"test-with-build": "npm run build && npm test",
"test-backend": "node test/backend-test-entry.js",
"test-backend:14": "cross-env TEST_BACKEND=1 NODE_OPTIONS=\"--experimental-abortcontroller --no-warnings\" node--test test/backend-test",
"test-backend:18": "cross-env TEST_BACKEND=1 node --test test/backend-test",
"test-backend": "cross-env TEST_BACKEND=1 node --test test/backend-test",
"test-e2e": "playwright test --config ./config/playwright.config.js",
"test-e2e-ui": "playwright test --config ./config/playwright.config.js --ui --ui-port=51063",
"playwright-codegen": "playwright codegen localhost:3000 --save-storage=./private/e2e-auth.json",
Expand Down Expand Up @@ -96,6 +94,7 @@
"express": "~4.19.2",
"express-basic-auth": "~1.2.1",
"express-static-gzip": "~2.1.7",
"feed": "^4.2.2",
"form-data": "~4.0.0",
"gamedig": "^4.2.0",
"html-escaper": "^3.0.3",
Expand Down
27 changes: 27 additions & 0 deletions server/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,32 @@ async function sendRemoteBrowserList(socket) {
return list;
}

/**
* Send list of monitor types to client
* @param {Socket} socket Socket.io socket instance
* @returns {Promise<void>}
*/
async function sendMonitorTypeList(socket) {
const result = Object.entries(UptimeKumaServer.monitorTypeList).map(([ key, type ]) => {
return [ key, {
supportsConditions: type.supportsConditions,
conditionVariables: type.conditionVariables.map(v => {
return {
id: v.id,
operators: v.operators.map(o => {
return {
id: o.id,
caption: o.caption,
};
}),
};
}),
}];
});

io.to(socket.userID).emit("monitorTypeList", Object.fromEntries(result));
}

module.exports = {
sendNotificationList,
sendImportantHeartbeatList,
Expand All @@ -222,4 +248,5 @@ module.exports = {
sendInfo,
sendDockerHostList,
sendRemoteBrowserList,
sendMonitorTypeList,
};
22 changes: 20 additions & 2 deletions server/model/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,12 @@ class Monitor extends BeanModel {
kafkaProducerAllowAutoTopicCreation: this.getKafkaProducerAllowAutoTopicCreation(),
kafkaProducerMessage: this.kafkaProducerMessage,
screenshot,
cacheBust: this.getCacheBust(),
remote_browser: this.remote_browser,
snmpOid: this.snmpOid,
jsonPathOperator: this.jsonPathOperator,
snmpVersion: this.snmpVersion,
conditions: JSON.parse(this.conditions),
};

if (includeSensitiveData) {
Expand Down Expand Up @@ -295,6 +297,14 @@ class Monitor extends BeanModel {
return Boolean(this.grpcEnableTls);
}

/**
* Parse to boolean
* @returns {boolean} if cachebusting is enabled
*/
getCacheBust() {
return Boolean(this.cacheBust);
}

/**
* Get accepted status codes
* @returns {object} Accepted status codes
Expand Down Expand Up @@ -336,7 +346,7 @@ class Monitor extends BeanModel {
let previousBeat = null;
let retries = 0;

this.prometheus = new Prometheus(this);
this.prometheus = await Prometheus.createAndInitMetrics(this);

const beat = async () => {

Expand Down Expand Up @@ -500,6 +510,14 @@ class Monitor extends BeanModel {
options.data = bodyValue;
}

if (this.cacheBust) {
const randomFloatString = Math.random().toString(36);
const cacheBust = randomFloatString.substring(2);
options.params = {
uptime_kuma_cachebuster: cacheBust,
};
}

if (this.proxy_id) {
const proxy = await R.load("proxy", this.proxy_id);

Expand Down Expand Up @@ -980,7 +998,7 @@ class Monitor extends BeanModel {
await R.store(bean);

log.debug("monitor", `[${this.name}] prometheus.update`);
this.prometheus?.update(bean, tlsInfo);
await this.prometheus?.update(bean, tlsInfo);

previousBeat = bean;

Expand Down
Loading
Loading