ref: 3d9690185d608cf2232e4418b5d5a9a6a39ff233 gobin/README.md -rw-r--r-- 1.9 KiB
3d969018 — Alexey Yerin docs: reword a bit 11 months ago


Simple self-hosted service for sharing text snippets


  • Totally anonymous, not even IP is logged
  • Dark theme by default
  • JavaScript-free
  • Easy to deploy


Two basic requirements are Go compiler (unless you grab built binaries) and PostgreSQL database running.


Set DATABASE_URI environment variable to postgresql://-URI:

export DATABASE_URI=posgtresql://USER:PASSWORD@localhost/DB
  • USER is your username (postrges is default)
  • PASSWORD is your strong and complicated password
  • DB is your database name (make sure to run create database before running)


If you want to change port on which application is running, set PORT environment variable (4000 is default).

If your application is hosted not on localhost, you should change BASE_URL environment variable to http:// or https:// + your domain (e.g. https://somesite.dev)

export BASE_URL=https://somesite.dev
export PORT=80 # Note: you might need to run gobin as root


git clone https://git.sr.ht/~yerinalexey/gobin
cd gobin

go build


./gobin-migrate up

If something goes wrong, you can apply migrations manually by running up.sql files in subdirectories of ./migrations.



It's also a good idea to run gobin binary as a system service. Make sure to provide all environment variables.

#Using systemd

# Copy templates and static files
sudo mkdir -p /usr/share/gobin
cp -r templates static /usr/share/gobin

# Add SystemD unit
cp -r ./contrib/systemd/gobin.service ./contrib/systemd/gobin.service.d /etc/systemd/system

# Edit /etc/systemd/system/gobin.service.d/environment.conf to set environment variables

# Install gobin itself
sudo install ./gobin /usr/local/bin

# Reload units and start gobin
sudo systemctl daemon-reload
sudo systemctl start gobin

#Using OpenRC

TODO: Write the service and this doc