Compare commits

...

4 Commits

Author SHA1 Message Date
41351442f3 Update docker-compose.yml 2025-10-24 22:42:57 +08:00
c06b212787 Update docker-compose.yml 2025-10-24 22:25:48 +08:00
57a7421e46 Convert templates.jsm to CommonJS 2025-10-21 00:38:52 +08:00
2096aeb06a Audit fix 2025-10-20 05:20:18 +08:00
4 changed files with 25 additions and 22 deletions

View File

@@ -1,15 +1,15 @@
services:
wakeup3770:
web:
build: .
image: pinlin/wakeup3770:latest
environment:
- NODE_ENV=production
- PORT=3000
- COMPUTER_NAME=MyComputer
- MAC_ADDRESS=12:34:56:78:90:AB
- OIDC_WELL_KNOWN_URL=
- CLIENT_ID=
- CLIENT_SECRET=
- COOKIE_SECRET=
NODE_ENV: production
PORT: 3000
COMPUTER_NAME: MyComputer
MAC_ADDRESS: 12:34:56:78:90:AB
OIDC_WELL_KNOWN_URL:
CLIENT_ID:
CLIENT_SECRET:
COOKIE_SECRET:
network_mode: host
restart: always

View File

@@ -1,8 +1,8 @@
const express = require("express");
const session = require("express-session");
const { Issuer } = require("openid-client");
const { createTemplateRenderer } = require("./utils/templates");
const wol = require("wake_on_lan");
const { createTemplateRenderer } = require("./utils/templates.jsm");
require("dotenv").config();
@@ -68,7 +68,6 @@ let client;
state,
});
// 回傳 JSON 給前端,讓前端負責導向
res.json({ redirect: url });
});
@@ -109,6 +108,6 @@ let client;
});
app.listen(PORT, () => {
console.log(`wakeup3770 listening at http://localhost:${PORT}`);
console.log(`listening at http://localhost:${PORT}`);
});
})();

16
package-lock.json generated
View File

@@ -271,15 +271,16 @@
}
},
"node_modules/express-session": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.1.tgz",
"integrity": "sha512-a5mtTqEaZvBCL9A9aqkrtfz+3SMDhOVUnjafjo+s7A9Txkq+SVX2DLvSp1Zrv4uCXa3lMSK3viWnh9Gg07PBUA==",
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.2.tgz",
"integrity": "sha512-SZjssGQC7TzTs9rpPDuUrR23GNZ9+2+IkA/+IJWmvQilTr5OSliEHGF+D9scbIpdC6yGtTI0/VhaHoVes2AN/A==",
"license": "MIT",
"dependencies": {
"cookie": "0.7.2",
"cookie-signature": "1.0.7",
"debug": "2.6.9",
"depd": "~2.0.0",
"on-headers": "~1.0.2",
"on-headers": "~1.1.0",
"parseurl": "~1.3.3",
"safe-buffer": "5.2.1",
"uid-safe": "~2.1.5"
@@ -590,9 +591,10 @@
}
},
"node_modules/on-headers": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
"integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz",
"integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}

View File

@@ -1,7 +1,7 @@
import fs from "fs";
import path from "path";
const fs = require("fs");
const path = require("path");
export function createTemplateRenderer({
function createTemplateRenderer({
baseDir = path.resolve("templates"),
useCache = true,
} = {}) {
@@ -26,3 +26,5 @@ export function createTemplateRenderer({
return html;
};
}
module.exports = { createTemplateRenderer };