Add password in .env
This commit is contained in:
parent
5d66eb473a
commit
3a893d202e
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
*.pem
|
||||
docker-compose.yaml
|
||||
.env
|
||||
|
3
index.js
3
index.js
@ -1,5 +1,6 @@
|
||||
const fs = require("fs");
|
||||
const https = require("https");
|
||||
const dotenv = require('dotenv').config();
|
||||
const express = require("express");
|
||||
const socketio = require("socket.io");
|
||||
const sanitizeHtml = require("sanitize-html");
|
||||
@ -99,7 +100,7 @@ io.on("connection", (client) => {
|
||||
|
||||
app.use(express.static("src"));
|
||||
|
||||
app.get("/clear", basicAuth({users:{"quentin": "BlanquerCaca89"}, challenge: true}), (req, res) => {
|
||||
app.get("/clear", basicAuth({users:{"quentin": process.env.ADMIN_PASSWORD}, challenge: true}), (req, res) => {
|
||||
messagesHistory = [];
|
||||
res.send("message history was cleared");
|
||||
io.sockets.emit("refresh");
|
||||
|
@ -4,6 +4,7 @@
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dotenv": "^16.0.0",
|
||||
"express": "^4.17.3",
|
||||
"express-basic-auth": "^1.2.1",
|
||||
"sanitize-html": "^2.7.0",
|
||||
|
@ -206,6 +206,11 @@ domutils@^2.5.2:
|
||||
domelementtype "^2.2.0"
|
||||
domhandler "^4.2.0"
|
||||
|
||||
dotenv@^16.0.0:
|
||||
version "16.0.0"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.0.tgz#c619001253be89ebb638d027b609c75c26e47411"
|
||||
integrity sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==
|
||||
|
||||
ee-first@1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
|
||||
|
Loading…
Reference in New Issue
Block a user