https://github.com/somecho/datbin
Data pastebin, simple and self-hosted.
https://github.com/somecho/datbin
clojure docker interceptors pastebin pedestal
Last synced: about 1 month ago
JSON representation
Data pastebin, simple and self-hosted.
- Host: GitHub
- URL: https://github.com/somecho/datbin
- Owner: somecho
- License: epl-2.0
- Created: 2023-11-04T11:03:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-04T22:36:55.000Z (over 2 years ago)
- Last Synced: 2025-08-11T01:51:27.509Z (10 months ago)
- Topics: clojure, docker, interceptors, pastebin, pedestal
- Language: Clojure
- Homepage:
- Size: 236 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> 📚 Disclaimer: This is a weekend project with the purpose of learning [Pedestal](http://pedestal.io/pedestal/0.7-pre/index.html) and, associated with it, interceptors.
# Datbin
### Datbin is a simple self-hosted pastebin for all data formats. Here's how it works.
Assuming Datbin is running somewhere (for our purposes, let's say it is `localhost`), the home page serves an upload form, from which you can upload your file. If the upload is successful, you'll be redirected to a page confirming your success and be given a link, with which you can share your file.

upload form

success page
#### Usecases
Since Datbin is, in our scenario, running in a local network, you can only really share it if you know the private IP address of the machine Datbin is running on and if the device you are trying to access the shared file with is also in the same local network. One way of accessing the data from external networks is to use a VPN like [Tailscale](https://tailscale.com) and have both machines be connected to it.
## Technical Details
Datbin is written in Clojure with the web library Pedestal. The pages, for which little effort was spent to make stylish, are rendered server-side with [Hiccup](https://github.com/weavejester/hiccup) and [Garden](https://github.com/noprompt/garden). [Datalevin](https://github.com/juji-io/datalevin) is used as the records-storing database, keeping track of the uploads.
### Usage
Start the server and go to `localhost:3888`.
#### Leiningen
```sh
lein run
```
#### Jar
```sh
lein uberjar
java \
--add-opens java.base/java.nio=ALL-UNNAMED \
--add-opens java.base/sun.nio.ch=ALL-UNNAMED \
-jar target/server.jar
```
### Docker
#### Building with Docker
```
docker build -t datbin .
docker run -p 3888:3888 -v $PWD/data:/server/data:rw -v $PWD/logs:/server/logs:rw datbin
```
#### Docker Compose
```
docker-compose up
```
---
© 2023 Somē Cho