Compare commits

..

4 Commits

Author SHA1 Message Date
621cd34508 docs: add home page explanation 2024-09-18 10:34:42 -03:00
93194f4a1c feat: add static website example 2024-09-18 10:26:32 -03:00
20fd599ed7 chore: update gitignore 2024-09-18 10:24:21 -03:00
1211e730e9 fix!: fix docker path handling
after i trimmed down the image, it didn't have workdir /app, so we need
to fix it
2024-09-18 10:23:43 -03:00
5 changed files with 63 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
files/
abyss
.env
dev/

View File

@ -10,6 +10,7 @@ note: this is a project made for learning purposes, you should use other more ma
- [installing with docker](#docker)
- [installing manually](#manual)
- [uploading files](#uploading)
- [home page](#homepage)
- [docs](#docs)
- [todo list](#todo)
@ -40,9 +41,15 @@ docker compose up -d # might be docker-compose depending on distro
- then, simply upload your files with curl:
```bash
curl -F "file=@/path/to/file" -H "X-Auth: "$(cat /path/to/.key) http://localhost:8999/
curl -F "file=@/path/to/file" -H "X-Auth: "$(cat /path/to/.key) http://localhost:3235/
```
## homepage
- there is an example homepage in `static/` you can edit directly, which the server will serve automatically
- if running with docker, it's also possible to override `/static` inside the container with your own page.
- it is preferred to use `dev/` for that reason, since it is git-ignored and that way makes it easier if wanting to update regularly without making changes to the tree
## docs
- `ABYSS_URL`: this is used for the correct formatting of the response of `curl`.
@ -59,4 +66,5 @@ curl -F "file=@/path/to/file" -H "X-Auth: "$(cat /path/to/.key) http://localhost
- [x] add file browser (like file://)
- [x] add file extension in its name
- [x] login prompt when accessing /tree
- [x] home page
- [ ] add rate limits

View File

@ -4,7 +4,8 @@ services:
ports:
- "3235:3235"
volumes:
- ./files:/app/files
restart: unless-stopped
- ./files:/files
- ./dev:/static:ro
env_file:
- .env
restart: unless-stopped

19
static/index.html Normal file
View File

@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Abyss - A minimalist pastebin webserver" />
<title>abyss paste</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1>abyss paste</h1>
<a href="/last">
<button>last uploaded file</button>
</a>
</body>
</html>

31
static/style.css Normal file
View File

@ -0,0 +1,31 @@
body {
font-family: Arial, sans-serif;
background-color: #1d1f21;
color: #c5c6c7;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
}
h1 {
font-size: 3rem;
margin-bottom: 1rem;
}
button {
padding: 0.75rem 2rem;
background-color: #66fcf1;
border: none;
border-radius: 5px;
color: #1f2833;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #45a29e;
}