GithubHelp home page GithubHelp logo

classicvalues / go-alias Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openai/go-alias

0.0 1.0 0.0 12 KB

Service for quickly aliasing and redirecting to long URLs

Home Page: https://gonode-demo.herokuapp.com

JavaScript 57.83% CSS 1.15% HTML 36.57% Makefile 1.98% Dockerfile 2.48%

go-alias's Introduction

Status: Archive (code is provided as-is, no updates expected)

Use this service to quickly alias and redirect to long URLs (demo)

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
  2. Export Firebase creds on your Firebase service account as a json file
  3. Create a new Heroku app and connect it to this git repo or your fork of it
  4. 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
  5. 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

go-alias's People

Contributors

christopherhesse avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.