Skip to content
/ vanityURLs Public template
forked from vanityURLs/vanityURLs

Shorten, personalize, and share fully branded short URLs with continuous integration on Cloudflare

License

Notifications You must be signed in to change notification settings

felleg/vanityURLs

 
 

Repository files navigation

logo

GitHub license Contributor Covenant All Contributors

vanityURLs is a simple solution to deploy a budget-friendly Url Shortener. It runs at scale in your Cloudflare subscription with continuous integration.

If you don't own an a Cloudflare subscription already, you can create your free account today so you can experience everything without spending a dime.

Features:

  • Fully branded internet domain using Cloudflare's DNS & Pages so your links are compact and pretty
  • URL redirection (301, 302, 303, 307 and 308)
  • Advanced redirection with splats (e.g., /news/* → /blog/:splat )
  • Continuous integration managed by Cloudflare Page Engine

My objective is to work at the command line and automate it. So feel free to fork, and customize.

What problem does it solve and why is it useful?

You’ve been there too, a fully branded short URLs is useful but your low volume does not justify a commercial solution. Furthermore, links generated by a free solution will eventually expire and they're not privacy friendly.

This kind of solution is known as TinyURL, tiny url, shorten that long URL, URL Shortening Service, goo.gl, bit.ly, short.io, etc.

It's bullet proof

As long as you secure your Github and Cloudflare accounts with robust authentication, there is not much that can go wrong with such simple solution. It use the products as designed, there is no hack involved.

Refer to how does it work for more information.

Installation

  1. Register a tiny internet domain name with your preferred vendor
  2. Add the domain to Cloudflare DNS
  3. Fork the repository, you just need the main branch
  4. Create a project underneath Cloudflare Workers & Pages
  5. Configure the DNS entry via Cloudflare DNS
  6. Open the defined DNS entry in your browser, you should be redirected to https://BHDicaire.com based on the current configuration
  7. Update the header configuration
    • Change https://xyz.pages.dev/* → to your cloudflare's specfic page URL
    • Change https://example.com/* → to your tiny internet domain name
  8. Update the redirection list
  9. Add and commit the change to the github repository
    • Cloudflare will detect the change and initiate a deployment

Administration

You can use the following Bash scripts, if this is your cup of tea. Refer to the documentation.

Name Description
bin/lnk Generate a custom ID for a new URL, git add + commit
bin/tinylnk Generate a unique ID for a new URL, git add + commit

Contributions

Contributions are welcome! We recognize all types based on the all-contributors specification. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Benoît H. Dicaire
Benoît H. Dicaire

💻 📖 🛡️
Félix Léger
Félix Léger

🤔 📓 📣

Related

  • dnsConfiguration – Automated DNS configuration with StackOverflow's DNSControl and Git

Licence

vanityURLs is Copyright 2023 Benoît H. Dicaire and licensed under the MIT licence.

About

Shorten, personalize, and share fully branded short URLs with continuous integration on Cloudflare

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 61.9%
  • Makefile 38.1%