Skip to content

somecho/datbin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 Disclaimer: This is a weekend project with the purpose of learning Pedestal 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 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 and Garden. Datalevin is used as the records-storing database, keeping track of the uploads.

Usage

Start the server and go to localhost:3888.

Leiningen

lein run

Jar

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

Releases

No releases published

Packages

No packages published