Compare commits
No commits in common. "main" and "yash-priv" have entirely different histories.
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -1,2 +0,0 @@
|
|||||||
{
|
|
||||||
}
|
|
114
README.md
114
README.md
@ -1,114 +1,2 @@
|
|||||||
# Unnamed Password Manager
|
# Unnamed Password Manager
|
||||||
### Introduction
|
Hi
|
||||||
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,11 +14,9 @@
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------------------(Getting Data)
|
//-----------------------------------------------------------------------------------------(Getting Data)
|
||||||
|
|
||||||
const PORT = 5000;
|
|
||||||
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
try {
|
try {
|
||||||
let response = await fetch(`http://127.0.0.1:${PORT}/get_data`, {
|
let response = await fetch('/get_data', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@ -225,7 +223,7 @@ const errorlabel = document.querySelector('.fieldcontainer label')
|
|||||||
|
|
||||||
async function sendData(formData){
|
async function sendData(formData){
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://127.0.0.1:${PORT}/add_entry`, {
|
const response = await fetch('/add_entry', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -403,7 +401,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(`http://127.0.0.1:${PORT}/delete_entry`, {
|
const response = await fetch('/delete_entry', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -480,7 +478,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(`http://127.0.0.1:${PORT}/change_password`, {
|
const response = await fetch('/change_password', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -595,7 +593,7 @@ async function addNewField(sitename, field, value) {
|
|||||||
formData.append("field_value", value)
|
formData.append("field_value", value)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://127.0.0.1:${PORT}/add_field`, {
|
const response = await fetch('/add_field', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -624,7 +622,7 @@ async function editFieldValue(sitename, field, value) {
|
|||||||
formData.append("field_value", value)
|
formData.append("field_value", value)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://127.0.0.1:${PORT}/edit_field_value`, {
|
const response = await fetch('/edit_field_value', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -651,7 +649,7 @@ async function changeEntryName(entryname, sitename) {
|
|||||||
formData.append("new_entry_name", sitename)
|
formData.append("new_entry_name", sitename)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://127.0.0.1:${PORT}/edit_entry_name`, {
|
const response = await fetch('/edit_entry_name', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -791,7 +789,7 @@ function closePopup() {
|
|||||||
|
|
||||||
async function logOut() {
|
async function logOut() {
|
||||||
try{
|
try{
|
||||||
await fetch(`http://127.0.0.1:${PORT}/logout`, {
|
await fetch("/logout", {
|
||||||
method:'POST',
|
method:'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
const PORT = 5000;
|
|
||||||
|
|
||||||
let loginb = document.getElementById("loginb");
|
let loginb = document.getElementById("loginb");
|
||||||
|
|
||||||
loginb.addEventListener("click", validateLogin);
|
loginb.addEventListener("click", validateLogin);
|
||||||
@ -50,7 +48,7 @@ formData.append('password', _password);
|
|||||||
// console.log(formData)
|
// console.log(formData)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://127.0.0.1:${PORT}/login`, {
|
const response = await fetch('/login', {
|
||||||
method: "post",
|
method: "post",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
@ -90,7 +88,7 @@ register.addEventListener("click", function(event) {
|
|||||||
|
|
||||||
window.onload = async function() {
|
window.onload = async function() {
|
||||||
try {
|
try {
|
||||||
let response = await fetch(`http://127.0.0.1:${PORT}/get_data`, {
|
let response = await fetch('/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(`http://127.0.0.1:${PORT}/add_user`, {
|
const response = await fetch('/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(`http://127.0.0.1:${PORT}/login`, {
|
const response = await fetch('/login', {
|
||||||
method: "post",
|
method: "post",
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
|
@ -1193,6 +1193,7 @@ height: 15px;
|
|||||||
@media (max-width: 860px) {
|
@media (max-width: 860px) {
|
||||||
.container{
|
.container{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
width: 774px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
package-lock.json
generated
13
package-lock.json
generated
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"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
12
package.json
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"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