{"id":28995104,"url":"https://github.com/axiscommunications/goalie-url-shortener","last_synced_at":"2025-07-07T05:02:51.339Z","repository":{"id":33811593,"uuid":"154312929","full_name":"AxisCommunications/goalie-url-shortener","owner":"AxisCommunications","description":"An implementation of go/ vanity-urls with LDAP support that makes it simple to access internal web assets on a coorporate network.","archived":true,"fork":false,"pushed_at":"2023-03-15T06:49:34.000Z","size":4795,"stargazers_count":20,"open_issues_count":13,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-25T04:06:35.356Z","etag":null,"topics":["docker","hacktoberfest","javascript","ldap","mongodb","nginx","python","react-redux","url-shortener","vanity-url"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/AxisCommunications.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-23T11:02:11.000Z","updated_at":"2025-03-13T13:13:18.000Z","dependencies_parsed_at":"2025-06-25T04:06:37.947Z","dependency_job_id":"13c76b11-a590-4fb3-8ad4-1bd819fa3b0e","html_url":"https://github.com/AxisCommunications/goalie-url-shortener","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AxisCommunications/goalie-url-shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxisCommunications%2Fgoalie-url-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxisCommunications%2Fgoalie-url-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxisCommunications%2Fgoalie-url-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxisCommunications%2Fgoalie-url-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AxisCommunications","download_url":"https://codeload.github.com/AxisCommunications/goalie-url-shortener/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxisCommunications%2Fgoalie-url-shortener/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264016713,"owners_count":23544623,"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":["docker","hacktoberfest","javascript","ldap","mongodb","nginx","python","react-redux","url-shortener","vanity-url"],"created_at":"2025-06-25T04:06:32.696Z","updated_at":"2025-07-07T05:02:51.316Z","avatar_url":"https://github.com/AxisCommunications.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Goalie - A _go/_ Short-Link Service Implementation\n===============================================\n\nThis is an implementation of _go/_ links which makes it simple to access\ninternal web assets and share them on a corporate network.\n\n![Demo Animation](../assets/images/demo.gif?raw=true)\n\nGoalie was initially developed by Anton Friberg together with Oscar Svensson,\nwho are both part time student employees at [Axis Communications]. The backend\nis written in [Python], using a [Flask] framework called [Eve], and stores the\nshortcuts in a [mongoDB] database. The frontend utilizes [React.js] and [Redux]\nto make it easy to edit shortcuts. The entire application is deployed using\n[Docker].\n\n[Axis Communications]: https://www.axis.com\n[python]: https://github.com/python\n[flask]: https://github.com/pallets/flask\n[eve]: https://github.com/pyeve/eve\n[mongodb]: https://github.com/mongodb/mongo\n[react.js]: https://github.com/facebook/react\n[redux]: https://github.com/reduxjs/redux\n[docker]: https://github.com/docker/docker-ce\n\nTable of Contents\n=================\n\n   * [Goalie](#goalie---a-go-short-link-service-implementation)\n   * [Table of Contents](#table-of-contents)\n   * [Background](#background)\n   * [Notable Features](#notable-features)\n   * [Advanced Features](#advanced-features)\n      * [Single Target for Multiple Patterns](#single-target-for-multiple-patterns)\n      * [Match Multiple Forms of Spelling](#match-multiple-forms-of-spelling)\n      * [Capture Groups Inserted Into Target](#capture-groups-inserted-into-target)\n      * [Wildcards](#wildcards)\n      * [Ranking](#ranking)\n   * [Setup](#setup)\n      * [Initial Setup](#initial-setup)\n      * [Development Environment](#development-environment)\n      * [Production Hardening](#production-hardening)\n   * [Troubleshooting](#troubleshooting)\n   * [Contributors \u0026 Maintainers](#contributors--maintainers)\n      * [Maintainers](#maintainers)\n      * [Contributors](#contributors)\n\n\nBackground\n==========\n\n_go/_ links is a service that is believed to have originated at Google according\nto [this blog post] and [this GitHub repository]. The idea is that people on the\ncorporate network can easily navigate between internal services by directing\ntheir browser to http://go/service-name.\n\nFor example, if we want to be redirected towards information of our internal git\nrepo we visit http://go/git.\n\nThese days it is common to see similar services at many large IT companies.\n\n[this blog post]: http://blog.goatcodes.com/2018/04/18/go-origin\n[this GitHub repository]: https://github.com/kellegous/go\n\nNotable Features\n================\n\n- Easily create and modify shortcuts for web URLs.\n- LDAP/AD authentication.\n- Immediate availability of shortcuts to all employees.\n- Shortcuts are viewable and searchable by all employees.\n- Only an administrator or the owner of the shortcut is able to modify or\n  delete it.\n\nAs we have been using this service it has proven to be useful on multiple\noccasions, for example:\n\n- To avoid having to remember complicated URLs to things such as team meeting\n  slides, documentation pages, important resources and internal services.\n- Making it easier to share scattered web resources with new colleagues.\n- As a searchable index of available internal web resources.\n- As a DNS service for testing environments.\n- Sending vanity URLs, instead of complex and hard-to-read URLs, will allow the\n  receiver to more quickly grasp what service or resource the URL provides.\n\nAdvanced Features\n=================\n\nIt may not be apparent at first glance, but the pattern field for a new shortcut\nactually accepts a regex value. This provides the service with many additional\nfeatures. We will provide a brief overview by presenting some examples.\n\nSingle Target for Multiple Patterns\n-----------------------------------\n\nThis allows both `go/git` and `go/gerrit` to direct the user to the internal\ngit resource without the need for multiple shortcut entries.\n\n| Pattern        | Target                  |\n|----------------|-------------------------|\n| `(git\\|gerrit)`| https://git.example.com |\n\nMatch Multiple Forms of Spelling\n--------------------------------\n\nThis pattern matches `color-code-search`, `colour-code-search`, `color-code`\nand `colour-code`.\n\n| Pattern                  | Target                    |\n|--------------------------|---------------------------|\n| `colou?r-code(-search)?` | https://color.example.com |\n\nCapture Groups Inserted Into Target\n-----------------------------------\n\nThis example in particular is very interesting. The first entry allow users to\nenter `go/git/search_string`, in the web browser, which then redirects to a\nsearch for `search_string` on the internal git website. However, the second\nentry allow them to enter `go/git/303492/1`, which then points to the first\npatch set of the git commit with the ID `303492`.\n\n| Pattern            | Target                         |\n|--------------------|--------------------------------|\n| `git/(.+)`         | https://git.example.com/q/\\1   |\n| `git/(\\d+)(/\\d+)?` | https://git.example.com/q/\\1\\2 |\n\nWildcards\n---------\n\nSome readers probably realize that these regex features are easy to abuse. On\ninserts we only check for uniqueness, i.e. that the pattern is not already used\nby another shortcut. We *do* actually allow wildcard patterns like this:\n\n| Pattern | Target                             |\n|:--------|:-----------------------------------|\n| `(.+)`  | https://www.google.com/search?q=\\1 |\n\nThis would potentially clash with all other shortcuts, and to handle cases such\nas this we rank shortcuts and try to find the most specific one to redirect\nthe visitor towards.\n\nRanking\n-------\n\nIf multiple patterns match the incoming URL string the most specific pattern\nthat matches should be returned. Currently this ranking looks like the\nfollowing, taking the acronym `atf` as an example:\n\n| Rank | Target                       |\n|------|------------------------------|\n| 1.   | `atf`                        |\n| 2.   | `(atf)`                      |\n| 3.   | `at\\w`                       |\n| 4.   | `at.`                        |\n| 5.   | `at.?`                       |\n| 6.   | `at[a-z]`                    |\n| 7.   | `(a\\|atf\\|a-test-framework)` |\n| 8.   | `(atf)(.*)`                  |\n| 9.   | `at.+`                       |\n| 10.  | `.+`                         |\n| 11.  | `.*`                         |\n\nThis ranking might not be perfect since `at[a-z]` (at number 6) is probably\nconsidered more specific than `at.` by many users.\n\nSetup\n=====\n\nInitial Setup\n-------------\n\nBefore initial setup you must create a file called `jwt_secret` in a directory\ncalled `.secrets` at the root of the project files. This will contain a 32 byte\nlong random string that is used for token signing. Keep this file secret.\n\n```\n$ mkdir .secrets\n$ openssl rand -base64 32 \u003e .secrets/jwt_secret\n$ cat .secrets/jwt_secret\nPnpz+WN1fNBv8jFgQ4vFiXECAb+6aASG6Zv7bGrEdIg=\n```\n\nIf you have a need to add your own CA certificate for the LDAP endpoint you can\ndo it by placing the CA certificate in a file called `ldap_ca_crt` in the\n`.secrets` folder. You may then simply uncomment the relevant lines in the\n[docker-compose.yml](docker-compose.yml) file.\n\nIn order to login to the service you need to configure your LDAP connection.\nThis is done in the [.env](.env) file. Here you can also configure the host\nmount for the database files and other configurations.\n\nWith all configurations in place you may simply start the application with\n`docker-compose`.\n\n```\n$ docker-compose up -d --build\n```\n\nDevelopment Environment\n-----------------------\n\nDuring development you may wish to have the application auto-reload changes,\nwhich is possible by starting the application using the development compose\n[file](docker-compose.dev.yml).\n\n```\n$ docker-compose -f docker-compose.dev.yml up --build\n```\n\n### Python Development\n\nRecommended Python development environment is to utilize a virtual Python\nenvironment separate from the system (i.e. pyenv, virtualenv, etc.) with linting\nprovided by PyLint and automatic code formatting by utilizing Black.\n\n| Name          | Version       |\n| ------------- |:-------------:|\n| [Python]      | `3.6`         |\n| [PyLint]      | `2.3.1`       |\n| [Black]       | `19.3`        |\n\n[Python]: https://docs.python.org/3.6/\n[PyLint]: https://www.pylint.org/\n[Black]: https://github.com/ambv/black\n\n### Javascript Development\n\nRecommended Javascript development is to have linting provided with ESLint (with\nReact, Airbnb and Prettier plugins) and formatting by Prettier. The recommended\npackage manager is Yarn.\n\n| Name          | Version       |\n| ------------- |:-------------:|\n| [Yarn]        | `1.15`        |\n| [ESLint]      | `4.19`        |\n| [Prettier]    | `1.13`        |\n\n[Yarn]: https://yarnpkg.com/\n[ESLint]: https://eslint.org/\n[Prettier]: https://prettier.io/\n\nProduction Hardening\n--------------------\n\nIf you wish to deploy the application to production it is recommended to look at\nthe [nginx production configuration file](frontend/nginx/nginx.production.conf),\nwhich enables SSL encryption among other things. The file needs to be configured\nfor your own host and domain. Either replace the existing\n[nginx.conf](frontend/nginx/nginx.production.conf) file or change the\n[Dockerfile](frontend/Dockerfile) reference.\n\nYou place the key and certificate in files named `go_https_key` and\n`go_https_crt` in the `.secrets` folder. Then you can simply uncomment the\nrelevant secrets in the [docker-compose](docker-compose.yml) file.\n\nTroubleshooting\n===============\n\nIf you encounter any problems during setup or development please create an\nissue and we will try to answer as soon as possible.\n\nContributors \u0026 Maintainers\n==========================\n\nMaintainers\n-----------\n\n- [Anton Friberg]\n\nContributors\n------------\n\n- [Anton Friberg]\n- [Oscar Svensson]\n\n[Anton Friberg]: https://github.com/AntonFriberg\n[Oscar Svensson]: https://github.com/wogscpar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxiscommunications%2Fgoalie-url-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxiscommunications%2Fgoalie-url-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxiscommunications%2Fgoalie-url-shortener/lists"}