Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 9 additions & 15 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Should be very similar to .npmignore, but the syntax is a bit different

/.idea
/node_modules
/data*
Expand All @@ -12,9 +14,8 @@
**/.gitignore
**/docker-compose*
**/[Dd]ockerfile*
LICENSE
README.md
.editorconfig
.vs
.vscode
.eslint*
.stylelint*
Expand All @@ -32,22 +33,15 @@ tsconfig.json
/tmp
/babel.config.js
/ecosystem.config.js
/extra/healthcheck.exe
/extra/healthcheck
extra/exe-builder
/public


### .gitignore content (commented rules are duplicated)

#node_modules
.DS_Store
#dist
dist-ssr
*.local
#.idea

#/data
#!/data/.gitkeep
#.vscode

### End of .gitignore content
# .dockerignore only, not in .npmignore
/extra/healthcheck.exe
/extra/healthcheck
LICENSE
README.md
45 changes: 45 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Should be very similar to .dockerignore, but the syntax is a bit different

/.idea
/node_modules
/data
/cypress
/out
/test
/kubernetes
/.do
/.dockerignore
/private
/.git
/.gitignore
/docker-compose*
/[Dd]ockerfile*
.editorconfig
.vs
.vscode
.eslint*
.stylelint*
/.devcontainer
/.github
yarn.lock
app.json
CODE_OF_CONDUCT.md
CONTRIBUTING.md
CNAME
install.sh
SECURITY.md
tsconfig.json
.env
/tmp
/babel.config.js
/ecosystem.config.js
extra/exe-builder
/public

.DS_Store
dist-ssr
*.local

## .npmignore only, not in .dockerignore
/docker
/extra/healthcheck*
75 changes: 75 additions & 0 deletions extra/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/usr/bin/env node
const path = require("path");
const args = require("args-parser")(process.argv);

// Set the data directory
if (!process.env.DATA_DIR) {
if (process.platform === "win32") {
process.env.DATA_DIR = process.env.LOCALAPPDATA + "\\uptime-kuma\\";
} else if (process.platform === "linux") {
process.env.DATA_DIR = process.env.HOME + "/.local/share/uptime-kuma/";
} else if (process.platform === "darwin") {
// TODO: Not sure if this is the correct path for macOS
process.env.DATA_DIR = process.env.HOME + "/Library/Preferences/uptime-kuma/";
} else {
console.error("Unable to detect app data directory on platform: " + process.platform);
console.error("Please set the DATA_DIR environment variable or `--data-dir=` to the directory where you want to store your data.");
process.exit(1);
}
}

// Change the working directory to the root of the project, so it can read the dist folder
process.chdir(path.join(__dirname, ".."));

if (args.run) {
require("../server/server");

} else if (args.installService) {

if (process.platform === "win32") {
let Service = require("node-windows").Service;

// Create a new service object
let svc = new Service({
name: "Uptime Kuma",
description: "Uptime Kuma is an easy-to-use self-hosted monitoring tool.",
script: "C:\\path\\to\\helloworld.js",
nodeOptions: [
"--harmony",
"--max_old_space_size=4096"
]
//, workingDirectory: '...'
//, allowServiceLogon: true
});

// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on("install", function () {
svc.start();
});

svc.install();
} else if (process.platform === "linux") {

} else {
console.error("Unable to install service on platform: " + process.platform);
process.exit(1);
}

} else if (args.version || args.v) {
const version = require("../package.json").version;
console.log("Uptime Kuma version: " + version);

} else {
console.log(`Usage: uptime-kuma [options]

Options:
--install-service Install Uptime Kuma service (Windows and Linux only)
--uninstall-service Uninstall Uptime Kuma service
--run Run Uptime Kuma directly in the terminal
--data-dir="your path" Set the data directory
--version Print the version
--help Print this help
`);
}

18 changes: 18 additions & 0 deletions package-lock.json

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

15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "uptime-kuma",
"description": "Uptime Kuma is an easy-to-use self-hosted monitoring tool",
"version": "1.23.0-beta.1",
"license": "MIT",
"repository": {
Expand All @@ -9,7 +10,11 @@
"engines": {
"node": "14 || 16 || 18 || >= 20.4.0"
},
"bin": {
"uptime-kuma": "./extra/cli.js"
},
"scripts": {
"uptime-kuma": "node ./extra/cli.js",
"install-legacy": "npm install",
"update-legacy": "npm update",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
Expand Down Expand Up @@ -55,8 +60,8 @@
"simple-dns-server": "node extra/simple-dns-server.js",
"simple-mqtt-server": "node extra/simple-mqtt-server.js",
"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-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-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 && npm run publish-to-npm",
"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 && npm run publish-to-npm-beta",
"git-remove-tag": "git tag -d",
"build-dist-and-restart": "npm run build && npm run start-server-dev",
"start-pr-test": "node extra/checkout-pr.js && npm install && npm run dev",
Expand All @@ -68,7 +73,10 @@
"deploy-demo-server": "node extra/deploy-demo-server.js",
"sort-contributors": "node extra/sort-contributors.js",
"quick-run-nightly": "docker run --rm --env NODE_ENV=development -p 3001:3001 louislam/uptime-kuma:nightly2",
"start-dev-container": "cd docker && docker-compose -f docker-compose-dev.yml up --force-recreate"
"start-dev-container": "cd docker && docker-compose -f docker-compose-dev.yml up --force-recreate",
"publish-to-npm-dev": "npm run build && npm publish --tag dev",
"publish-to-npm-beta": "npm publish --tag beta",
"publish-to-npm": "npm publish"
},
"dependencies": {
"@grpc/grpc-js": "~1.7.3",
Expand Down Expand Up @@ -115,6 +123,7 @@
"nanoid": "~3.3.4",
"node-cloudflared-tunnel": "~1.0.9",
"node-radius-client": "~1.0.0",
"node-windows": "^1.0.0-beta.8",
"nodemailer": "~6.6.5",
"nostr-tools": "^1.13.1",
"notp": "~2.0.3",
Expand Down