feat: remove /upload and just use /

This commit is contained in:
Lucas Barbieri 2024-08-25 23:16:56 -03:00
parent 84565a5a1a
commit acd9b90042

View File

@ -1,27 +1,34 @@
# abyss # abyss
abyss is a basic single user http server made for uploading files (logs, images) and then sharing them to the internet abyss is a basic single user http server made for uploading files (logs, images) and then sharing them to the internet
note: this is a project made for learning purposes, you should use other more mature projects if running in production note: this is a project made for learning purposes, you should use other more mature projects if running in production
## table of contents ## table of contents
- [running abyss](#running) - [running abyss](#running)
- [installing with docker](#docker) - [installing with docker](#docker)
- [installing manually](#manual) - [installing manually](#manual)
- [uploading files](#uploading) - [uploading files](#uploading)
- [todo list](#todo) - [todo list](#todo)
## running: ## running:
- change URL environment variable to your end url. example: `URL=paste.abyss.dev` if you your files will be accessed through `paste.abyss.dev/name-of-file` - change URL environment variable to your end url. example: `URL=paste.abyss.dev` if you your files will be accessed through `paste.abyss.dev/name-of-file`
- add your password (key) to `.key` in the root directory of the project - it will be used for authentication for uploads. - add your password (key) to `.key` in the root directory of the project - it will be used for authentication for uploads.
- add AUTH_USERNAME and AUTH_PASSWORD environment variables for access to `/tree/` - add AUTH_USERNAME and AUTH_PASSWORD environment variables for access to `/tree/`
### docker ### docker
- to run with docker, you can use docker compose: - to run with docker, you can use docker compose:
```bash ```bash
docker compose up -d # might be docker-compose depending on distro docker compose up -d # might be docker-compose depending on distro
``` ```
- dont change inside port of 8080 unless you know what you're doing - dont change inside port of 8080 unless you know what you're doing
- when updating, run with `--build` instead: - when updating, run with `--build` instead:
```bash ```bash
docker compose up --build -d docker compose up --build -d
``` ```
@ -29,6 +36,7 @@ docker compose up --build -d
### manual ### manual
- to run it, either build with `go build -o abyss` or run it directly with: - to run it, either build with `go build -o abyss` or run it directly with:
```bash ```bash
URL="your-domain" AUTH_USERNAME=admin AUTH_PASSWORD=admin go run ./main.go URL="your-domain" AUTH_USERNAME=admin AUTH_PASSWORD=admin go run ./main.go
``` ```
@ -36,10 +44,13 @@ URL="your-domain" AUTH_USERNAME=admin AUTH_PASSWORD=admin go run ./main.go
## uploading ## uploading
- then, simply upload your files with curl: - then, simply upload your files with curl:
```bash ```bash
curl -F "file=@/path/to/file" -H "X-Auth: "$(cat /path/to/.key) http://localhost:8080/upload curl -F "file=@/path/to/file" -H "X-Auth: "$(cat /path/to/.key) http://localhost:8080/
``` ```
## todo: ## todo:
- [x] add upload of logs funcionality (like 0x0.st) - [x] add upload of logs funcionality (like 0x0.st)
- [x] add docker easy setup - [x] add docker easy setup
- ~~add db for tracking of file names~~ (dont need that) - ~~add db for tracking of file names~~ (dont need that)