broken, fixes soon
This commit is contained in:
parent
b79f3023b3
commit
f41da4f703
|
@ -321,7 +321,7 @@
|
||||||
let html = false
|
let html = false
|
||||||
function reg() {
|
function reg() {
|
||||||
console.log(document.getElementById('email').value)
|
console.log(document.getElementById('email').value)
|
||||||
sendenc('/reg', { 'user': 'root', 'address': document.getElementById('email').value, 'host': document.getElementById('host').value, 'port': document.getElementById('port').value, 'creds': document.getElementById('auth').value }).then(() => {
|
sendenc('/reg', { 'user': getCookie('user'), 'address': document.getElementById('email').value, 'host': document.getElementById('host').value, 'port': document.getElementById('port').value, 'creds': document.getElementById('auth').value }).then(() => {
|
||||||
update()
|
update()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
14
index.ts
14
index.ts
|
@ -84,7 +84,6 @@ var decrypt = ((encrypted:any,ENC_KEY:any) => {
|
||||||
let decrypted = decipher.update(encrypted, 'base64', 'utf8');
|
let decrypted = decipher.update(encrypted, 'base64', 'utf8');
|
||||||
return (decrypted + decipher.final('utf8'));
|
return (decrypted + decipher.final('utf8'));
|
||||||
} catch(err){
|
} catch(err){
|
||||||
console.log(err)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -137,6 +136,7 @@ app.use((req:any, res:any, next:any) => {
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
*/ // get subdomains working:(
|
*/ // get subdomains working:(
|
||||||
|
|
||||||
app.post('/mail/get/update',async(req:any,res:any)=>{
|
app.post('/mail/get/update',async(req:any,res:any)=>{
|
||||||
const key = new NodeRSA({b: 1024})
|
const key = new NodeRSA({b: 1024})
|
||||||
|
|
||||||
|
@ -166,14 +166,15 @@ app.post('/mail/get/update',async(req:any,res:any)=>{
|
||||||
res.send(JSON.stringify({data:skey.encrypt(JSON.stringify({messages:'reg'}),'base64'),enc:true,html:true}))
|
res.send(JSON.stringify({data:skey.encrypt(JSON.stringify({messages:'reg'}),'base64'),enc:true,html:true}))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
console.log(mail.host)
|
||||||
|
/*
|
||||||
var client = new ImapClient(mail.host, parseInt(mail.port), {
|
var client = new ImapClient(mail.host, parseInt(mail.port), {
|
||||||
auth: {
|
auth: {
|
||||||
user: mail.address,
|
user: mail.address,
|
||||||
pass: mail.creds,
|
pass: mail.creds,
|
||||||
|
|
||||||
},logLevel:1000
|
}
|
||||||
});
|
}).connect().then(()=>{
|
||||||
client.connect().then(()=>{
|
|
||||||
console.log('connected')
|
console.log('connected')
|
||||||
//['uid', 'flags','envelope'] for just header stuff
|
//['uid', 'flags','envelope'] for just header stuff
|
||||||
//['uid', 'flags','envelope','body']
|
//['uid', 'flags','envelope','body']
|
||||||
|
@ -218,7 +219,10 @@ app.post('/mail/get/update',async(req:any,res:any)=>{
|
||||||
res.send(JSON.stringify({data:skey.encrypt(JSON.stringify({messages:[],bod:bo}),'base64'),enc:true,html:true}))
|
res.send(JSON.stringify({data:skey.encrypt(JSON.stringify({messages:[],bod:bo}),'base64'),enc:true,html:true}))
|
||||||
client.close()
|
client.close()
|
||||||
}
|
}
|
||||||
|
}).catch((err:any)=>{
|
||||||
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
//deprecated:(*/
|
||||||
})
|
})
|
||||||
app.post('/mail/del',async(req:any,res:any)=>{
|
app.post('/mail/del',async(req:any,res:any)=>{
|
||||||
const key = new NodeRSA({b: 1024})
|
const key = new NodeRSA({b: 1024})
|
||||||
|
@ -264,8 +268,6 @@ app.post('/mail/reg',async(req:any,res:any)=>{
|
||||||
if(user.alias==dec.data.user){
|
if(user.alias==dec.data.user){
|
||||||
console.log(dec.login_key)
|
console.log(dec.login_key)
|
||||||
logkey = await (decrypt(user.login_key,dec.login_key))
|
logkey = await (decrypt(user.login_key,dec.login_key))
|
||||||
console.log(user.login_key)
|
|
||||||
console.log(logkey)
|
|
||||||
mail=users.indexOf(user)
|
mail=users.indexOf(user)
|
||||||
user.setDataValue('mail',encrypt(JSON.stringify({'emails':[{
|
user.setDataValue('mail',encrypt(JSON.stringify({'emails':[{
|
||||||
'address':dec.data.address,
|
'address':dec.data.address,
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
"body-parser": "^1.20.0",
|
"body-parser": "^1.20.0",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"fs": "^0.0.1-security",
|
"fs": "^0.0.1-security",
|
||||||
|
"imap-simple": "^5.1.0",
|
||||||
"ip": "^1.1.8",
|
"ip": "^1.1.8",
|
||||||
"md5": "^2.3.0",
|
"md5": "^2.3.0",
|
||||||
"node-rsa": "^1.1.1",
|
"node-rsa": "^1.1.1",
|
||||||
|
|
111
readme.md
111
readme.md
|
@ -12,17 +12,16 @@ security project to ~~learn client and server encryption~~ mail & advanced reque
|
||||||
|
|
||||||
create generic keys `openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./certs/selfsigned.key -out ./certs/selfsigned.crt`, or insert which ever ones to `./certs/selfsigned.key` and to `./certs/selfsigned.crt` respectively
|
create generic keys `openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./certs/selfsigned.key -out ./certs/selfsigned.crt`, or insert which ever ones to `./certs/selfsigned.key` and to `./certs/selfsigned.crt` respectively
|
||||||
|
|
||||||
---
|
***
|
||||||
|
|
||||||
### running
|
### running
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
||||||
- ts-node |`npm i -g ts-node`
|
* ts-node |`npm i -g ts-node`
|
||||||
- package.json | `npm i`
|
* package.json | `npm i`
|
||||||
- development (optional)
|
* development (optional)
|
||||||
- nodemon | `npm i -g nodemon`
|
* nodemon | `npm i -g nodemon`
|
||||||
|
|
||||||
|
|
||||||
#### windows
|
#### windows
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ main build : `npm start`
|
||||||
|
|
||||||
dev : `npm run dev`
|
dev : `npm run dev`
|
||||||
|
|
||||||
---
|
***
|
||||||
|
|
||||||
#### \*nix
|
#### \*nix
|
||||||
|
|
||||||
|
@ -40,64 +39,64 @@ main build : `sudo ts-node .`
|
||||||
|
|
||||||
dev : `sudo nodemon .`
|
dev : `sudo nodemon .`
|
||||||
|
|
||||||
|
***
|
||||||
---
|
|
||||||
|
|
||||||
[gitea](https://git.disroot.org/grantsquires/kanna-site) | [github](https://github.com/squiresgrant/kanna-site)
|
[gitea](https://git.disroot.org/grantsquires/kanna-site) | [github](https://github.com/squiresgrant/kanna-site)
|
||||||
|
|
||||||
## todo
|
## todo
|
||||||
|
|
||||||
- [ ] add extra pages
|
* \[ ] add extra pages
|
||||||
- [ ] home page (quick links, etc)
|
* \[ ] home page (quick links, etc)
|
||||||
- [ ] mail
|
* \[ ] mail
|
||||||
- [ ] allow for automation (ie, auto reply)
|
* \[ ] allow for automation (ie, auto reply)
|
||||||
- [ ] forums
|
* \[ ] forums
|
||||||
- [ ] storage
|
* \[ ] storage
|
||||||
- [ ] viewer for images
|
* \[ ] viewer for images
|
||||||
- [ ] viewer for docs
|
* \[ ] viewer for docs
|
||||||
- [ ] login
|
* \[ ] login
|
||||||
- [ ] performance related
|
* \[ ] performance related
|
||||||
- [ ] store all listeners in array and kill
|
* \[ ] store all listeners in array and kill
|
||||||
- [ ] go through all html files, clean up code
|
* \[ ] go through all html files, clean up code
|
||||||
- [ ] increase initiation vector (IV) size
|
* \[ ] increase initiation vector (IV) size
|
||||||
|
|
||||||
## currently
|
## currently
|
||||||
|
|
||||||
- [x] learning how mail works
|
* \[x] learning how mail works
|
||||||
- [ ] toggle plaintext/html emails
|
* \[ ] toggle plaintext/html emails
|
||||||
- [ ] option to markdownify email
|
* \[ ] option to markdownify email
|
||||||
- [ ] write md emails, send as html
|
* \[ ] write md emails, send as html
|
||||||
- [ ] sexify
|
* \[ ] sexify
|
||||||
- [ ] settings.json
|
* \[ ] settings.json
|
||||||
- [ ] make mail prettier
|
* \[ ] make mail prettier
|
||||||
- [ ] dont accept old login keys
|
* \[ ] dont accept old login keys
|
||||||
- [ ] add functionality
|
* \[ ] add functionality
|
||||||
- [x] loading screen
|
* \[x] loading screen
|
||||||
- [x] storage for quicker (initial)loading
|
* \[x] storage for quicker (initial)loading
|
||||||
- [x] delete
|
* \[x] delete
|
||||||
- [ ] send
|
* \[ ] send
|
||||||
- [ ] reply
|
* \[ ] reply
|
||||||
- [ ] draft
|
* \[ ] draft
|
||||||
- [ ] forward
|
* \[ ] forward
|
||||||
- [ ] sender info
|
* \[ ] sender info
|
||||||
- [ ] allow for email account adding
|
* \[ ] allow for email account adding
|
||||||
- [ ] docs
|
* \[ ] docs
|
||||||
- [x] extra pages
|
* \[x] extra pages
|
||||||
- [x] 404 page
|
* \[x] 404 page
|
||||||
- [ ] sub domains
|
* \[ ] sub domains
|
||||||
- [ ] ughh hate sub domains
|
* \[ ] ughh hate sub domains
|
||||||
- [ ] make my own libs
|
* \[ ] make my own libs
|
||||||
- [ ] encryption (md5 hashing, rsa, and aes)
|
* \[ ] encryption (md5 hashing, rsa, and aes)
|
||||||
- [ ] add aliases that are used in cookies and randomly gen.
|
* \[ ] [imap wrapper (soonish)](https://www.nylas.com/blog/nylas-imap-therefore-i-am/)
|
||||||
- [ ] also server side hash to check/verify the alias
|
* \[ ] add aliases that are used in cookies and randomly gen.
|
||||||
- [ ] more sexy gradients (everywhere)
|
* \[ ] also server side hash to check/verify the alias
|
||||||
- [ ] lower verbosity (and options to change it)
|
* \[ ] more sexy gradients (everywhere)
|
||||||
- [ ] move all dependencies to local ones
|
* \[ ] lower verbosity (and options to change it)
|
||||||
- [ ] check for permissions on what ports to open
|
* \[ ] move all dependencies to local ones
|
||||||
|
* \[ ] check for permissions on what ports to open
|
||||||
|
|
||||||
### issues
|
### issues
|
||||||
|
|
||||||
- [x] storage not saving
|
* \[x] storage not saving
|
||||||
- [ ] check for login key cookie on page load
|
* \[ ] check for login key cookie on page load
|
||||||
|
|
||||||
FeMail (iron mail)
|
FeMail (iron mail)
|
||||||
|
|
Loading…
Reference in a new issue