docs: fix indentation on code blocks

This commit is contained in:
jabuxas 2024-10-21 11:27:27 -03:00
parent 4190f15a50
commit fae72778d9

View File

@ -34,9 +34,9 @@ abyss is a basic and mostly single user http server written in go made for uploa
- clone the repository and cd into it: - clone the repository and cd into it:
```bash ```bash
git clone https://github.com/jabuxas/abyss.git --depth 1 && cd abyss git clone https://github.com/jabuxas/abyss.git --depth 1 && cd abyss
``` ```
- then run `./generate_config.sh` to setup the necessary environment variables - then run `./generate_config.sh` to setup the necessary environment variables
- after that, you can use either docker or run it directly - after that, you can use either docker or run it directly
@ -45,9 +45,9 @@ git clone https://github.com/jabuxas/abyss.git --depth 1 && cd abyss
- to run with docker, you can use the `docker-compose.yml` file available in this repo. to do so, run: - to run with docker, you can use the `docker-compose.yml` file available in this repo. to do so, run:
```bash ```bash
docker compose up -d # might be docker-compose depending on distro docker compose up -d # might be docker-compose depending on distro
``` ```
- you can optionally use the [docker image](https://git.jabuxas.xyz/jabuxas/-/packages/container/abyss/latest) directly and set it up how you want - you can optionally use the [docker image](https://git.jabuxas.xyz/jabuxas/-/packages/container/abyss/latest) directly and set it up how you want
@ -55,9 +55,9 @@ docker compose up -d # might be docker-compose depending on distro
- to run it manually, build it with `go build -o abyss` or grab a binary from github actions and run: - to run it manually, build it with `go build -o abyss` or grab a binary from github actions and run:
```bash ```bash
./abyss ./abyss
``` ```
- you will need to either: - you will need to either:
- create a `.env` file in `$(pwd)` and set up the necessary variables as in [docs](#docs) - create a `.env` file in `$(pwd)` and set up the necessary variables as in [docs](#docs)
@ -74,16 +74,16 @@ docker compose up -d # might be docker-compose depending on distro
- to upload your files with main key: - to upload your files with main key:
```bash ```bash
curl -F "file=@/path/to/file" -H "X-Auth: "$(cat /path/to/.key) http://localhost:3235/ curl -F "file=@/path/to/file" -H "X-Auth: "$(cat /path/to/.key) http://localhost:3235/
``` ```
- you should probably create an `alias` or a `function` to do this automatically for you. - you should probably create an `alias` or a `function` to do this automatically for you.
<details> <details>
<summary>click for an example for bash/zsh:</summary> <summary>click for an example for bash/zsh:</summary>
```bash ```bash
pst() { pst() {
local file local file
if [[ -p /dev/stdin ]]; then if [[ -p /dev/stdin ]]; then
@ -101,16 +101,16 @@ pst() {
if [[ -p /dev/stdin ]]; then if [[ -p /dev/stdin ]]; then
rm "$file" rm "$file"
fi fi
} }
``` ```
</details> </details>
<details> <details>
<summary>click for an example for fish shell:</summary> <summary>click for an example for fish shell:</summary>
```bash ```bash
function pst function pst
set -l file set -l file
if command test -p /dev/stdin if command test -p /dev/stdin
@ -125,26 +125,26 @@ function pst
if command test -p /dev/stdin if command test -p /dev/stdin
rm "$file" rm "$file"
end end
end end
``` ```
</details> </details>
##### with jwt tokens ##### with jwt tokens
- you first need to generate them: - you first need to generate them:
```bash ```bash
curl -u admin http://localhost:3235/token # you can also access the url in the browser directly curl -u admin http://localhost:3235/token # you can also access the url in the browser directly
``` ```
- the user will be the value of `$AUTH_USERNAME` and password the value of `$AUTH_PASSWORD` - the user will be the value of `$AUTH_USERNAME` and password the value of `$AUTH_PASSWORD`
- then you use the token in place of the main key: - then you use the token in place of the main key:
```bash ```bash
curl -F"file=@/path/to/file.jpg" -H "X-Auth: your-token" http://localhost:3235/ curl -F"file=@/path/to/file.jpg" -H "X-Auth: your-token" http://localhost:3235/
``` ```
#### through the browser #### through the browser