{"id":16399278,"url":"https://github.com/alexbrazier/go-url","last_synced_at":"2025-07-08T05:38:42.968Z","repository":{"id":39273267,"uuid":"160101888","full_name":"alexbrazier/go-url","owner":"alexbrazier","description":"Url Shortener for use inside organisation","archived":false,"fork":false,"pushed_at":"2023-03-01T10:01:03.000Z","size":3005,"stargazers_count":31,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T20:01:46.936Z","etag":null,"topics":["azure-active-directory","golang","hacktoberfest","opensearch","react","url-shortener"],"latest_commit_sha":null,"homepage":"https://alexbrazier.github.io/go-url/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexbrazier.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-02T22:18:14.000Z","updated_at":"2024-08-08T11:22:58.000Z","dependencies_parsed_at":"2024-06-19T03:03:54.001Z","dependency_job_id":"a071ab28-e78e-4ef6-982e-4d7c260467b2","html_url":"https://github.com/alexbrazier/go-url","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexbrazier%2Fgo-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexbrazier%2Fgo-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexbrazier%2Fgo-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexbrazier%2Fgo-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexbrazier","download_url":"https://codeload.github.com/alexbrazier/go-url/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244725666,"owners_count":20499644,"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":["azure-active-directory","golang","hacktoberfest","opensearch","react","url-shortener"],"created_at":"2024-10-11T05:23:35.274Z","updated_at":"2025-03-21T02:32:45.872Z","avatar_url":"https://github.com/alexbrazier.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go URL\n\n[![CircleCI](https://circleci.com/gh/alexbrazier/go-url.svg?style=svg)](https://circleci.com/gh/alexbrazier/go-url)\n[![Cypress Dashboard](https://img.shields.io/badge/cypress-dashboard-brightgreen.svg)](https://dashboard.cypress.io/#/projects/7dct13/runs)\n[![dependencies](https://img.shields.io/david/alexbrazier/go-url.svg?path=frontend)](https://david-dm.org/alexbrazier/go-url?path=frontend)\n\nA simple URL shortener written in Go with a React frontend and Postgres database.\n\n# Features\n\n- Shorten urls based on a user defined key\n- Alias a key to point to another short url\n- Open multiple pages at once by separating keys with a comma\n- Alias a key to point to multiple other keys\n- Use variables in URLs\n- Opensearch integration to provide suggestions directly to browser\n- Frontend to view most popular searches and search to find existing links\n- Frontend to allow anyone to add and edit links\n- Optional authentication using Azure AD or Okta\n- Slack `/` command integration\n- Slackbot integration\n\n![Demo](.github/go-demo.gif)\n\n# Getting Started\n\nThe recommended way to test and deploy is using Docker. You will need to run both the go-url app, and the Postgres DB.\n\n**Start Postgres**\n\n```sh\ndocker run -d -P --name db -e POSTGRES_PASSWORD=password -e POSTGRES_DB=go -e POSTGRES_ADDR=db:5432 postgres:11.3-alpine\n```\n\n**Start App**\n\n```sh\ndocker run -p 1323:1323 -e HOSTS=localhost -e APP_URI=http://localhost:1323 --link db alexbrazier/go-url\n```\n\nAlteratively use the docker-compose file and run:\n\n```sh\ndocker-compose up\n```\n\n## Development\n\nOpen http://localhost:8080/go\n\nRun Postgres manually or with Docker\n\n```sh\ndocker-compose up postgres\n```\n\nInstall node (via nvm), yarn \u0026 go\n\n```sh\nbrew install nvm yarn go\nnvm install\n```\n\n### Start frontend\n\n```sh\ncd frontend\nyarn\nyarn start\n```\n\n### Start API\n\n```sh\ncd api\ndep ensure\nPOSTGRES_PASS=password HOSTS=localhost APP_URI=http://localhost:3000 go run server.go\n```\n\n## Enviroment Configuration\n\n| Env Var                     | Required | Default        | Example                                        | Description                                                                                            |\n| --------------------------- | -------- | -------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------ |\n| `HOSTS`                     | yes      |                | go.domain.com,go2.domain.com                   | List of comma separated hosts that the server will be able to be accessed from                         |\n| `BLOCKED_HOSTS`             |          |                | go.domain.com,go2.domain.com                   | List of hosts you want to block from being linked - HOSTS are already included to stop recursive calls |\n| `APP_URI`                   | yes      |                | https://go.domain.com                          | Default URI of app - used to link back to app                                                          |\n| `PORT`                      |          | 1323           |                                                | Port the app will run on                                                                               |\n| `DEBUG`                     |          | false          |                                                | Enable more logging                                                                                    |\n| `JSON_LOGS`                 |          | false          |                                                | Use JSON logs where possible                                                                           |\n| `POSTGRES_ADDR`             |          | localhost:5432 |                                                | Postgres db address                                                                                    |\n| `POSTGRES_DATABASE`         |          | go             |                                                | Postgres db name                                                                                       |\n| `POSTGRES_USER`             |          | postgres       |                                                | Postgres user                                                                                          |\n| `POSTGRES_PASS`             |          | password       |                                                | Postgres password                                                                                      |\n| `SLACK_TOKEN`               |          |                | xoxb-xxxxxxxxx-xxxxxxxx-xxxx                   | Slack OAuth token to enable slackbot                                                                   |\n| `SENTRY_API_DSN`            |          |                |                                                | Sentry DSN for go API                                                                                  |\n| `SENTRY_FRONTEND_DSN`       |          |                |                                                | Sentry DSN for react frontend                                                                          |\n| `SLACK_SIGNING_SECRET`      |          |                | xxxxxxxxxxx                                    | Slack signing secret to enable Slack `/go` command                                                     |\n| `SLACK_TEAM_ID`             |          |                | Txxxxxxxx                                      | Slack team id to restrict slash command responses to single team                                       |\n| `ENABLE_AUTH`               |          | false          |                                                | Enable Azure auth or not - if enabled, all other fields must be filled in                              |\n| `AUTH_EXPIRY_SECONDS`       |          | 2592000        |                                                | Auth cookie expiry (default 30 days)                                                                   |\n| `SECURE_COOKIES`            |          | true           |                                                | Use secure https only cookies                                                                          |\n| `AD_TENANT_ID`              |          |                |                                                | Azure AD tenant ID                                                                                     |\n| `AD_CLIENT_ID`              |          |                |                                                | Azure AD client ID                                                                                     |\n| `AD_CLIENT_SECRET`          |          |                |                                                | Azure AD client secret                                                                                 |\n| `OKTA_CLIENT_ID`            |          |                |                                                | Okta client ID                                                                                         |\n| `OKTA_CLIENT_SECRET`        |          |                |                                                | Okta client secret                                                                                     |\n| `OKTA_ISSUER`               |          |                | https://dev-123.oktapreview.com/oauth2/default | Okta issuer url                                                                                        |\n| `SESSION_TOKEN`             |          |                |                                                | Secret session token to store the user sessions                                                        |\n| `ALLOWED_IPS`               |          |                | 110.1.10.2,1.1.22.0/24                         | IP addresses or CIDRs that are always allowed access, even with auth enabled                           |\n| `ALLOW_FORWARDED_FOR`       |          | false          |                                                | Retrieve origin IP from X-Forwarded-For header. Only enable if source is trusted, e.g. via Cloudfront  |\n| `FORWARDED_FOR_TRUST_LEVEL` |          | 1              |                                                | Number of levels to trust X-Forwarded-For header - should map to number of proxies used                |\n\n## FAQ\n\n#### Slackbot is posting multiple replies messages to a single message\n\nWhen enabled, the Slackbot will be running on every node in a load balanced system. Either disable load balancing, or run a separate instance just for the Slackbot.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexbrazier%2Fgo-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexbrazier%2Fgo-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexbrazier%2Fgo-url/lists"}