Compare commits

...

2 Commits

Author SHA1 Message Date
b73c06f1ab docs: update on what SHOULD_AUTH actually does 2024-10-31 10:17:23 -03:00
0668e42ea8 style: br on a newline 2024-10-31 10:13:58 -03:00
4 changed files with 6 additions and 5 deletions

View File

@ -168,7 +168,7 @@ abyss is a basic and mostly single user http server written in go made for uploa
- `UPLOAD_KEY`: this is key checked when uploading files. if the key doesn't match with server's one, then it refuses uploading.
- `ABYSS_FILEDIR`: this points to the directory where abyss will save the uploads to. defaults to `./files`
- `ABYSS_PORT`: this is the port the server will run on. safe to leave empty. defaults to 3235
- `SHOULD_AUTH`: if it is `yes`, then to upload text through the browser you will need authentication (same auth as `/tree`), any value other than that and upload is auth-less
- `SHOULD_AUTH`: if it is `yes`, then to upload text you will need authentication (same auth as `/tree`), any value other than that and upload is authless
## todo:

View File

@ -103,9 +103,9 @@ func setupHandlers(mux *http.ServeMux, app *Application) {
if app.authUpload == "yes" {
mux.HandleFunc("/upload", BasicAuth(app.uploadHandler, app))
slog.Warn("text uploading through the browser will be restricted")
slog.Warn("text uploading will be restricted")
} else {
mux.HandleFunc("/upload", app.uploadHandler)
slog.Warn("text uploading through the browser will NOT be restricted")
slog.Warn("text uploading will NOT be restricted")
}
}

View File

@ -43,7 +43,7 @@ AUTH_USERNAME=$AUTH_USERNAME
# This is the password of the user for accessing /tree
AUTH_PASSWORD=$AUTH_PASSWORD
# This is whether you need a password to upload text through the browser
# This is whether you need a password to upload text (through browser or curl)
SHOULD_AUTH=$SHOULD_AUTH
# This is the key needed to make uploads. Include it as X-Auth in curl.

View File

@ -21,7 +21,8 @@
</div>
<form action="/upload" method="POST">
<textarea name="content" placeholder="Enter your content here..."></textarea><br />
<textarea name="content" placeholder="Enter your content here..."></textarea>
<br />
<button type="submit">upload</button>
</form>