All Projects → AxisCommunications → goalie-url-shortener

AxisCommunications / goalie-url-shortener

Licence: MIT license
An implementation of go/ vanity-urls with LDAP support that makes it simple to access internal web assets on a coorporate network.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
CSS
56736 projects
Dockerfile
14818 projects
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to goalie-url-shortener

redir
🧭 Full-featured, self-hosted URL shortener.
Stars: ✭ 61 (+281.25%)
Mutual labels:  url-shortener, vanity-url
react-demo
一个实际项目(OA系统)中的部分功能。这个demo中引入了数据库,数据库使用了mongodb。安装mongodb才能运行完整的功能
Stars: ✭ 92 (+475%)
Mutual labels:  react-redux
caddy-security
🔐 Authentication, Authorization, and Accounting (AAA) App and Plugin for Caddy v2. 💎 Implements Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication. MFA/2FA with App Authenticators and Yubico. 💎 Authorization with JWT/PASETO tokens. 🔐
Stars: ✭ 696 (+4250%)
Mutual labels:  ldap
ShortURL-Services-List
A list of 600+ URL shorteners (i.e goo.gl, bit.ly)
Stars: ✭ 32 (+100%)
Mutual labels:  url-shortener
pyreports
pyreports is a python library that allows you to create complex report from various sources
Stars: ✭ 78 (+387.5%)
Mutual labels:  ldap
redap
HTTP-to-LDAP Gateway
Stars: ✭ 27 (+68.75%)
Mutual labels:  ldap
Recon
HA LDAP based key/value solution for projects configuration storing with multi master replication support
Stars: ✭ 12 (-25%)
Mutual labels:  ldap
iwish
I wish that too!
Stars: ✭ 19 (+18.75%)
Mutual labels:  react-redux
person-directory
A framework for resolving persons and attributes from a variety of underlying sources.
Stars: ✭ 26 (+62.5%)
Mutual labels:  ldap
1pt
A URL shortener with protection against malicious redirects
Stars: ✭ 20 (+25%)
Mutual labels:  url-shortener
wg-portal
WireGuard Configuration Portal with LDAP connection
Stars: ✭ 476 (+2875%)
Mutual labels:  ldap
pagemaker production
🐎 前端页面制作工具
Stars: ✭ 50 (+212.5%)
Mutual labels:  react-redux
react-antd-admin
react-antd-admin 是一个后台集成解决方案,它基于 react 和 antd; 内置了动态路由,标签页缓存,权限验证、切换功能
Stars: ✭ 42 (+162.5%)
Mutual labels:  react-redux
best-of-react
🏆 A ranked list of awesome React open-source libraries and tools. Updated weekly.
Stars: ✭ 364 (+2175%)
Mutual labels:  react-redux
DLReactNativeArchitecture
React Native Architecture
Stars: ✭ 18 (+12.5%)
Mutual labels:  react-redux
react-you-do-you
How I use React + Redux + Material-UI + TypeScript – you do you 💖
Stars: ✭ 103 (+543.75%)
Mutual labels:  react-redux
node-casperjs-aws-lambda
Base scaffolding app for a casperjs/phantomjs app running on Amazon (AWS) Lambda
Stars: ✭ 52 (+225%)
Mutual labels:  react-redux
osprey
Kubernetes OIDC CLI login
Stars: ✭ 49 (+206.25%)
Mutual labels:  ldap
bingus.link
A free, private URL shortener
Stars: ✭ 19 (+18.75%)
Mutual labels:  url-shortener
django-windowsauth
Easy integration and deployment of Django projects into Windows Environments
Stars: ✭ 23 (+43.75%)
Mutual labels:  ldap

Goalie - A go/ Short-Link Service Implementation

This is an implementation of go/ links which makes it simple to access internal web assets and share them on a corporate network.

Demo Animation

Goalie was initially developed by Anton Friberg together with Oscar Svensson, who are both part time student employees at Axis Communications. The backend is written in Python, using a Flask framework called Eve, and stores the shortcuts in a mongoDB database. The frontend utilizes React.js and Redux to make it easy to edit shortcuts. The entire application is deployed using Docker.

Table of Contents

Background

go/ links is a service that is believed to have originated at Google according to this blog post and this GitHub repository. The idea is that people on the corporate network can easily navigate between internal services by directing their browser to http://go/service-name.

For example, if we want to be redirected towards information of our internal git repo we visit http://go/git.

These days it is common to see similar services at many large IT companies.

