Compare commits
48 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
25c1a73901 | ||
6239a38ff7 | |||
![]() |
e34045e3c0 | ||
85458c05e4 | |||
afb67f34d4 | |||
f66e1c4b26 | |||
60f843b6d2 | |||
b1ef6a6b8f | |||
42bfe61e54 | |||
53544492a8 | |||
7f6f73779c | |||
fa9cdee863 | |||
e2730b393e | |||
f9da14d044 | |||
89f3653bca | |||
20d02fa2ce | |||
30a9110623 | |||
591c478325 | |||
0142794302 | |||
2977da4b32 | |||
42de93efe5 | |||
2dd1c87bb7 | |||
22c0f04cde | |||
4357c58dfd | |||
8c2d58beb8 | |||
0db6f71655 | |||
02273208fd | |||
6cf10ae7f9 | |||
![]() |
49420c5a1d | ||
![]() |
b9eea92668 | ||
![]() |
73770a1904 | ||
8db7639e37 | |||
9a29e5da68 | |||
f95899f68d | |||
317e92ec7f | |||
![]() |
6b2ce5c8fb | ||
![]() |
b65b5570cc | ||
![]() |
feb5689757 | ||
![]() |
06eedbdd63 | ||
![]() |
81921fa4ba | ||
![]() |
4e85d9e33a | ||
![]() |
b01aa43f32 | ||
87fd6ecd6e | |||
1eb6af9afd | |||
c03a80c66d | |||
08c11d4f6e | |||
762dd9974c | |||
c60f635a89 |
2
.vscode/settings.json
vendored
Normal file
2
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
{
|
||||||
|
}
|
114
README.md
114
README.md
@ -1,2 +1,114 @@
|
|||||||
# Unnamed Password Manager
|
# Unnamed Password Manager
|
||||||
Hi
|
### Introduction
|
||||||
|
This is a password manager. Keep your passwords safe. :><br>
|
||||||
|
|
||||||
|
### Features:
|
||||||
|
- Fully local storage
|
||||||
|
- Symmetric AES encryption
|
||||||
|
- Multiple users
|
||||||
|
- Cross platform
|
||||||
|
- Web ui
|
||||||
|
|
||||||
|
## Working
|
||||||
|
Why use Unnamed Password Manager (UNPM)
|
||||||
|
### Before UNPM
|
||||||
|
"Never use common password"
|
||||||
|
- A wise person
|
||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
vw[Visit Website]
|
||||||
|
--> s[Sign up using unique password]
|
||||||
|
--> fp["Forgot Password 😭"]
|
||||||
|
vw[Visit Website]
|
||||||
|
--> sa[Sign up with common password]
|
||||||
|
--> gh[Get all your accounts hacked]
|
||||||
|
```
|
||||||
|
### After UNPM
|
||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
vw[Visit Website]
|
||||||
|
--> s[Sign up using unique password]
|
||||||
|
--> sp[Save password safely in UNPM]
|
||||||
|
vwa[Visit Website again]
|
||||||
|
--> gp[Get password using our web-app]
|
||||||
|
--> l[Login]
|
||||||
|
```
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
#### How to Backup?
|
||||||
|
- Check where AppData is standard stored if your OS is not mentioned here.
|
||||||
|
- Linux:
|
||||||
|
- - Backup the file at the location "~/.local/share/Unnamed_Password_Manager/\<USERNAME\>"
|
||||||
|
- - Paste it in the same location or follow the directions for the OS.
|
||||||
|
|
||||||
|
|
||||||
|
# Dev docs
|
||||||
|
## Rest API
|
||||||
|
##### WARNING:
|
||||||
|
Do NOT use this api for ANY reason EXCEPT if usage is ONLY local, i.e.,
|
||||||
|
this api is NOT built for usage over an external network and doing so
|
||||||
|
WILL NOT BE SECURE
|
||||||
|
###### Note:
|
||||||
|
Server throws 405 METHOD NOT ALLOWED if the url is mistyped
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
autonumber
|
||||||
|
actor User
|
||||||
|
box App
|
||||||
|
participant Frontend
|
||||||
|
participant Backend
|
||||||
|
end
|
||||||
|
|
||||||
|
Note over User, Backend : LOGIN
|
||||||
|
User -->> Frontend : Wants to login
|
||||||
|
Frontend -->> Backend : { user_name : "...", password : "..." } to /login
|
||||||
|
Backend -->> Frontend : Success : http 200
|
||||||
|
Backend -->> Frontend : user_name / password not given : http 400
|
||||||
|
Backend -->> User : user_name / password is wrong : http 403
|
||||||
|
|
||||||
|
Note over User, Backend : LOGOUT
|
||||||
|
User -->> Frontend : Wants to logout
|
||||||
|
Frontend -->> Backend : /logout
|
||||||
|
Backend -->> Frontend : Success : http 200
|
||||||
|
Backend -->> User : Not logged in : http 403
|
||||||
|
|
||||||
|
Note over User, Backend : ADD USER
|
||||||
|
User -->> Frontend : Wants to add user
|
||||||
|
Frontend -->> Backend : { user_name : "...", password : "..." } to /add_user
|
||||||
|
Backend -->> Frontend : Success : http 200
|
||||||
|
Backend -->> Frontend : user_name / password not given : http 400
|
||||||
|
Backend -->> User : user_name is taken : http 403
|
||||||
|
|
||||||
|
Note over User, Backend : GET DATA
|
||||||
|
User -->> Frontend : field/ entry, etc.
|
||||||
|
Frontend -->> Backend : /get_data
|
||||||
|
Backend -->> User : Not logged in : http 403
|
||||||
|
|
||||||
|
Note over User, Backend : CHANGE PASSWORD
|
||||||
|
User -->> Frontend : Wants to change password
|
||||||
|
Frontend -->> Backend : { password : "..." } to /change_password
|
||||||
|
Backend -->> Frontend : password not given : http 400
|
||||||
|
Backend -->> User : Not logged in : http 403
|
||||||
|
|
||||||
|
Note over User, Backend : ADD ENTRY
|
||||||
|
User -->> Frontend : Wants to add entry
|
||||||
|
Frontend -->> Backend : entry data to /add_entry
|
||||||
|
Note over Frontend, Backend : entry data is { entry_name : "...", fields : "..." }
|
||||||
|
Note over Frontend, Backend : fields should be string({ field1 : "...", field2 : "...", ... })
|
||||||
|
Backend -->> Frontend : Entry data is not correct : http 400
|
||||||
|
Backend -->> User : Not logged in : http 403
|
||||||
|
|
||||||
|
Note over User, Backend : DELETE ENTRY
|
||||||
|
User -->> Frontend : Wants to delete entry
|
||||||
|
Frontend -->> Backend : { entry_name : "..." } to /delete_entry
|
||||||
|
Backend -->> Frontend : entry_name not given : http 400
|
||||||
|
Backend -->> User : Not logged in or entry_name does not exist : http 403
|
||||||
|
|
||||||
|
Note over User, Backend : EDIT ENTRY NAME
|
||||||
|
User -->> Frontend : Wants to change entry name
|
||||||
|
Frontend -->> Backend : { old_entry_name : "...", new_entry_name : "..." }
|
||||||
|
Backend -->> Frontend : Success : http 200
|
||||||
|
Backend -->> Frontend : old or new entry names not given : http 400
|
||||||
|
Backend -->> User : Old user name doesn't exist or the new one already exists
|
||||||
|
```
|
||||||
|
@ -14,9 +14,11 @@
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------------------(Getting Data)
|
//-----------------------------------------------------------------------------------------(Getting Data)
|
||||||
|
|
||||||
|
const PORT = 5000;
|
||||||
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
try {
|
try {
|
||||||
let response = await fetch('/get_data', {
|
let response = await fetch(`http://127.0.0.1:${PORT}/get_data`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@ -223,7 +225,7 @@ const errorlabel = document.querySelector('.fieldcontainer label')
|
|||||||
|
|
||||||
async function sendData(formData){
|
async function sendData(formData){
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/add_entry', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/add_entry`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -401,7 +403,7 @@ async function deleteEntry() {
|
|||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append("entry_name", localStorage.getItem("editVal"))
|
formData.append("entry_name", localStorage.getItem("editVal"))
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/delete_entry', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/delete_entry`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -478,7 +480,7 @@ async function sendPass(password) {
|
|||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append("password", password)
|
formData.append("password", password)
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/change_password', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/change_password`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -593,7 +595,7 @@ async function addNewField(sitename, field, value) {
|
|||||||
formData.append("field_value", value)
|
formData.append("field_value", value)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/add_field', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/add_field`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -622,7 +624,7 @@ async function editFieldValue(sitename, field, value) {
|
|||||||
formData.append("field_value", value)
|
formData.append("field_value", value)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/edit_field_value', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/edit_field_value`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -649,7 +651,7 @@ async function changeEntryName(entryname, sitename) {
|
|||||||
formData.append("new_entry_name", sitename)
|
formData.append("new_entry_name", sitename)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/edit_entry_name', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/edit_entry_name`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -789,7 +791,7 @@ function closePopup() {
|
|||||||
|
|
||||||
async function logOut() {
|
async function logOut() {
|
||||||
try{
|
try{
|
||||||
await fetch("/logout", {
|
await fetch(`http://127.0.0.1:${PORT}/logout`, {
|
||||||
method:'POST',
|
method:'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
const PORT = 5000;
|
||||||
|
|
||||||
let loginb = document.getElementById("loginb");
|
let loginb = document.getElementById("loginb");
|
||||||
|
|
||||||
loginb.addEventListener("click", validateLogin);
|
loginb.addEventListener("click", validateLogin);
|
||||||
@ -48,7 +50,7 @@ formData.append('password', _password);
|
|||||||
// console.log(formData)
|
// console.log(formData)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/login', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/login`, {
|
||||||
method: "post",
|
method: "post",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -88,7 +90,7 @@ register.addEventListener("click", function(event) {
|
|||||||
|
|
||||||
window.onload = async function() {
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
let response = await fetch('/get_data', {
|
let response = await fetch(`http://127.0.0.1:${PORT}/get_data`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
@ -29,7 +29,7 @@ async function createUser(username,password) {
|
|||||||
formData.append("password", password)
|
formData.append("password", password)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/add_user', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/add_user`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -55,7 +55,7 @@ async function Login(username,password){
|
|||||||
formData.append('password', password);
|
formData.append('password', password);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/login', {
|
const response = await fetch(`http://127.0.0.1:${PORT}/login`, {
|
||||||
method: "post",
|
method: "post",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
|
@ -1193,7 +1193,6 @@ footer p{
|
|||||||
@media (max-width: 860px) {
|
@media (max-width: 860px) {
|
||||||
.container{
|
.container{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 774px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
package-lock.json
generated
Normal file
13
package-lock.json
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "unnamed-password-manager",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "unnamed-password-manager",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
package.json
Normal file
12
package.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "unnamed-password-manager",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Hi",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": ""
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user