Compare commits
2 Commits
master
...
windows-co
Author | SHA1 | Date | |
---|---|---|---|
|
bf49a548c7 | ||
|
e0028cb114 |
22
docker/dockerfile-windows
Normal file
22
docker/dockerfile-windows
Normal file
@ -0,0 +1,22 @@
|
||||
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
|
||||
WORKDIR C:\\app
|
||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
|
||||
|
||||
# Download Node.js 18
|
||||
RUN curl.exe -o node.zip https://nodejs.org/dist/v18.2.0/node-v18.2.0-win-x64.zip && \
|
||||
mkdir "C:\\Program Files\\node" && \
|
||||
tar.exe -xf node.zip -C "C:\\Program Files\\node" --strip-components=1
|
||||
|
||||
# Add node to PATH
|
||||
RUN setx path "%path%;C:\\Program Files\\node"
|
||||
|
||||
# Test Node & NPM
|
||||
RUN node -v && \
|
||||
npm -v
|
||||
|
||||
COPY . .
|
||||
RUN npm ci --production
|
||||
|
||||
EXPOSE 3001
|
||||
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD node extra/healthcheck.js
|
||||
CMD ["node.exe", "server/server.js"]
|
@ -38,6 +38,7 @@
|
||||
"build-docker-nightly": "npm run build && docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly --target nightly . --push",
|
||||
"build-docker-nightly-alpine": "docker buildx build -f docker/dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly-alpine --target nightly . --push",
|
||||
"build-docker-nightly-amd64": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:nightly-amd64 --target nightly . --push --progress plain",
|
||||
"build-docker-nightly-windows": "docker build -f docker/dockerfile-windows -t louislam/uptime-kuma:nightly-windows . && docker push louislam/uptime-kuma:nightly-windows",
|
||||
"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.15.1 && npm ci --production && npm run download-dist",
|
||||
"download-dist": "node extra/download-dist.js",
|
||||
|
@ -6,7 +6,7 @@ dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
const axios = require("axios");
|
||||
const { Prometheus } = require("../prometheus");
|
||||
const { log, UP, DOWN, PENDING, flipStatus, TimeLogger } = require("../../src/util");
|
||||
const { log, UP, DOWN, PENDING, flipStatus, TimeLogger, MAX_INTERVAL } = require("../../src/util");
|
||||
const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mqttAsync } = require("../util-server");
|
||||
const { R } = require("redbean-node");
|
||||
const { BeanModel } = require("redbean-node/dist/bean-model");
|
||||
@ -167,7 +167,7 @@ class Monitor extends BeanModel {
|
||||
|
||||
let beatInterval = this.interval;
|
||||
|
||||
if (! beatInterval) {
|
||||
if (! beatInterval || beatInterval < 1) {
|
||||
beatInterval = 1;
|
||||
}
|
||||
|
||||
@ -178,6 +178,13 @@ class Monitor extends BeanModel {
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent an issue like https://github.com/louislam/uptime-kuma/issues/897
|
||||
// Because setTimeout accept <= 2,147,483,647 ms only
|
||||
// But beatInterval is in second, so need to divided by 1000
|
||||
if (beatInterval > MAX_INTERVAL) {
|
||||
beatInterval = MAX_INTERVAL;
|
||||
}
|
||||
|
||||
// Expose here for prometheus update
|
||||
// undefined if not https
|
||||
let tlsInfo = undefined;
|
||||
|
@ -151,7 +151,7 @@
|
||||
<!-- Interval -->
|
||||
<div class="my-3">
|
||||
<label for="interval" class="form-label">{{ $t("Heartbeat Interval") }} ({{ $t("checkEverySecond", [ monitor.interval ]) }})</label>
|
||||
<input id="interval" v-model="monitor.interval" type="number" class="form-control" required min="20" step="1">
|
||||
<input id="interval" v-model="monitor.interval" type="number" class="form-control" required min="20" :max="maxInterval" step="1">
|
||||
</div>
|
||||
|
||||
<div class="my-3">
|
||||
@ -367,7 +367,7 @@ import CopyableInput from "../components/CopyableInput.vue";
|
||||
import NotificationDialog from "../components/NotificationDialog.vue";
|
||||
import ProxyDialog from "../components/ProxyDialog.vue";
|
||||
import TagsManager from "../components/TagsManager.vue";
|
||||
import { genSecret, isDev } from "../util.ts";
|
||||
import { genSecret, isDev, MAX_INTERVAL } from "../util.ts";
|
||||
|
||||
const toast = useToast();
|
||||
|
||||
@ -382,6 +382,7 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
maxInterval: MAX_INTERVAL,
|
||||
processing: false,
|
||||
monitor: {
|
||||
notificationIDList: {},
|
||||
|
@ -7,7 +7,7 @@
|
||||
// Backend uses the compiled file util.js
|
||||
// Frontend uses util.ts
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMonitorRelativeURL = exports.genSecret = exports.getCryptoRandomInt = exports.getRandomInt = exports.getRandomArbitrary = exports.TimeLogger = exports.polyfill = exports.log = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.STATUS_PAGE_PARTIAL_DOWN = exports.STATUS_PAGE_ALL_UP = exports.STATUS_PAGE_ALL_DOWN = exports.PENDING = exports.UP = exports.DOWN = exports.appName = exports.isDev = void 0;
|
||||
exports.getMonitorRelativeURL = exports.genSecret = exports.getCryptoRandomInt = exports.getRandomInt = exports.getRandomArbitrary = exports.TimeLogger = exports.polyfill = exports.log = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.MAX_INTERVAL = exports.STATUS_PAGE_PARTIAL_DOWN = exports.STATUS_PAGE_ALL_UP = exports.STATUS_PAGE_ALL_DOWN = exports.PENDING = exports.UP = exports.DOWN = exports.appName = exports.isDev = void 0;
|
||||
const _dayjs = require("dayjs");
|
||||
const dayjs = _dayjs;
|
||||
exports.isDev = process.env.NODE_ENV === "development";
|
||||
@ -18,6 +18,7 @@ exports.PENDING = 2;
|
||||
exports.STATUS_PAGE_ALL_DOWN = 0;
|
||||
exports.STATUS_PAGE_ALL_UP = 1;
|
||||
exports.STATUS_PAGE_PARTIAL_DOWN = 2;
|
||||
exports.MAX_INTERVAL = 2147482;
|
||||
function flipStatus(s) {
|
||||
if (s === exports.UP) {
|
||||
return exports.DOWN;
|
||||
|
@ -19,6 +19,8 @@ export const STATUS_PAGE_ALL_DOWN = 0;
|
||||
export const STATUS_PAGE_ALL_UP = 1;
|
||||
export const STATUS_PAGE_PARTIAL_DOWN = 2;
|
||||
|
||||
export const MAX_INTERVAL = 2147482;
|
||||
|
||||
|
||||
export function flipStatus(s: number) {
|
||||
if (s === UP) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user