Compare commits
No commits in common. "8bf4d7e5c4a7ee3b6cf7dd27b92b0b491ce32ae6" and "030196cf51ab99f23b346a19bb3f339ab8a1b442" have entirely different histories.
8bf4d7e5c4
...
030196cf51
10
abyss.go
10
abyss.go
@ -25,8 +25,6 @@ func main() {
|
|||||||
app.filesDir = os.Getenv("ABYSS_FILEDIR")
|
app.filesDir = os.Getenv("ABYSS_FILEDIR")
|
||||||
app.port = os.Getenv("ABYSS_PORT")
|
app.port = os.Getenv("ABYSS_PORT")
|
||||||
|
|
||||||
auth := os.Getenv("SHOULD_AUTH")
|
|
||||||
|
|
||||||
if app.auth.username == "" {
|
if app.auth.username == "" {
|
||||||
log.Fatal("basic auth username must be provided")
|
log.Fatal("basic auth username must be provided")
|
||||||
}
|
}
|
||||||
@ -67,13 +65,7 @@ func main() {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
mux.HandleFunc("/last", app.lastUploadedHandler)
|
mux.HandleFunc("/last", app.lastUploadedHandler)
|
||||||
if auth == "yes" {
|
mux.HandleFunc("/upload", app.basicAuth(app.uploadHandler))
|
||||||
mux.HandleFunc("/upload", app.basicAuth(app.uploadHandler))
|
|
||||||
slog.Warn("text uploading through the browser will be restricted")
|
|
||||||
} else {
|
|
||||||
mux.HandleFunc("/upload", app.uploadHandler)
|
|
||||||
slog.Warn("text uploading through the browser will NOT be restricted")
|
|
||||||
}
|
|
||||||
|
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
Addr: app.port,
|
Addr: app.port,
|
||||||
|
@ -22,11 +22,6 @@ if [ -z $AUTH_PASSWORD ]; then
|
|||||||
AUTH_PASSWORD="admin"
|
AUTH_PASSWORD="admin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -p "Auth for upload form - should password be needed to upload text through the browser? [yes]: " -e SHOULD_AUTH
|
|
||||||
if [ -z $SHOULD_AUTH ]; then
|
|
||||||
SHOULD_AUTH="yes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat << EOF > .env
|
cat << EOF > .env
|
||||||
# This is the full name of the final domain for the server. Example: paste.abyss.dev
|
# This is the full name of the final domain for the server. Example: paste.abyss.dev
|
||||||
ABYSS_URL=$ABYSS_URL
|
ABYSS_URL=$ABYSS_URL
|
||||||
@ -43,9 +38,6 @@ AUTH_USERNAME=$AUTH_USERNAME
|
|||||||
# This is the password of the user for accessing /tree
|
# This is the password of the user for accessing /tree
|
||||||
AUTH_PASSWORD=$AUTH_PASSWORD
|
AUTH_PASSWORD=$AUTH_PASSWORD
|
||||||
|
|
||||||
# This is whether you need a password to upload text through the browser
|
|
||||||
SHOULD_AUTH=$SHOULD_AUTH
|
|
||||||
|
|
||||||
# This is the key needed to make uploads. Include it as X-Auth in curl.
|
# This is the key needed to make uploads. Include it as X-Auth in curl.
|
||||||
# Tip: Save it somewhere and use it in curl with \$(cat /path/to/key)
|
# Tip: Save it somewhere and use it in curl with \$(cat /path/to/key)
|
||||||
UPLOAD_KEY=$UPLOAD_KEY
|
UPLOAD_KEY=$UPLOAD_KEY
|
||||||
|
@ -11,19 +11,9 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>abyss paste</h1>
|
<h1>abyss paste</h1>
|
||||||
<div class="top-down">
|
<a href="/last">
|
||||||
<div>
|
<button>last uploaded file</button>
|
||||||
<a href="/tree">
|
</a>
|
||||||
<button>files uploaded</button>
|
|
||||||
</a>
|
|
||||||
<a href="/upload">
|
|
||||||
<button>go to upload</button>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<a href="/last">
|
|
||||||
<button>last uploaded file</button>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<footer>
|
<footer>
|
||||||
abyss paste - powered by
|
abyss paste - powered by
|
||||||
<a href="https://github.com/jabuxas/abyss" target="_blank">abyss</a>
|
<a href="https://github.com/jabuxas/abyss" target="_blank">abyss</a>
|
||||||
|
@ -42,13 +42,3 @@ footer a {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
div {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-down {
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user