Skip to content

Commit

Permalink
Merge branch 'master' into feature-slow-response-notification
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenpapierski authored Jan 16, 2024
2 parents e4b7913 + 8456912 commit 555f09f
Show file tree
Hide file tree
Showing 39 changed files with 6,386 additions and 9,270 deletions.
17 changes: 0 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,6 @@ module.exports = {
}
},

// Override for jest puppeteer
{
"files": [
"**/*.spec.js",
"**/*.spec.jsx"
],
env: {
jest: true,
},
globals: {
page: true,
browser: true,
context: true,
jestPuppeteer: true,
},
},

// Override for TypeScript
{
"files": [
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/ask-for-help.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "⚠️ Please verify that this bug has NOT been raised before."
label: "⚠️ Please verify that this question has NOT been raised before."
description: "Search in the issues sections by clicking [HERE](https://github.com/louislam/uptime-kuma/issues?q=)"
options:
- label: "I checked and didn't find similar issue"
Expand Down
31 changes: 8 additions & 23 deletions .github/workflows/auto-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
auto-test:
needs: [ check-linters ]
needs: [ check-linters, e2e-test ]
runs-on: ${{ matrix.os }}
timeout-minutes: 15

Expand All @@ -36,7 +36,7 @@ jobs:
- run: npm install npm@9 -g
- run: npm install
- run: npm run build
- run: npm test
- run: npm run test-backend
env:
HEADLESS_TEST: 1
JUST_FOR_TEST: ${{ secrets.JUST_FOR_TEST }}
Expand Down Expand Up @@ -78,33 +78,18 @@ jobs:
- run: npm install
- run: npm run lint:prod

# TODO: Temporarily disable, as it cannot pass the test in 2.0.0 yet
# e2e-tests:
# needs: [ check-linters ]
# runs-on: ubuntu-latest
# steps:
# - run: git config --global core.autocrlf false # Mainly for Windows
# - uses: actions/checkout@v4
#
# - name: Use Node.js 14
# uses: actions/setup-node@v4
# with:
# node-version: 14
# - run: npm install
# - run: npm run build
# - run: npm run cy:test

frontend-unit-tests:
e2e-test:
needs: [ check-linters ]
runs-on: ubuntu-latest
runs-on: ARM64
steps:
- run: git config --global core.autocrlf false # Mainly for Windows
- uses: actions/checkout@v4

- name: Use Node.js 14
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
- run: npm install
- run: npx playwright install
- run: npm run build
- run: npm run cy:run:unit
- run: npm run test-e2e
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ dist-ssr
/tmp
.env

cypress/videos
cypress/screenshots

/extra/healthcheck.exe
/extra/healthcheck
/extra/healthcheck-armv7
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Uptime Kuma is an easy-to-use self-hosted monitoring tool.

<a target="_blank" href="https://github.com/louislam/uptime-kuma"><img src="https://img.shields.io/github/stars/louislam/uptime-kuma" /></a> <a target="_blank" href="https://hub.docker.com/r/louislam/uptime-kuma"><img src="https://img.shields.io/docker/pulls/louislam/uptime-kuma" /></a> <a target="_blank" href="https://hub.docker.com/r/louislam/uptime-kuma"><img src="https://img.shields.io/docker/v/louislam/uptime-kuma/latest?label=docker%20image%20ver." /></a> <a target="_blank" href="https://github.com/louislam/uptime-kuma"><img src="https://img.shields.io/github/last-commit/louislam/uptime-kuma" /></a> <a target="_blank" href="https://opencollective.com/uptime-kuma"><img src="https://opencollective.com/uptime-kuma/total/badge.svg?label=Open%20Collective%20Backers&color=brightgreen" /></a>
<a target="_blank" href="https://github.com/louislam/uptime-kuma"><img src="https://img.shields.io/github/stars/louislam/uptime-kuma?style=flat" /></a> <a target="_blank" href="https://hub.docker.com/r/louislam/uptime-kuma"><img src="https://img.shields.io/docker/pulls/louislam/uptime-kuma" /></a> <a target="_blank" href="https://hub.docker.com/r/louislam/uptime-kuma"><img src="https://img.shields.io/docker/v/louislam/uptime-kuma/latest?label=docker%20image%20ver." /></a> <a target="_blank" href="https://github.com/louislam/uptime-kuma"><img src="https://img.shields.io/github/last-commit/louislam/uptime-kuma" /></a> <a target="_blank" href="https://opencollective.com/uptime-kuma"><img src="https://opencollective.com/uptime-kuma/total/badge.svg?label=Open%20Collective%20Backers&color=brightgreen" /></a>
[![GitHub Sponsors](https://img.shields.io/github/sponsors/louislam?label=GitHub%20Sponsors)](https://github.com/sponsors/louislam) <a href="https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/">
<img src="https://weblate.kuma.pet/widgets/uptime-kuma/-/svg-badge.svg" alt="Translation status" />
</a>
Expand All @@ -17,9 +17,9 @@ Uptime Kuma is an easy-to-use self-hosted monitoring tool.

Try it!

- Tokyo Demo Server: https://demo.uptime.kuma.pet (Sponsored by [Uptime Kuma Sponsors](https://github.com/louislam/uptime-kuma#%EF%B8%8F-sponsors))
Demo Server (Location: Frankfurt - Germany): https://demo.kuma.pet/start-demo

It is a temporary live demo, all data will be deleted after 10 minutes. Use the one that is closer to you, but I suggest that you should install and try it out for the best demo experience.
It is a temporary live demo, all data will be deleted after 10 minutes. Sponsored by [Uptime Kuma Sponsors](https://github.com/louislam/uptime-kuma#%EF%B8%8F-sponsors).

## ⭐ Features

Expand Down
9 changes: 9 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
uptime-kuma:
image: louislam/uptime-kuma:1
volumes:
- ./data:/app/data
ports:
# <Host Port>:<Container Port>
- 3001:3001
restart: unless-stopped
60 changes: 60 additions & 0 deletions config/playwright.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { defineConfig, devices } from "@playwright/test";

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

export default defineConfig({
// Look for test files in the "tests" directory, relative to this configuration file.
testDir: "../test/e2e",
outputDir: "../private/playwright-test-results",
fullyParallel: false,
locale: "en-US",

// Fail the build on CI if you accidentally left test.only in the source code.
forbidOnly: !!process.env.CI,

// Retry on CI only.
retries: process.env.CI ? 2 : 0,

// Opt out of parallel tests on CI.
workers: 1,

// Reporter to use
reporter: [
[
"html", {
outputFolder: "../private/playwright-report",
open: "never",
}
],
],

use: {
// Base URL to use in actions like `await page.goto('/')`.
baseURL: url,

// Collect trace when retrying the failed test.
trace: "on-first-retry",
},

// Configure projects for major browsers.
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
/*
{
name: "firefox",
use: { browserName: "firefox" }
},*/
],

// 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`,
url,
reuseExistingServer: false,
cwd: "../",
},
});
24 changes: 24 additions & 0 deletions db/knex_migrations/2023-12-21-0000-stat-ping-min-max.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
exports.up = function (knex) {
return knex.schema
.alterTable("stat_daily", function (table) {
table.float("ping_min").notNullable().defaultTo(0).comment("Minimum ping during this period in milliseconds");
table.float("ping_max").notNullable().defaultTo(0).comment("Maximum ping during this period in milliseconds");
})
.alterTable("stat_minutely", function (table) {
table.float("ping_min").notNullable().defaultTo(0).comment("Minimum ping during this period in milliseconds");
table.float("ping_max").notNullable().defaultTo(0).comment("Maximum ping during this period in milliseconds");
});

};

exports.down = function (knex) {
return knex.schema
.alterTable("stat_daily", function (table) {
table.dropColumn("ping_min");
table.dropColumn("ping_max");
})
.alterTable("stat_minutely", function (table) {
table.dropColumn("ping_min");
table.dropColumn("ping_max");
});
};
26 changes: 26 additions & 0 deletions db/knex_migrations/2023-12-22-0000-hourly-uptime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
exports.up = function (knex) {
return knex.schema
.createTable("stat_hourly", function (table) {
table.increments("id");
table.comment("This table contains the hourly aggregate statistics for each monitor");
table.integer("monitor_id").unsigned().notNullable()
.references("id").inTable("monitor")
.onDelete("CASCADE")
.onUpdate("CASCADE");
table.integer("timestamp")
.notNullable()
.comment("Unix timestamp rounded down to the nearest hour");
table.float("ping").notNullable().comment("Average ping in milliseconds");
table.float("ping_min").notNullable().defaultTo(0).comment("Minimum ping during this period in milliseconds");
table.float("ping_max").notNullable().defaultTo(0).comment("Maximum ping during this period in milliseconds");
table.smallint("up").notNullable();
table.smallint("down").notNullable();

table.unique([ "monitor_id", "timestamp" ]);
});
};

exports.down = function (knex) {
return knex.schema
.dropTable("stat_hourly");
};
15 changes: 0 additions & 15 deletions docker/docker-compose.yml

This file was deleted.

6 changes: 6 additions & 0 deletions extra/remove-playwright-test-data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const fs = require("fs");

fs.rmSync("./data/playwright-test", {
recursive: true,
force: true,
});
Loading

0 comments on commit 555f09f

Please sign in to comment.