-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/request-with-http-proxy
# Conflicts: # package-lock.json # package.json # server/database.js # src/languages/en.js # src/mixins/socket.js
- Loading branch information
Showing
80 changed files
with
2,645 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. | ||
BEGIN TRANSACTION; | ||
|
||
CREATE TABLE [status_page]( | ||
[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
[slug] VARCHAR(255) NOT NULL UNIQUE, | ||
[title] VARCHAR(255) NOT NULL, | ||
[description] TEXT, | ||
[icon] VARCHAR(255) NOT NULL, | ||
[theme] VARCHAR(30) NOT NULL, | ||
[published] BOOLEAN NOT NULL DEFAULT 1, | ||
[search_engine_index] BOOLEAN NOT NULL DEFAULT 1, | ||
[show_tags] BOOLEAN NOT NULL DEFAULT 0, | ||
[password] VARCHAR, | ||
[created_date] DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
[modified_date] DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
CREATE UNIQUE INDEX [slug] ON [status_page]([slug]); | ||
|
||
|
||
CREATE TABLE [status_page_cname]( | ||
[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
[status_page_id] INTEGER NOT NULL REFERENCES [status_page]([id]) ON DELETE CASCADE ON UPDATE CASCADE, | ||
[domain] VARCHAR NOT NULL UNIQUE | ||
); | ||
|
||
ALTER TABLE incident ADD status_page_id INTEGER; | ||
ALTER TABLE [group] ADD status_page_id INTEGER; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
# DON'T UPDATE TO node:14-bullseye-slim, see #372. | ||
# If the image changed, the second stage image should be changed too | ||
FROM node:14-buster-slim | ||
FROM node:16-buster-slim | ||
ARG TARGETPLATFORM | ||
|
||
WORKDIR /app | ||
|
||
# Install Curl | ||
# Install Apprise, add sqlite3 cli for debugging in the future, iputils-ping for ping, util-linux for setpriv | ||
# Stupid python3 and python3-pip actually install a lot of useless things into Debian, specify --no-install-recommends to skip them, make the base even smaller than alpine! | ||
RUN apt update && \ | ||
apt --yes --no-install-recommends install python3 python3-pip python3-cryptography python3-six python3-yaml python3-click python3-markdown python3-requests python3-requests-oauthlib \ | ||
sqlite3 iputils-ping util-linux dumb-init && \ | ||
pip3 --no-cache-dir install apprise==0.9.7 && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install cloudflared | ||
# dpkg --add-architecture arm: cloudflared do not provide armhf, this is workaround. Read more: https://github.com/cloudflare/cloudflared/issues/583 | ||
COPY extra/download-cloudflared.js ./extra/download-cloudflared.js | ||
RUN node ./extra/download-cloudflared.js $TARGETPLATFORM && \ | ||
dpkg --add-architecture arm && \ | ||
apt update && \ | ||
apt --yes --no-install-recommends install ./cloudflared.deb && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
rm -f cloudflared.deb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
const pkg = require("../../package.json"); | ||
const fs = require("fs"); | ||
const child_process = require("child_process"); | ||
const util = require("../../src/util"); | ||
|
||
util.polyfill(); | ||
|
||
const oldVersion = pkg.version; | ||
const version = process.env.VERSION; | ||
|
||
console.log("Beta Version: " + version); | ||
|
||
if (!oldVersion || oldVersion.includes("-beta.")) { | ||
console.error("Error: old version should not be a beta version?"); | ||
process.exit(1); | ||
} | ||
|
||
if (!version || !version.includes("-beta.")) { | ||
console.error("invalid version, beta version only"); | ||
process.exit(1); | ||
} | ||
|
||
const exists = tagExists(version); | ||
|
||
if (! exists) { | ||
// Process package.json | ||
pkg.version = version; | ||
fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n"); | ||
commit(version); | ||
tag(version); | ||
|
||
} else { | ||
console.log("version tag exists, please delete the tag or use another tag"); | ||
process.exit(1); | ||
} | ||
|
||
function commit(version) { | ||
let msg = "Update to " + version; | ||
|
||
let res = child_process.spawnSync("git", ["commit", "-m", msg, "-a"]); | ||
let stdout = res.stdout.toString().trim(); | ||
console.log(stdout); | ||
|
||
if (stdout.includes("no changes added to commit")) { | ||
throw new Error("commit error"); | ||
} | ||
|
||
res = child_process.spawnSync("git", ["push", "origin", "master"]); | ||
console.log(res.stdout.toString().trim()); | ||
} | ||
|
||
function tag(version) { | ||
let res = child_process.spawnSync("git", ["tag", version]); | ||
console.log(res.stdout.toString().trim()); | ||
|
||
res = child_process.spawnSync("git", ["push", "origin", version]); | ||
console.log(res.stdout.toString().trim()); | ||
} | ||
|
||
function tagExists(version) { | ||
if (! version) { | ||
throw new Error("invalid version"); | ||
} | ||
|
||
let res = child_process.spawnSync("git", ["tag", "-l", version]); | ||
|
||
return res.stdout.toString().trim() === version; | ||
} | ||
|
||
function safeDelete(dir) { | ||
if (fs.existsSync(dir)) { | ||
fs.rmdirSync(dir, { | ||
recursive: true, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
|
||
const http = require("https"); // or 'https' for https:// URLs | ||
const fs = require("fs"); | ||
|
||
const platform = process.argv[2]; | ||
|
||
if (!platform) { | ||
console.error("No platform??"); | ||
process.exit(1); | ||
} | ||
|
||
let arch = null; | ||
|
||
if (platform === "linux/amd64") { | ||
arch = "amd64"; | ||
} else if (platform === "linux/arm64") { | ||
arch = "arm64"; | ||
} else if (platform === "linux/arm/v7") { | ||
arch = "arm"; | ||
} else { | ||
console.error("Invalid platform?? " + platform); | ||
} | ||
|
||
const file = fs.createWriteStream("cloudflared.deb"); | ||
get("https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-" + arch + ".deb"); | ||
|
||
function get(url) { | ||
http.get(url, function (res) { | ||
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { | ||
console.log("Redirect to " + res.headers.location); | ||
get(res.headers.location); | ||
} else if (res.statusCode >= 200 && res.statusCode < 300) { | ||
res.pipe(file); | ||
|
||
res.on("end", function () { | ||
console.log("Downloaded"); | ||
}); | ||
} else { | ||
console.error(res.statusCode); | ||
process.exit(1); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env node | ||
|
||
const childProcess = require("child_process"); | ||
let env = process.env; | ||
|
||
let cmd = process.argv[2]; | ||
let args = process.argv.slice(3); | ||
let replacedArgs = []; | ||
|
||
for (let arg of args) { | ||
for (let key in env) { | ||
arg = arg.replaceAll(`$${key}`, env[key]); | ||
} | ||
replacedArgs.push(arg); | ||
} | ||
|
||
let child = childProcess.spawn(cmd, replacedArgs); | ||
child.stdout.pipe(process.stdout); | ||
child.stderr.pipe(process.stderr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
console.log("Git Push and Publish the release note on github, then press any key to continue"); | ||
|
||
process.stdin.setRawMode(true); | ||
process.stdin.resume(); | ||
process.stdin.on("data", process.exit.bind(process, 0)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.