Merge branch '1.23.X'

# Conflicts:
#	package-lock.json
pull/3636/head^2
Louis Lam 1 year ago
commit 59119b9e71

@ -34,8 +34,9 @@ tsconfig.json
/ecosystem.config.js /ecosystem.config.js
/extra/healthcheck.exe /extra/healthcheck.exe
/extra/healthcheck /extra/healthcheck
extra/exe-builder /extra/exe-builder
/extra/push-examples
/extra/uptime-kuma-push
### .gitignore content (commented rules are duplicated) ### .gitignore content (commented rules are duplicated)

@ -1,6 +1,6 @@
{ {
"name": "uptime-kuma", "name": "uptime-kuma",
"version": "1.23.1", "version": "1.23.2",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
@ -42,7 +42,7 @@
"build-docker-nightly-local": "npm run build && docker build -f docker/dockerfile -t louislam/uptime-kuma:nightly2 --target nightly .", "build-docker-nightly-local": "npm run build && docker build -f docker/dockerfile -t louislam/uptime-kuma:nightly2 --target nightly .",
"build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push", "build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push",
"upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain", "upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain",
"setup": "git checkout 1.23.1 && npm ci --production && npm run download-dist", "setup": "git checkout 1.23.2 && npm ci --production && npm run download-dist",
"download-dist": "node extra/download-dist.js", "download-dist": "node extra/download-dist.js",
"mark-as-nightly": "node extra/mark-as-nightly.js", "mark-as-nightly": "node extra/mark-as-nightly.js",
"reset-password": "node extra/reset-password.js", "reset-password": "node extra/reset-password.js",
@ -57,6 +57,7 @@
"test-install-script-ubuntu1604": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu1604.dockerfile .", "test-install-script-ubuntu1604": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu1604.dockerfile .",
"simple-dns-server": "node extra/simple-dns-server.js", "simple-dns-server": "node extra/simple-dns-server.js",
"simple-mqtt-server": "node extra/simple-mqtt-server.js", "simple-mqtt-server": "node extra/simple-mqtt-server.js",
"simple-mongo": "docker run --rm -p 27017:27017 mongo",
"update-language-files": "cd extra/update-language-files && node index.js && cross-env-shell eslint ../../src/languages/$npm_config_language.js --fix", "update-language-files": "cd extra/update-language-files && node index.js && cross-env-shell eslint ../../src/languages/$npm_config_language.js --fix",
"release-final": "node ./extra/test-docker.js && node extra/update-version.js && npm run build-docker && node ./extra/press-any-key.js && npm run upload-artifacts && node ./extra/update-wiki-version.js", "release-final": "node ./extra/test-docker.js && node extra/update-version.js && npm run build-docker && node ./extra/press-any-key.js && npm run upload-artifacts && node ./extra/update-wiki-version.js",
"release-beta": "node ./extra/test-docker.js && node extra/beta/update-version.js && npm run build && node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:$VERSION -t louislam/uptime-kuma:beta . --target release --push && node ./extra/press-any-key.js && npm run upload-artifacts", "release-beta": "node ./extra/test-docker.js && node extra/beta/update-version.js && npm run build && node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:$VERSION -t louislam/uptime-kuma:beta . --target release --push && node ./extra/press-any-key.js && npm run upload-artifacts",
@ -111,7 +112,7 @@
"knex": "^2.4.2", "knex": "^2.4.2",
"limiter": "~2.1.0", "limiter": "~2.1.0",
"liquidjs": "^10.7.0", "liquidjs": "^10.7.0",
"mongodb": "~4.14.0", "mongodb": "~4.17.1",
"mqtt": "~4.3.7", "mqtt": "~4.3.7",
"mssql": "~8.1.4", "mssql": "~8.1.4",
"mysql2": "~2.3.3", "mysql2": "~2.3.3",
@ -163,7 +164,7 @@
"core-js": "~3.26.1", "core-js": "~3.26.1",
"cronstrue": "~2.24.0", "cronstrue": "~2.24.0",
"cross-env": "~7.0.3", "cross-env": "~7.0.3",
"cypress": "^12.17.0", "cypress": "^13.2.0",
"delay": "^5.0.0", "delay": "^5.0.0",
"dns2": "~2.0.1", "dns2": "~2.0.1",
"dompurify": "~2.4.3", "dompurify": "~2.4.3",

@ -56,7 +56,7 @@ class Monitor extends BeanModel {
obj.tags = await this.getTags(); obj.tags = await this.getTags();
} }
if (certExpiry && this.type === "http") { if (certExpiry && this.type === "http" && this.getURLProtocol() === "https:") {
const { certExpiryDaysRemaining, validCert } = await this.getCertExpiry(this.id); const { certExpiryDaysRemaining, validCert } = await this.getCertExpiry(this.id);
obj.certExpiryDaysRemaining = certExpiryDaysRemaining; obj.certExpiryDaysRemaining = certExpiryDaysRemaining;
obj.validCert = validCert; obj.validCert = validCert;
@ -1057,6 +1057,19 @@ class Monitor extends BeanModel {
} }
} }
/**
* Example: http: or https:
* @returns {(null|string)}
*/
getURLProtocol() {
const url = this.getUrl();
if (url) {
return this.getUrl().protocol;
} else {
return null;
}
}
/** /**
* Store TLS info to database * Store TLS info to database
* @param {object} checkCertificateResult Certificate to update * @param {object} checkCertificateResult Certificate to update

@ -761,11 +761,11 @@ let needSetup = false;
bean.basic_auth_user = monitor.basic_auth_user; bean.basic_auth_user = monitor.basic_auth_user;
bean.basic_auth_pass = monitor.basic_auth_pass; bean.basic_auth_pass = monitor.basic_auth_pass;
bean.timeout = monitor.timeout; bean.timeout = monitor.timeout;
bean.oauth_client_id = monitor.oauth_client_id, bean.oauth_client_id = monitor.oauth_client_id;
bean.oauth_client_secret = monitor.oauth_client_secret, bean.oauth_client_secret = monitor.oauth_client_secret;
bean.oauth_auth_method = this.oauth_auth_method, bean.oauth_auth_method = monitor.oauth_auth_method;
bean.oauth_token_url = monitor.oauth_token_url, bean.oauth_token_url = monitor.oauth_token_url;
bean.oauth_scopes = monitor.oauth_scopes, bean.oauth_scopes = monitor.oauth_scopes;
bean.tlsCa = monitor.tlsCa; bean.tlsCa = monitor.tlsCa;
bean.tlsCert = monitor.tlsCert; bean.tlsCert = monitor.tlsCert;
bean.tlsKey = monitor.tlsKey; bean.tlsKey = monitor.tlsKey;
@ -836,7 +836,7 @@ let needSetup = false;
await updateMonitorNotification(bean.id, monitor.notificationIDList); await updateMonitorNotification(bean.id, monitor.notificationIDList);
if (bean.isActive()) { if (await bean.isActive()) {
await restartMonitor(socket.userID, bean.id); await restartMonitor(socket.userID, bean.id);
} }

@ -11,7 +11,7 @@
/> />
</div> </div>
<div <div
v-if="size !== 'small' && beatList.length > 4 && $root.styleElapsedTime !== 'none'" v-if="!$root.isMobile && size !== 'small' && beatList.length > 4 && $root.styleElapsedTime !== 'none'"
class="d-flex justify-content-between align-items-center word" :style="timeStyle" class="d-flex justify-content-between align-items-center word" :style="timeStyle"
> >
<div>{{ timeSinceFirstBeat }} ago</div> <div>{{ timeSinceFirstBeat }} ago</div>

@ -62,7 +62,7 @@
</span> </span>
</div> </div>
<div class="extra-info"> <div class="extra-info">
<div v-if="showCertificateExpiry && monitor.element.type === 'http'"> <div v-if="showCertificateExpiry && monitor.element.certExpiryDaysRemaining">
<Tag :item="{name: $t('Cert Exp.'), value: formattedCertExpiryMessage(monitor), color: certExpiryColor(monitor)}" :size="'sm'" /> <Tag :item="{name: $t('Cert Exp.'), value: formattedCertExpiryMessage(monitor), color: certExpiryColor(monitor)}" :size="'sm'" />
</div> </div>
<div v-if="showTags"> <div v-if="showTags">

@ -82,7 +82,7 @@
<option value="redis"> <option value="redis">
Redis Redis
</option> </option>
<option v-if="$root.info.isContainer" value="tailscale-ping"> <option v-if="!$root.info.isContainer" value="tailscale-ping">
Tailscale Ping Tailscale Ping
</option> </option>
</optgroup> </optgroup>
@ -401,7 +401,7 @@
</div> </div>
<!-- Timeout: HTTP / Keyword only --> <!-- Timeout: HTTP / Keyword only -->
<div v-if="monitor.type === 'http' || monitor.type === 'keyword'" class="my-3"> <div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query'" class="my-3">
<label for="timeout" class="form-label">{{ $t("Request Timeout") }} ({{ $t("timeoutAfter", [ monitor.timeout || clampTimeout(monitor.interval) ]) }})</label> <label for="timeout" class="form-label">{{ $t("Request Timeout") }} ({{ $t("timeoutAfter", [ monitor.timeout || clampTimeout(monitor.interval) ]) }})</label>
<input id="timeout" v-model="monitor.timeout" type="number" class="form-control" required min="0" step="0.1"> <input id="timeout" v-model="monitor.timeout" type="number" class="form-control" required min="0" step="0.1">
</div> </div>
@ -460,7 +460,7 @@
</div> </div>
<!-- HTTP / Keyword only --> <!-- HTTP / Keyword only -->
<template v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'grpc-keyword' "> <template v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' || monitor.type === 'grpc-keyword' ">
<div class="my-3"> <div class="my-3">
<label for="maxRedirects" class="form-label">{{ $t("Max. Redirects") }}</label> <label for="maxRedirects" class="form-label">{{ $t("Max. Redirects") }}</label>
<input id="maxRedirects" v-model="monitor.maxredirects" type="number" class="form-control" required min="0" step="1"> <input id="maxRedirects" v-model="monitor.maxredirects" type="number" class="form-control" required min="0" step="1">

@ -102,7 +102,7 @@
<!-- Sidebar Footer --> <!-- Sidebar Footer -->
<div class="sidebar-footer"> <div class="sidebar-footer">
<button class="btn btn-success me-2" @click="save"> <button class="btn btn-success me-2" :disabled="loading" @click="save">
<font-awesome-icon icon="save" /> <font-awesome-icon icon="save" />
{{ $t("Save") }} {{ $t("Save") }}
</button> </button>
@ -438,6 +438,7 @@ export default {
lastUpdateTime: dayjs(), lastUpdateTime: dayjs(),
updateCountdown: null, updateCountdown: null,
updateCountdownText: null, updateCountdownText: null,
loading: false,
}; };
}, },
computed: { computed: {
@ -819,6 +820,7 @@ export default {
* @returns {void} * @returns {void}
*/ */
save() { save() {
this.loading = true;
let startTime = new Date(); let startTime = new Date();
this.config.slug = this.config.slug.trim().toLowerCase(); this.config.slug = this.config.slug.trim().toLowerCase();
@ -836,10 +838,12 @@ export default {
} }
setTimeout(() => { setTimeout(() => {
this.loading = false;
location.href = "/status/" + this.config.slug; location.href = "/status/" + this.config.slug;
}, time); }, time);
} else { } else {
this.loading = false;
toast.error(res.msg); toast.error(res.msg);
} }
}); });

Loading…
Cancel
Save