minimal no-fuss pastebin service clone in golang
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KatolaZ 8f5b41695d moved paste operations into paste/paste.go. Using paste.Store() 8 years ago
html basic templating added (only for paste visualisation) 8 years ago
paste moved paste operations into paste/paste.go. Using paste.Store() 8 years ago
.gitignore Added few entried to .gitignore 8 years ago
Makefile Added a Makefile and log_file option to the config file 8 years ago
README.md Added a Makefile and log_file option to the config file 8 years ago
binnit.cfg moved paste operations into paste/paste.go. Using paste.Store() 8 years ago
binnit.go moved paste operations into paste/paste.go. Using paste.Store() 8 years ago
config.go Added a Makefile and log_file option to the config file 8 years ago
main.go moved paste operations into paste/paste.go. Using paste.Store() 8 years ago
templ.go Name changed to "binnit" 8 years ago

README.md

binnit -- minimal pastebin-like in golang

That's just it. Preliminary version of a minimal, no-fuss pastebin-like service in golang.

It serves pastes in the format:

mypasteserver.org/abcdef1234567890

and stores them in a folder, one file per paste, whose filename is equal to the paste ID. The unique ID of a paste is obtained from the SHA256 of the concatenation of title, time, and content. Rendering is minimal, but can be enhanced.

binnit is currently configured through a simple key=value configuration file, whose name can be specified on the command line through the option -c <config\_file>. The available options are:

  • server_name (the FQDN where the service is reachable from outside)
  • bind_addr (the address to listen on)
  • bind_port (the port to bind)
  • paste_dir (the folder where pastes are kept)
  • templ_dir (the folder where HTML files and templates are kept)
  • max_size (the maximum allowed length of a paste, in bytes. Larger pastes will be trimmed to that length)
  • log_fname (path to the logfile)

TODO

  • reorganise the code for paste storage/retrieve