Notable Features

  • Easily create and modify shortcuts for web URLs.
  • LDAP/AD authentication.
  • Immediate availability of shortcuts to all employees.
  • Shortcuts are viewable and searchable by all employees.
  • Only an administrator or the owner of the shortcut is able to modify or delete it.

As we have been using this service it has proven to be useful on multiple occasions, for example:

  • To avoid having to remember complicated URLs to things such as team meeting slides, documentation pages, important resources and internal services.
  • Making it easier to share scattered web resources with new colleagues.
  • As a searchable index of available internal web resources.
  • As a DNS service for testing environments.
  • Sending vanity URLs, instead of complex and hard-to-read URLs, will allow the receiver to more quickly grasp what service or resource the URL provides.

Advanced Features

It may not be apparent at first glance, but the pattern field for a new shortcut actually accepts a regex value. This provides the service with many additional features. We will provide a brief overview by presenting some examples.

Single Target for Multiple Patterns

This allows both go/git and go/gerrit to direct the user to the internal git resource without the need for multiple shortcut entries.

Pattern Target
(git|gerrit) https://git.example.com

Match Multiple Forms of Spelling

This pattern matches color-code-search, colour-code-search, color-code and colour-code.

Pattern Target
colou?r-code(-search)? https://color.example.com

Capture Groups Inserted Into Target

This example in particular is very interesting. The first entry allow users to enter go/git/search_string, in the web browser, which then redirects to a search for search_string on the internal git website. However, the second entry allow them to enter go/git/303492/1, which then points to the first patch set of the git commit with the ID 303492.

Pattern Target
git/(.+) https://git.example.com/q/\1
git/(\d+)(/\d+)? https://git.example.com/q/\1\2

Wildcards

Some readers probably realize that these regex features are easy to abuse. On inserts we only check for uniqueness, i.e. that the pattern is not already used by another shortcut. We do actually allow wildcard patterns like this:

Pattern Target
(.+) https://www.google.com/search?q=\1

This would potentially clash with all other shortcuts, and to handle cases such as this we rank shortcuts and try to find the most specific one to redirect the visitor towards.

Ranking

If multiple patterns match the incoming URL string the most specific pattern that matches should be returned. Currently this ranking looks like the following, taking the acronym atf as an example:

Rank Target
1. atf
2. (atf)
3. at\w
4. at.
5. at.?
6. at[a-z]
7. (a|atf|a-test-framework)
8. (atf)(.*)
9. at.+
10. .+
11. .*

This ranking might not be perfect since at[a-z] (at number 6) is probably considered more specific than at. by many users.

Setup

Initial Setup

Before initial setup you must create a file called jwt_secret in a directory called .secrets at the root of the project files. This will contain a 32 byte long random string that is used for token signing. Keep this file secret.

$ mkdir .secrets
$ openssl rand -base64 32 > .secrets/jwt_secret
$ cat .secrets/jwt_secret
Pnpz+WN1fNBv8jFgQ4vFiXECAb+6aASG6Zv7bGrEdIg=

If you have a need to add your own CA certificate for the LDAP endpoint you can do it by placing the CA certificate in a file called ldap_ca_crt in the .secrets folder. You may then simply uncomment the relevant lines in the docker-compose.yml file.

In order to login to the service you need to configure your LDAP connection. This is done in the .env file. Here you can also configure the host mount for the database files and other configurations.

With all configurations in place you may simply start the application with docker-compose.

$ docker-compose up -d --build

Development Environment

During development you may wish to have the application auto-reload changes, which is possible by starting the application using the development compose file.

$ docker-compose -f docker-compose.dev.yml up --build

Python Development

Recommended Python development environment is to utilize a virtual Python environment separate from the system (i.e. pyenv, virtualenv, etc.) with linting provided by PyLint and automatic code formatting by utilizing Black.

Name Version
Python 3.6
PyLint 2.3.1
Black 19.3

Javascript Development

Recommended Javascript development is to have linting provided with ESLint (with React, Airbnb and Prettier plugins) and formatting by Prettier. The recommended package manager is Yarn.

Name Version
Yarn 1.15
ESLint 4.19
Prettier 1.13

Production Hardening

If you wish to deploy the application to production it is recommended to look at the nginx production configuration file, which enables SSL encryption among other things. The file needs to be configured for your own host and domain. Either replace the existing nginx.conf file or change the Dockerfile reference.

You place the key and certificate in files named go_https_key and go_https_crt in the .secrets folder. Then you can simply uncomment the relevant secrets in the docker-compose file.

Troubleshooting

If you encounter any problems during setup or development please create an issue and we will try to answer as soon as possible.

Contributors & Maintainers

Maintainers

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].