Simple self-hosted service for sharing text snippets
Two basic requirements are Go compiler (unless you grab built binaries) and PostgreSQL database running.
DATABASE_URI environment variable to
USERis your username (
PASSWORDis your strong and complicated password
DBis your database name (make sure to run
create databasebefore running)
If you want to change port on which application is running, set
environment variable (4000 is default).
If your application is hosted not on localhost, you should change
BASE_URL environment variable to
https:// + your domain
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
If something goes wrong, you can apply migrations manually by running
up.sql files in subdirectories of
It's also a good idea to run
gobin binary as a system service. Make
sure to provide all environment variables.
# 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 and 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
TODO: Write the service and this doc