{"id":13689352,"url":"https://github.com/gabriel-samfira/gopherbin","last_synced_at":"2025-05-01T23:34:03.684Z","repository":{"id":50313812,"uuid":"226363317","full_name":"gabriel-samfira/gopherbin","owner":"gabriel-samfira","description":"A simple pastebin written in Go","archived":false,"fork":false,"pushed_at":"2024-05-30T11:28:20.000Z","size":5924,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-03T15:17:28.646Z","etag":null,"topics":["golang","paste","pastebin"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabriel-samfira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-06T16:00:13.000Z","updated_at":"2024-06-14T15:29:27.000Z","dependencies_parsed_at":"2023-12-19T16:38:10.248Z","dependency_job_id":"465d12cd-62da-4a85-bad4-dc6a603282bf","html_url":"https://github.com/gabriel-samfira/gopherbin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabriel-samfira%2Fgopherbin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabriel-samfira%2Fgopherbin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabriel-samfira%2Fgopherbin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabriel-samfira%2Fgopherbin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabriel-samfira","download_url":"https://codeload.github.com/gabriel-samfira/gopherbin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224282241,"owners_count":17285795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","paste","pastebin"],"created_at":"2024-08-02T15:01:44.447Z","updated_at":"2024-11-12T13:31:33.075Z","avatar_url":"https://github.com/gabriel-samfira.png","language":"Go","funding_links":[],"categories":["golang"],"sub_categories":[],"readme":"# Gopherbin\n\nWelcome to Gopherbin. This project offers a simple password protected, paste-like service, that you can self host. This is an initial release, so expect bugs.\n\n[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/gopherbin)\n\n\n## Building\n\n### Using Go\n\nYou will need at least Go version ```1.16```.\n\nGopherbin uses the embed feature in Go to optionally bundle the [Web UI](https://github.com/gabriel-samfira/gopherbin-web). You can choose to build without a web UI and simply serve the needed static files using a proper web server. \n\nClone Gopherbin:\n\n```bash\ngit clone https://github.com/gabriel-samfira/gopherbin\n```\n\nIf you want to build the UI, you will need a recent version of nodejs and yarn. With those dependencies installed, simply run:\n\n```bash\nmake all\n```\n\nBuilding without a UI:\n\n```bash\nmake all-noui\n```\n\n### Building a docker image\n\n```bash\n# For a full list of available variables and commands run: make help\n\n# creating docker image\nmake build-image\n\n# start a container using image previously built\nmake start-container\n\n```\n\n## Creating a database\n\nGopherbin can use either MySQL/MariaDB or SQLite3.\n\nIf you're planning on using MySQL, you'll need to create the database first:\n\n```sql\ncreate database gopherbin;\ncreate user 'gopherbin'@'%' identified by 'superSecretPassword';\ngrant all on gopherbin.* to 'gopherbin'@'%';\nflush privileges;\n```\n\n## Configuration\n\nThe config is a simple toml.\n\n```toml\n[apiserver]\nbind = \"0.0.0.0\"\nport = 9997\nuse_tls = false\n\n    [apiserver.jwt_auth]\n    # secret used to sign jwt tokens\n    #\n    secret = \"beerdesOwshitvobkeshyijuchepavbiejCefJubemrirjOnJeutyucHalHushbo\"\n    # the duration, a token will be valid for\n    # format is of the form 4m41s\n    time_to_live = \"1h\"\n\n    # [apiserver.tls]\n    # certificate = \"/path/to/cert.pem\"\n    # key = \"/path/to/key.pem\"\n    # ca_certificate = \"/path/to/ca_cert.pem\"\n\n[database]\n# Valid options are: mysql, sqlite3\nbackend = \"sqlite3\"\n\n    # [database.mysql]\n    # username = \"gopherbin\"\n    # # This obviously also needs to be changed :-)\n    # password = \"superSecretPassword\"\n    # hostname = \"192.168.100.10\"\n    # database = \"gopherbin\"\n\n    [database.sqlite3]\n    db_file = \"/tmp/gopherbin.sql\"\n```\n\n## First run\n\nSimply run the Gopherbin service. Gopherbin will create the database tables automatically:\n\n```bash\n/tmp/gopherbin -config /tmp/config.toml\n```\n\nBefore you can use Gopherbin, you need to create the super user. This user is the admin of the system, which can create new users and regular admins. Gopherbin will not allow anyone to log in if this user is missing. The super user can create regular administrators, that can in turn create regular users.\n\nAnyway, let's get to it:\n\n```bash\n# Make sure you change the password\n\ncurl -0 -X POST http://127.0.0.1:9997/api/v1/first-run/ \\\n\t-H \"Content-type: application-json\" \\\n\t--data-binary @- \u003c\u003c EOF\n\t{\n\t\t\"email\": \"example@example.com\",\n\t\t\"username\": \"john\",\n\t\t\"full_name\": \"John Doe\",\n\t\t\"password\": \"ubdyweercivIch\"\n\t}\nEOF\n```\n\nIf you're running on your local machine, you should be able to access Gopherbin at:\n\n```bash\nhttp://127.0.0.1:9997\n```\n\nOtherwise, use your own server's IP address.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabriel-samfira%2Fgopherbin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabriel-samfira%2Fgopherbin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabriel-samfira%2Fgopherbin/lists"}