https://github.com/openai/go-alias
Service for quickly aliasing and redirecting to long URLs
https://github.com/openai/go-alias
Last synced: 5 months ago
JSON representation
Service for quickly aliasing and redirecting to long URLs
- Host: GitHub
- URL: https://github.com/openai/go-alias
- Owner: openai
- Archived: true
- Created: 2017-03-31T15:21:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-26T01:30:26.000Z (about 2 years ago)
- Last Synced: 2024-09-27T06:22:08.815Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 22
- Watchers: 168
- Forks: 21
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**Status:** Archive (code is provided as-is, no updates expected)
Use this service to quickly alias and redirect to long URLs
## Setup
### Server setup
Recommended to use Heroku to host the service if you don't care about security. Should take about 5 minutes to stand up. Otherwise you can put it on a Kubernetes cluster.
1. Create a Firebase project
1. Export Firebase creds on your [Firebase service account](https://console.developers.google.com/iam-admin/serviceaccounts/) as a json file
1. Create a new Heroku app and connect it to this git repo or your fork of it
1. Make json file's creds available as environment variables in your deployment environment (eg. through Heroku dashboard)
* `FIREBASE_PROJECT_ID`
* `FIREBASE_CLIENT_EMAIL`
* `FIREBASE_DATABASE_NAME`
* `FIREBASE_PRIVATE_KEY` which can have literal `\n` instead of actual newlines
1. Deploy!### Client setup
Add this site to your Chrome search engines by scrolling down until you see three empty boxes. Enter values go, go, and go.corp.mycompany.com/%s, respectively.### Advanced setup
To get the most benefit from the service, you should setup a DNS entry
on your local network, `go.corp.mycompany.com`. Make sure that
`corp.mycompany.com` is in the search domains for each user on the
network. This is usually easily accomplished by configuring your DHCP
server. Now, simply typing `go` into your browser should take you to
the service, where you can register shortcuts. Those
shortcuts will also be available by typing `go/shortcut`.On a mac, you can add the domain to your DNS search paths
```
networksetup -setsearchdomains Wi-Fi corp.example.com
```
However, this will require all bare names to hang instead of failing instantly, so you may wish to stick with the Chrome-only solution.## Use
When you type in the Chrome URL bar go<TAB> anything you type afterwards will bring you to that alias here.
You can then paste your link in the box and the next time you visit this alias, it will bring you straight to the site you pasted before.You can override any alias by visiting eg., #{path}/myalias/mynewsite.com
## Develop
Export your firebase credentials as appropriate environment variables. You'll need:
* `FIREBASE_PROJECT_ID`
* `FIREBASE_CLIENT_EMAIL`
* `FIREBASE_DATABASE_NAME`
* `FIREBASE_PRIVATE_KEY` which can have literal `\n` instead of actual newlines```
npm install
npm install -g devtool
npm run dev
```Visit http://localhost:3000/myalias
## Test in docker
```
make run
```## Deploy
```
kubectl apply -f kube/api-deployment.yaml
kubectl apply -f kube/api-svc.yaml
```