Use dotenv
This commit is contained in:
@@ -3,12 +3,12 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
image: pinlin/wakeup3770:latest
|
image: pinlin/wakeup3770:latest
|
||||||
environment:
|
environment:
|
||||||
- PORT=8701
|
- PORT=3000
|
||||||
- MAC_ADDRESS=12:34:56:78:90:AB
|
- MAC_ADDRESS=12:34:56:78:90:AB
|
||||||
- OIDC_WELL_KNOWN_URL=https://shubana.synology.me:15001/webman/sso/.well-known/openid-configuration
|
- OIDC_WELL_KNOWN_URL=
|
||||||
- CLIENT_ID=XXXX
|
- CLIENT_ID=
|
||||||
- CLIENT_SECRET=XXXX
|
- CLIENT_SECRET=
|
||||||
- REDIRECT_URI=http://127.0.0.1:3000/callback
|
- REDIRECT_URI=http://127.0.0.1:3000/callback
|
||||||
- COOKIE_SECRET=XXXX
|
- COOKIE_SECRET=
|
||||||
network_mode: host
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
7
example.env
Normal file
7
example.env
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
PORT=3000
|
||||||
|
MAC_ADDRESS=12:34:56:78:90:AB
|
||||||
|
OIDC_WELL_KNOWN_URL=
|
||||||
|
CLIENT_ID=
|
||||||
|
CLIENT_SECRET=
|
||||||
|
REDIRECT_URI=http://127.0.0.1:3000/callback
|
||||||
|
COOKIE_SECRET=
|
||||||
2
index.js
2
index.js
@@ -3,6 +3,8 @@ const session = require("express-session");
|
|||||||
const { Issuer } = require("openid-client");
|
const { Issuer } = require("openid-client");
|
||||||
const wol = require("wake_on_lan");
|
const wol = require("wake_on_lan");
|
||||||
|
|
||||||
|
require('dotenv').config();
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const PORT = process.env.PORT || 3000;
|
const PORT = process.env.PORT || 3000;
|
||||||
|
|
||||||
|
|||||||
13
package-lock.json
generated
13
package-lock.json
generated
@@ -8,6 +8,7 @@
|
|||||||
"name": "wakeup3770",
|
"name": "wakeup3770",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"dotenv": "^17.2.3",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-session": "^1.18.1",
|
"express-session": "^1.18.1",
|
||||||
"openid-client": "^5.6.0",
|
"openid-client": "^5.6.0",
|
||||||
@@ -146,6 +147,18 @@
|
|||||||
"npm": "1.2.8000 || >= 1.4.16"
|
"npm": "1.2.8000 || >= 1.4.16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "17.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz",
|
||||||
|
"integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://dotenvx.com"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/dunder-proto": {
|
"node_modules/dunder-proto": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"start": "node index.js"
|
"start": "node index.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"dotenv": "^17.2.3",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-session": "^1.18.1",
|
"express-session": "^1.18.1",
|
||||||
"openid-client": "^5.6.0",
|
"openid-client": "^5.6.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user