Skip to content

Commit

Permalink
docs(authentication): add new file option to readme (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
nydragon committed Aug 22, 2024
1 parent 2c86b00 commit 062cfa1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,21 @@ If the configuration file is not found in the current directory, specify it via
$ CONFIG="$HOME/.rustypaste.toml" rustypaste
```

#### Authentication

To enable basic HTTP auth, set the `AUTH_TOKEN` environment variable (via `.env`):

```sh
$ echo "AUTH_TOKEN=$(openssl rand -base64 16)" > .env
$ rustypaste
```

You can also set multiple auth tokens via the array field `[server].auth_tokens` in your `config.toml`.
There are 2 options for setting multiple auth tokens:

- Via the array field `[server].auth_tokens` in your `config.toml`.
- Or by writing a newline separated list to a file and passing its path to rustypaste via `AUTH_FILE` and `DELETION_FILE` respectively.

> If neither `AUTH_TOKEN` nor `[server].auth_tokens` are set, the server will not require any authentication.
> If neither `AUTH_TOKEN`, `AUTH_FILE` nor `[server].auth_tokens` are set, the server will not require any authentication.
>
> Exception is the `DELETE` endpoint, which requires at least one token to be set. See [deleting files from server](#delete-file-from-server) for more information.
Expand Down

0 comments on commit 062cfa1

Please sign in to comment.