[Init] Functii de Baza
parent
4f74140c1c
commit
ecf487e9f4
@ -1 +1,2 @@
|
||||
node_modules
|
||||
repo
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
stylesheet:
|
||||
npx tailwindcss --input css/source.css --output css/dist.css
|
||||
@ -0,0 +1,57 @@
|
||||
const fs = require('fs');
|
||||
const express = require('express');
|
||||
const crypto = require('crypto');
|
||||
const session = require('express-session');
|
||||
const FileStore = require('session-file-store')(session);
|
||||
|
||||
const http = require('http');
|
||||
|
||||
const app = express();
|
||||
|
||||
if(!fs.existsSync('repo')) fs.mkdirSync('repo');
|
||||
|
||||
if(!fs.existsSync('repo/secret')){
|
||||
secret = crypto.randomBytes(35).toString('hex');
|
||||
fs.writeFileSync('repo/secret', secret);
|
||||
}else{
|
||||
secret = fs.readFileSync('repo/secret');
|
||||
}
|
||||
|
||||
if(fs.existsSync('repo/credentials')){
|
||||
credString = fs.readFileSync('repo/credentials');
|
||||
credentials = JSON.parse(credString);
|
||||
}
|
||||
|
||||
app.use(session({
|
||||
secret: secret.toString(),
|
||||
saveUninitialized:false,
|
||||
resave:false,
|
||||
//cookie: {maxAge: none}
|
||||
store:new FileStore()
|
||||
}));
|
||||
|
||||
var logString;
|
||||
|
||||
function report(str){
|
||||
console.log(str);
|
||||
logString = logString.concat('\n', str);
|
||||
}
|
||||
|
||||
function addUser(username, password){
|
||||
var user = {
|
||||
'username': username,
|
||||
'pass': crypto.createHash('sha256').update(password).digest('hex')
|
||||
};
|
||||
|
||||
credentials.push(user);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
app.get('/', (request, response) => {
|
||||
|
||||
});
|
||||
|
||||
const server = http.createServer(app);
|
||||
server.listen(8881);
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
||||
module.exports = {
|
||||
content: [
|
||||
'./**/*.html',
|
||||
'./index.html',
|
||||
'./*.html'
|
||||
],
|
||||
darkMode: true,
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
'mycol0': '#200f4c',
|
||||
//'mycol': '#8870ff',
|
||||
'mycol': '#8a97ff',
|
||||
'mycol2': '#161524',
|
||||
},
|
||||
animation: {
|
||||
wiggle: 'wiggle 1s ease-in-out infinite',
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue