diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b2efe3e09..46e9a8990 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# Project Info
-First of all, thank you everyone who made pull requests for Uptime Kuma, I never thought GitHub Community can be that nice! And also because of this, I also never thought other people actually read my code and edit my code. It is not structed and commented so well, lol. Sorry about that.
+First of all, thank you everyone who made pull requests for Uptime Kuma, I never thought GitHub Community can be that nice! And also because of this, I also never thought other people actually read my code and edit my code. It is not structured and commented so well, lol. Sorry about that.
The project was created with vite.js (vue3). Then I created a sub-directory called "server" for server part. Both frontend and backend share the same package.json.
@@ -27,7 +27,7 @@ The frontend code build into "dist" directory. The server (express.js) exposes t
## Can I create a pull request for Uptime Kuma?
-Generally, if the pull request is working fine and it do not affect any existing logic, workflow and perfomance, I will merge into the master branch once it is tested.
+Generally, if the pull request is working fine and it do not affect any existing logic, workflow and performance, I will merge into the master branch once it is tested.
If you are not sure whether I will accept your pull request, feel free to create an empty pull request draft first.
@@ -66,13 +66,13 @@ I do not have such knowledge to test it.
#### ⚠ Low Priority - Harsh Mode
-Some pull requests are required to modifiy the core. To be honest, I do not want anyone to try to do that, because it would spend a lot of your time. I will review your pull request harshly. Also you may need to write a lot of unit tests to ensure that there is no breaking change.
+Some pull requests are required to modify the core. To be honest, I do not want anyone to try to do that, because it would spend a lot of your time. I will review your pull request harshly. Also you may need to write a lot of unit tests to ensure that there is no breaking change.
- Touch large parts of code of any very important features
- Touch monitoring logic
- Drop a table or drop a column for any reason
- Touch the entry point of Docker or Node.js
-- Modifiy auth
+- Modify auth
#### *️⃣ Low Priority
@@ -114,7 +114,7 @@ I personally do not like something need to learn so much and need to config so m
- Node.js >= 14
- Git
-- IDE that supports ESLint and EditorConfig (I am using Intellji Idea)
+- IDE that supports ESLint and EditorConfig (I am using IntelliJ IDEA)
- A SQLite tool (SQLite Expert Personal is suggested)
## Install dependencies
@@ -141,7 +141,7 @@ express.js is just used for serving the frontend built files (index.html, .js an
- model/ (Object model, auto mapping to the database table name)
- modules/ (Modified 3rd-party modules)
-- notification-providers/ (indivdual notification logic)
+- notification-providers/ (individual notification logic)
- routers/ (Express Routers)
- scoket-handler (Socket.io Handlers)
- server.js (Server main logic)
diff --git a/config/jest-debug-env.js b/config/jest-debug-env.js
new file mode 100644
index 000000000..74f6d7835
--- /dev/null
+++ b/config/jest-debug-env.js
@@ -0,0 +1,33 @@
+const PuppeteerEnvironment = require("jest-environment-puppeteer");
+const util = require("util");
+
+class DebugEnv extends PuppeteerEnvironment {
+ async handleTestEvent(event, state) {
+ const ignoredEvents = [
+ "setup",
+ "add_hook",
+ "start_describe_definition",
+ "add_test",
+ "finish_describe_definition",
+ "run_start",
+ "run_describe_start",
+ "test_start",
+ "hook_start",
+ "hook_success",
+ "test_fn_start",
+ "test_fn_success",
+ "test_done",
+ "run_describe_finish",
+ "run_finish",
+ "teardown",
+ "test_fn_failure",
+ ];
+ if (!ignoredEvents.includes(event.name)) {
+ console.log(
+ new Date().toString() + ` Unhandled event [${event.name}] ` + util.inspect(event)
+ );
+ }
+ }
+}
+
+module.exports = DebugEnv;
diff --git a/config/jest-puppeteer.config.js b/config/jest-puppeteer.config.js
index 07830ca3c..dc4f7b344 100644
--- a/config/jest-puppeteer.config.js
+++ b/config/jest-puppeteer.config.js
@@ -1,6 +1,20 @@
module.exports = {
"launch": {
+ "dumpio": true,
+ "slowMo": 500,
"headless": process.env.HEADLESS_TEST || false,
"userDataDir": "./data/test-chrome-profile",
+ args: [
+ "--disable-setuid-sandbox",
+ "--disable-gpu",
+ "--disable-dev-shm-usage",
+ "--no-default-browser-check",
+ "--no-experiments",
+ "--no-first-run",
+ "--no-pings",
+ "--no-sandbox",
+ "--no-zygote",
+ "--single-process",
+ ],
}
};
diff --git a/config/jest.config.js b/config/jest.config.js
index 4baaa0fb6..2d3f585ef 100644
--- a/config/jest.config.js
+++ b/config/jest.config.js
@@ -5,6 +5,7 @@ module.exports = {
"__DEV__": true
},
"testRegex": "./test/e2e.spec.js",
+ "testEnvironment": "./config/jest-debug-env.js",
"rootDir": "..",
"testTimeout": 30000,
};
diff --git a/package.json b/package.json
index 79f01b558..f516f4f6b 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
"build": "vite build --config ./config/vite.config.js",
"test": "node test/prepare-test-server.js && node server/server.js --port=3002 --data-dir=./data/test/ --test",
"test-with-build": "npm run build && npm test",
- "jest": "node test/prepare-jest.js && npm run jest-frontend && npm run jest-backend && jest --config=./config/jest.config.js",
+ "jest": "node test/prepare-jest.js && npm run jest-frontend && npm run jest-backend && jest --runInBand --config=./config/jest.config.js",
"jest-frontend": "cross-env TEST_FRONTEND=1 jest --config=./config/jest-frontend.config.js",
"jest-backend": "cross-env TEST_BACKEND=1 jest --config=./config/jest-backend.config.js",
"tsc": "tsc",
diff --git a/server/database.js b/server/database.js
index 41d91e858..fbef40bb1 100644
--- a/server/database.js
+++ b/server/database.js
@@ -79,7 +79,7 @@ class Database {
console.log(`Data Dir: ${Database.dataDir}`);
}
- static async connect() {
+ static async connect(testMode = false) {
const acquireConnectionTimeout = 120 * 1000;
const Dialect = require("knex/lib/dialects/sqlite3/index.js");
@@ -112,8 +112,13 @@ class Database {
await R.autoloadModels("./server/model");
await R.exec("PRAGMA foreign_keys = ON");
- // Change to WAL
- await R.exec("PRAGMA journal_mode = WAL");
+ if (testMode) {
+ // Change to MEMORY
+ await R.exec("PRAGMA journal_mode = MEMORY");
+ } else {
+ // Change to WAL
+ await R.exec("PRAGMA journal_mode = WAL");
+ }
await R.exec("PRAGMA cache_size = -12000");
await R.exec("PRAGMA auto_vacuum = FULL");
diff --git a/server/server.js b/server/server.js
index 78106515a..07249fb44 100644
--- a/server/server.js
+++ b/server/server.js
@@ -177,7 +177,7 @@ exports.entryPage = "dashboard";
(async () => {
Database.init(args);
- await initDatabase();
+ await initDatabase(testMode);
exports.entryPage = await setting("entryPage");
@@ -539,8 +539,8 @@ exports.entryPage = "dashboard";
await updateMonitorNotification(bean.id, notificationIDList);
- await startMonitor(socket.userID, bean.id);
await sendMonitorList(socket);
+ await startMonitor(socket.userID, bean.id);
callback({
ok: true,
@@ -1415,14 +1415,14 @@ async function getMonitorJSONList(userID) {
return result;
}
-async function initDatabase() {
+async function initDatabase(testMode = false) {
if (! fs.existsSync(Database.path)) {
console.log("Copying Database");
fs.copyFileSync(Database.templatePath, Database.path);
}
console.log("Connecting to the Database");
- await Database.connect();
+ await Database.connect(testMode);
console.log("Connected");
// Patch the database
diff --git a/src/assets/vars.scss b/src/assets/vars.scss
index 2f4369832..91ab917e5 100644
--- a/src/assets/vars.scss
+++ b/src/assets/vars.scss
@@ -12,6 +12,7 @@ $dark-font-color2: #020b05;
$dark-bg: #0d1117;
$dark-bg2: #070a10;
$dark-border-color: #1d2634;
+$dark-header-bg: #161b22;
$easing-in: cubic-bezier(0.54, 0.78, 0.55, 0.97);
$easing-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
diff --git a/src/components/MonitorList.vue b/src/components/MonitorList.vue
index bd771f8f0..ef51e89cd 100644
--- a/src/components/MonitorList.vue
+++ b/src/components/MonitorList.vue
@@ -137,7 +137,7 @@ export default {
justify-content: space-between;
.dark & {
- background-color: #161b22;
+ background-color: $dark-header-bg;
border-bottom: 0;
}
}
diff --git a/src/components/settings/About.vue b/src/components/settings/About.vue
new file mode 100644
index 000000000..baa72f39a
--- /dev/null
+++ b/src/components/settings/About.vue
@@ -0,0 +1,25 @@
+
+
+ {{ $t("backupDescription") }}
+ {{ $t("backupDescription3") }}
+
+ {{ $t("Not available, please setup.") }}
+
+ {{ $t("notificationDescription") }}
+
+ {{ $t("Current User") }}: {{ username }}
+
+ Seguro que deseas deshabilitar la autenticación? Es para quien implementa autenticación de terceros ante Uptime Kuma como por ejemplo Cloudflare Access. Por favor usar con cuidado. Você tem certeza que deseja desativar a autenticação? Isso é para alguém que tem autenticação de terceiros na frente do 'UpTime Kuma' como o Cloudflare Access. Por favor, utilize isso com cautela. 你是否確認取消登入認証? 這個功能是設計給已有第三方認証的用家,例如 Cloudflare Access。 請小心使用。 是否确定 取消登录验证? 这是为 有第三方认证 的用户提供的功能,如 Cloudflare Access 请谨慎使用! 你是否要取消登入驗證? 此功能是設計給已有第三方認證的使用者,例如 Cloudflare Access。 請謹慎使用。 Bist du sicher das du die Authentifizierung deaktivieren möchtest? Es ist für jemanden der eine externe Authentifizierung vor Uptime Kuma geschaltet hat, wie z.B. Cloudflare Access. Bitte mit Vorsicht nutzen. Да ли сте сигурни да желите да искључите аутентификацију? То је за оне који имају додату аутентификацију испред Uptime Kuma као на пример Cloudflare Access. Молим Вас користите ово са пажњом. Da li ste sigurni da želite da isključite autentifikaciju? To je za one koji imaju dodatu autentifikaciju ispred Uptime Kuma kao na primer Cloudflare Access. Molim Vas koristite ovo sa pažnjom. Jeste li sigurni da želite isključiti autentikaciju? To je za korisnike koji imaju vanjsku autentikaciju stranice ispred Uptime Kume, poput usluge Cloudflare Access. Pažljivo koristite ovu opciju. Şifreli girişi devre dışı bırakmak istediğinizdenemin misiniz? Bu, Uptime Kuma'nın önünde Cloudflare Access gibi üçüncü taraf yetkilendirmesi olan kişiler içindir. Lütfen dikkatli kullanın. 정말로 인증 기능을 끌까요? 이 기능은 Cloudflare Access와 같은 서드파티 인증을 Uptime Kuma 앞에 둔 사용자를 위한 기능이에요. 신중하게 사용하세요. Czy na pewno chcesz wyłączyć autoryzację? Jest przeznaczony dla kogoś, kto ma autoryzację zewnętrzną przed Uptime Kuma, taką jak Cloudflare Access. Proszę używać ostrożnie. Kas soovid lülitada autentimise välja? Kastuamiseks välise autentimispakkujaga, näiteks Cloudflare Access. Palun kasuta vastutustundlikult. Si è certi di voler disabilitare l'autenticazione? È per chi ha l'autenticazione gestita da terze parti messa davanti ad Uptime Kuma, ad esempio Cloudflare Access. Utilizzare con attenzione. Apakah Anda yakin ingin menonaktifkan autentikasi? Ini untuk mereka yang memiliki autentikasi pihak ketiga diletakkan di depan Uptime Kuma, misalnya akses Cloudflare. Gunakan dengan hati-hati. Вы уверены, что хотите отключить авторизацию? Это подходит для тех, у кого стоит другая авторизация перед открытием Uptime Kuma, например Cloudflare Access. Пожалуйста, используйте с осторожностью. آیا مطمئن هستید که میخواهید احراز هویت را غیر فعال کنید? این ویژگی برای کسانی است که لایه امنیتی شخص ثالث دیگر بر روی این آدرس فعال کردهاند، مانند Cloudflare Access. لطفا از این امکان با دقت استفاده کنید. Сигурни ли сте, че желаете да изключите удостоверяването? Използва се в случаите, когато има настроен алтернативен метод за удостоверяване преди Uptime Kuma, например Cloudflare Access. Моля, използвайте с повишено внимание. Biztos benne, hogy kikapcsolja a hitelesítést? Akkor érdemes, ha van 3rd-party hitelesítés az Uptime Kuma-t megelőzően mint a Cloudflare Access. Használja megfontoltan! Er du sikker på at du vil deaktiver autentisering? Dette er for de som har tredjepartsautorisering foran Uptime Kuma, for eksempel Cloudflare Access. Vennligst vær forsiktig. Are you sure want to disable auth? It is for someone who have 3rd-party auth in front of Uptime Kuma such as Cloudflare Access. Please use it carefully.{{ $t("Export Backup") }}
+
+
+ ({{ $t("backupDescription2") }})
+ {{ $t("Import Backup") }}
+
+
+
+
+
+
+
+
+ {{ $t("Edit") }}
+ {{ $t("Change Password") }}
+
+
+
+
+ {{ $t("Two Factor Authentication") }}
+
+ {{ $t("Advanced") }}
+
+
- {{ $t("Not available, please setup.") }} -
-- {{ $t("notificationDescription") }} -
- -Seguro que deseas deshabilitar la autenticación?
-Es para quien implementa autenticación de terceros ante Uptime Kuma como por ejemplo Cloudflare Access.
-Por favor usar con cuidado.
- - - -Você tem certeza que deseja desativar a autenticação?
-Isso é para alguém que tem autenticação de terceiros na frente do 'UpTime Kuma' como o Cloudflare Access.
-Por favor, utilize isso com cautela.
- - - -你是否確認取消登入認証?
-這個功能是設計給已有第三方認証的用家,例如 Cloudflare Access。
-請小心使用。
- - - -是否确定 取消登录验证?
-这是为 有第三方认证 的用户提供的功能,如 Cloudflare Access
-请谨慎使用!
- - - -你是否要取消登入驗證?
-此功能是設計給已有第三方認證的使用者,例如 Cloudflare Access。
-請謹慎使用。
- - - -Bist du sicher das du die Authentifizierung deaktivieren möchtest?
-Es ist für jemanden der eine externe Authentifizierung vor Uptime Kuma geschaltet hat, wie z.B. Cloudflare Access.
-Bitte mit Vorsicht nutzen.
- - - -Да ли сте сигурни да желите да искључите аутентификацију?
-То је за оне који имају додату аутентификацију испред Uptime Kuma као на пример Cloudflare Access.
-Молим Вас користите ово са пажњом.
- - - -Da li ste sigurni da želite da isključite autentifikaciju?
-To je za one koji imaju dodatu autentifikaciju ispred Uptime Kuma kao na primer Cloudflare Access.
-Molim Vas koristite ovo sa pažnjom.
- - - -Jeste li sigurni da želite isključiti autentikaciju?
-To je za korisnike koji imaju vanjsku autentikaciju stranice ispred Uptime Kume, poput usluge Cloudflare Access.
-Pažljivo koristite ovu opciju.
- - - -Şifreli girişi devre dışı bırakmak istediğinizdenemin misiniz?
-Bu, Uptime Kuma'nın önünde Cloudflare Access gibi üçüncü taraf yetkilendirmesi olan kişiler içindir.
-Lütfen dikkatli kullanın.
- - - -정말로 인증 기능을 끌까요?
-이 기능은 Cloudflare Access와 같은 서드파티 인증을 Uptime Kuma 앞에 둔 사용자를 위한 기능이에요.
-신중하게 사용하세요.
- - - -Czy na pewno chcesz wyłączyć autoryzację?
-Jest przeznaczony dla kogoś, kto ma autoryzację zewnętrzną przed Uptime Kuma, taką jak Cloudflare Access.
-Proszę używać ostrożnie.
- - - -Kas soovid lülitada autentimise välja?
-Kastuamiseks välise autentimispakkujaga, näiteks Cloudflare Access.
-Palun kasuta vastutustundlikult.
- - - -Si è certi di voler disabilitare l'autenticazione?
-È per chi ha l'autenticazione gestita da terze parti messa davanti ad Uptime Kuma, ad esempio Cloudflare Access.
-Utilizzare con attenzione.
- - - -Apakah Anda yakin ingin menonaktifkan autentikasi?
-Ini untuk mereka yang memiliki autentikasi pihak ketiga diletakkan di depan Uptime Kuma, misalnya akses Cloudflare.
-Gunakan dengan hati-hati.
- - - -Вы уверены, что хотите отключить авторизацию?
-Это подходит для тех, у кого стоит другая авторизация перед открытием Uptime Kuma, например Cloudflare Access.
-Пожалуйста, используйте с осторожностью.
- - - -آیا مطمئن هستید که میخواهید احراز هویت را غیر فعال کنید?
-این ویژگی برای کسانی است که لایه امنیتی شخص ثالث دیگر بر روی این آدرس فعال کردهاند، مانند Cloudflare Access.
-لطفا از این امکان با دقت استفاده کنید.
- - - -Сигурни ли сте, че желаете да изключите удостоверяването?
-Използва се в случаите, когато има настроен алтернативен метод за удостоверяване преди Uptime Kuma, например Cloudflare Access.
-Моля, използвайте с повишено внимание.
- - - -Biztos benne, hogy kikapcsolja a hitelesítést?
-Akkor érdemes, ha van 3rd-party hitelesítés az Uptime Kuma-t megelőzően mint a Cloudflare Access.
-Használja megfontoltan!
- - - -Er du sikker på at du vil deaktiver autentisering?
-Dette er for de som har tredjepartsautorisering foran Uptime Kuma, for eksempel Cloudflare Access.
-Vennligst vær forsiktig.
- - - - -Are you sure want to disable auth?
-It is for someone who have 3rd-party auth in front of Uptime Kuma such as Cloudflare Access.
-Please use it carefully.
- -