[Init] Functii de Baza

main
Joaquin 3 years ago
parent 4f74140c1c
commit ecf487e9f4
Signed by: puly
GPG Key ID: 9E9299CD96C65EC6

1
.gitignore vendored

@ -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);

2625
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -11,5 +11,13 @@
"url": "https://cseinfo.cafelutza.cf/DepInfo/biblioteca"
},
"author": "DepInfo TudorVianu",
"license": "0BSD"
"license": "0BSD",
"dependencies": {
"crypto": "^1.0.1",
"express": "^4.18.2",
"express-session": "^1.17.3",
"fs": "^0.0.1-security",
"http": "^0.0.1-security",
"tailwindcss": "^3.3.2"
}
}

@ -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…
Cancel
Save