Skip to content

AkashRajpurohit/time-to-go

Repository files navigation


Its go time

Time To Go!

Simplify and Supercharge Your Links!

Bug report Β· Feature request

Deployed via Cloudflare Workers Data storage via Workers KV Visitors count follow on twitter GitHub

Time to Go is a utility service built on top of Cloudflare Workers that allows you share Go URLs.

Read more about Go URLs by visiting this Go URL https://go.akashrajpurohit.com/b/go-urls

Motivation πŸ’ͺ

Have you ever wanted to share a long and complex URL with others, only to find it difficult to remember or share? Time to Go solves this problem by providing you with the ability to create short, personalized Go URLs that are easy to remember and share.

Whether you're sharing a link on social media or including it in a presentation, Time to Go simplifies the process and makes it more convenient for you and your audience.

Self Hosting Guide πŸ“–

To self-host Time to Go, follow these steps:

Prerequisites πŸƒπŸ»

  • Account with Cloudflare. Everything required for this is available on Free plan as well.
  • Node.js installed on your machine if you want to run it locally first.
  • PNPM - The package manager used.

KV Setup πŸ“¦

To store the URL data, Time to Go utilizes Cloudflare's Key-Value (KV) store. Follow these steps to set up KV:

  1. Create a KV namespace in your Cloudflare account.
  2. Note down the generated KV namespace ID.

We will use the UI for KV to add/update go-urls. Simple add a key (the short code) and value as the actual URL and click on "Add Entry"

Go ahead and take some time to add some GO URLs for yourself.

Environment Variables πŸ‘€

Before deploying Time to Go, make sure to set the following environment variables:

For Github Actions ⛏

All of the tokens mentioned in this section are required.

  • CF_API_TOKEN: Your Cloudflare API token. Create the API tokens from here
  • CF_ACCOUNT_ID: The ID of the Cloudflare zone where you want to deploy Time to Go.

For Cloudflare Worker πŸ‘·πŸΌβ€β™‚οΈ

  • NOT_FOUND_REDIRECT_URL - This would be the URL where you want to re-direct a user when there is no go-url configured for incoming request.

    If this is not set then the service will just return a 404 response.

  • REFERRER_TEXT - If set, this will get attached to the go-url as a ref key in the url.

    For example if REFERRER_TEXT=my-ref and the URL is https://example.com it will be redirected to https://example.com?ref=my-ref

Deployment πŸš€

To deploy Time to Go, follow these steps:

  1. Fork this repository to your own GitHub account.
  2. Add the environment variables for the forked repository from the Github Actions section.
  3. Clone the forked repository to your local machine.
  4. Navigate to the repository directory.
  5. Install the dependencies by running the command: pnpm install.
  6. Edit the wrangler.toml file and update the values for kv_namespaces with the KV id we created earlier for both id and preview_id.
  7. Update the vars section to add the environment variables from the Cloudflare worker section.
  8. Commit your changes and push them to your forked repository.
  9. GitHub Actions will automatically trigger the deployment process. Wait for the action to complete.

Congratulations! Time to Go is now deployed and ready to use.

Technology Stack πŸ’»

Bugs or Requests πŸ›

If you encounter any problems feel free to open an issue. If you feel the project is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull requests are also welcome.

Where to find me? πŸ‘€

Website Badge Twitter Badge Linkedin Badge Instagram Badge Telegram Badge