improve README
This commit is contained in:
parent
7df811beb4
commit
027d9f573c
2 changed files with 18 additions and 5 deletions
21
README.md
21
README.md
|
@ -1,4 +1,5 @@
|
||||||
# PassED
|
# PassED
|
||||||
|
|
||||||
[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/NuGxJKtDKS)
|
[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/NuGxJKtDKS)
|
||||||
[![Demo](https://img.shields.io/website-up-down-green-red/https/passed.1e99.eu.svg)](https://passed.1e99.eu/)
|
[![Demo](https://img.shields.io/website-up-down-green-red/https/passed.1e99.eu.svg)](https://passed.1e99.eu/)
|
||||||
[![Made with Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](https://go.dev/)
|
[![Made with Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](https://go.dev/)
|
||||||
|
@ -16,21 +17,26 @@ You want to share it on paper, but everyone can read that too.
|
||||||
PassED solves this issue by allowing you to generate single-use URLs with your password.
|
PassED solves this issue by allowing you to generate single-use URLs with your password.
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
|
||||||
When you generate a URL...
|
When you generate a URL...
|
||||||
|
|
||||||
1. The browser generates an AES key.
|
1. The browser generates an AES key.
|
||||||
2. The password you entered gets encrypted using this key.
|
2. The password you entered gets encrypted using this key.
|
||||||
3. The encrypted password is uploaded to the server, which responds with an ID to uniquely identify the password.
|
3. The encrypted password is uploaded to the server, which responds with an ID to uniquely identify the password.
|
||||||
4. A URL is generated that contains the ID and AES key.
|
4. A URL is generated that contains the ID and AES key.
|
||||||
|
|
||||||
When you view a password...
|
When you view a password...
|
||||||
|
|
||||||
1. The browser imports the AES key from the URL.
|
1. The browser imports the AES key from the URL.
|
||||||
2. The browser asks the server for the password using the ID in the URL.
|
2. The browser asks the server for the password using the ID in the URL.
|
||||||
3. The browser decrypts the password from the server using the AES key from the URL.
|
3. The browser decrypts the password from the server using the AES key from the URL.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
Setting up PassED can be done with docker compose or from source. As the website relies on the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) it requires a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts). In other words you must setup a reverse proxy for HTTPS, or access the site via `localhost`.
|
Setting up PassED can be done with docker compose or from source. As the website relies on the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) it requires a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts). In other words you must setup a reverse proxy for HTTPS, or access the site via `localhost`.
|
||||||
|
|
||||||
### Docker compose
|
### Docker compose
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
"passed":
|
"passed":
|
||||||
|
@ -46,33 +52,42 @@ services:
|
||||||
```
|
```
|
||||||
|
|
||||||
### From Source
|
### From Source
|
||||||
|
|
||||||
1. Clonse the source code
|
1. Clonse the source code
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://git.1e99.eu/1e99/passed.git --depth 1
|
git clone https://git.1e99.eu/1e99/passed.git --depth 1
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Ensure that you have go installed, if not follow this [guide](https://go.dev/doc/install).
|
2. Ensure that you have go installed, if not follow this [guide](https://go.dev/doc/install).
|
||||||
3. Build the project.
|
3. Build the project.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go build -o passed .
|
go build -o passed .
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Run the binary.
|
4. Run the binary.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
PASSED_STORE_TYPE=dir ./passed
|
PASSED_STORE_TYPE=dir ./passed
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Configuration is done using environment variables.
|
Configuration is done using environment variables.
|
||||||
|
|
||||||
- `PASSED_ADDRESS`: The address that PassED should listen on, defaults to `:3000`.
|
- `PASSED_ADDRESS`: The address that PassED should listen on, defaults to `:3000`.
|
||||||
- `PASSED_LOG_REQUESTS`: Should requests be logged, defaults to `true`.
|
- `PASSED_LOG_REQUESTS`: Should requests be logged, defaults to `true`.
|
||||||
- `PASSED_MAX_LENGTH`: Maximum password length in KiB, defaults to `12288`.
|
- `PASSED_MAX_LENGTH`: Maximum password length in bytes, defaults to `12288` (12 KiB).
|
||||||
- `PASSED_STORE_TYPE`: Store type to pick, defaults to `ram`.
|
- `PASSED_STORE_TYPE`: Store type to pick, defaults to `ram`.
|
||||||
- `ram`: Passwords are stored in RAM.
|
- `ram`: Passwords are stored in RAM.
|
||||||
- `dir`: Passwords are stored in a directory. The directory is specified using `PASSED_STORE_DIR_PATH`, which defaults to `passwords`. PassED will create the directory for you.
|
- `dir`: Passwords are stored in a directory. The directory is specified using `PASSED_STORE_DIR_PATH`, which defaults to `passwords`. PassED will create the directory for you.
|
||||||
- `PASSED_STORE_CLEAR_INTERVAL`: Time that should pass between clearing expired passwords in seconds, defaults to `30`.
|
- `PASSED_STORE_CLEAR_INTERVAL`: Time that should pass between clearing expired passwords in seconds, defaults to `30`.
|
||||||
- `PASSED_STATIC_TYPE`: Directory from which static files are served, defaults to `embed`.
|
- `PASSED_STATIC_TYPE`: Directory from which static files are served, defaults to `embed`.
|
||||||
- `embed`: Files are served from the files located within the binary. This is recommended.
|
- `embed`: Static files are served from the files located within the binary. This is recommended.
|
||||||
- `dir`: Files are served from a directory. The directory is specified using `PASSED_STATIC_DIR_PATH`, which defaults to `static`. PassED will not create the directory for you.
|
- `dir`: Static files are served from a directory. The directory is specified using `PASSED_STATIC_DIR_PATH`, which defaults to `static`. PassED will not create the directory for you.
|
||||||
|
|
||||||
## Translators
|
## Translators
|
||||||
|
|
||||||
- RoryBD
|
- RoryBD
|
||||||
- Nexio
|
- Nexio
|
||||||
|
|
|
@ -2,7 +2,6 @@ package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
@ -51,7 +50,6 @@ func (store *dir) Create(password []byte, expiresAt time.Time) (string, error) {
|
||||||
|
|
||||||
err = gob.NewEncoder(file).Encode(&entry)
|
err = gob.NewEncoder(file).Encode(&entry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("%s", err)
|
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue