High-Performance Shortlink ( Short URL ) app creator in Golang. For privacy reasons, you may prefer to host your own short URL app and this is the one to use.

About The Project

Shortlink App in Golang

  • Multiple Node based Architecture to create and scale at ease
  • Highly performant key-value storage system
  • Centralized Storage option when multiple node created - requires tweaking.
  • API auth system not built. Left for using it for your own use case like JWT or paseto. Self Implement.

Please see the architecture file in the repository on option you can use the app. For some minor tweaking may be required.

Built With

List of Library and Framework used in building the app:

Getting Started

Just download and run go run main.go and you are ready to go. To deploy to server, prefer DigitalOcean

Steps

Common Steps to Launch:

go mod tidy
go mod vendor
go run main.go OR go build -ldflags "-s -w" main.go && ./main

Must Changeable Variables in constant.go:

Production      = 2 // Please set to 1 if in production.
Domain          = "https://lin.ks/"
CookieName      = "lin.ks"
NodeID          = "N1|" // Increase per node by value as "N2|", "N3|"... for multiple node
DBFolder        = "/home/ubuntu/go/src/shortlink/db/"
AddFromToken    = 3 // firt N character to get from token and use it in ShortID
ShortIDToken    = 7 // Further added from 1st N char of AddFromToken+NodeID: total=12
APITokenLength  = 32
Click here to see Rest API Example:
  1. Short URL redirector: /:short_code_here
  2. API Routes:
  • /api/create [Post]
Takes `{"url": "https://github.com"}` with `Authorization: Bearer {token}` from Header
  • /api/update [Post]
Takes `{"old": "https://github.com", "new": "https://bitbucket.com", "short": "shortcode"}` with `Authorization: Bearer {token}` from Header
  • /api/delete [Post]
Takes `{ "long": "https://bitbucket.com", "short": "shortcode"}` with `Authorization: Bearer {token}` from Header
  • /api/fetch [GET]
 Takes `Authorization: Bearer {token}` from Header
  • /api/fetch/:short_code_here [GET]
 {short_code_here} in the URL and Takes `Authorization: Bearer {token}` from Header

Note: Remember to implement Auth system of your own and Replace APITokenLength check with your own function.

Please see the rest.http file to understand the request type in live details.

Feature request?

Share your feature request via issue tracker.

Feel like helping out:

  • Via Code Contribution (if any / new feature)
  • BTC: 1Hp24RtL3o86boapSAD3DtyqF5jdq1rfpM
  • Star the repository and watch out for new updates and features.

Do not Forget [ Shortlink App Plan ]

Following Use cases:

  • Self-Hosted URL tracking.
  • Your URL tracking insights is in-house and not hosted or shared with third party.

License

Distributed under the Apache License 2.0. See LICENSE for more information.

Similar Resources

Curl & exec binary file in one step. Also a kind of stealth dropper.

Curl & exec binary file in one step. Also a kind of stealth dropper.

curlNexec 👋 Certainly useful , mainly for fun, rougly inspired by 0x00 article Short story curlNexec enable us to execute a remote binary on a local

Jan 2, 2023

One Time Passwords (OTPs) are an mechanism to improve security over passwords alone.

otp: One Time Password utilities Go / Golang Why One Time Passwords? One Time Passwords (OTPs) are an mechanism to improve security over passwords alo

Jan 7, 2023

Serpscan is a powerfull php script designed to allow you to leverage the power of dorking straight from the comfort of your command line.

Serpscan is a powerfull php script designed to allow you to leverage the power of dorking straight from the comfort of your command line.

SerpScan Serpscan is a powerful PHP tool designed to allow you to leverage the power of dorking straight from the comfort of your command line. Table

Nov 11, 2022

Secretsmanager - Secrets management that allows you to store your secrets encrypted in git

I created secretsmanager to store some secrets within a repository. The secrets are encrypted at rest, with readable keys and editable JSON, so you can rename a key or delete it by hand. The cli tool handles the bare minumum of requirements.

May 6, 2022

Ah shhgit! Find secrets in your code. Secrets detection for your GitHub, GitLab and Bitbucket repositories: www.shhgit.com

Ah shhgit! Find secrets in your code. Secrets detection for your GitHub, GitLab and Bitbucket repositories: www.shhgit.com

shhgit helps secure forward-thinking development, operations, and security teams by finding secrets across their code before it leads to a security br

Dec 23, 2022

Encrypt your files or notes by your GPG key and save to MinIO or Amazon S3 easily!

Encrypt your files or notes by your GPG key and save to MinIO or Amazon S3 easily!

Super Dollop Super Dollop can encrypt your files and notes by your own GPG key and save them in S3 or minIO to keep them safe and portability, also yo

Jul 11, 2022

A scalable overlay networking tool with a focus on performance, simplicity and security

What is Nebula? Nebula is a scalable overlay networking tool with a focus on performance, simplicity and security. It lets you seamlessly connect comp

Dec 29, 2022

Utility to safely fetch Java class files being served by LDAP servers. Includes deobfuscator for common Log4J URL obfuscation techniques

ldap-get Utility to safely fetch Java class files being served by LDAP servers,

Nov 9, 2022
Comments
  • fix rest.http file

    fix rest.http file

    There is no need for " of Authorization in rest.http file. Although it can work now, just because your " is counted as a character.

    This may lead misunderstanding to new users,so I fix it.

  • BUG: write database del key, but read database didn't

    BUG: write database del key, but read database didn't

    if I del a shortlink use this post request,

    {
      "long": "https://google.com",
      "short": "http://127.0.0.1/N1|12asdf1"
    }
    

    Absolutely it's a wrong use of this delete API, but it will return the response:

    {
      "error": false,
      "message": "Successfully deleted",
    }
    

    When I try to use the shortlink again, it redirect successly. So we didn't remove the short code in pogreb database.

    If you try to delete the shortcode use the right request again, it will go to fail. Because the longurl has already been deleted.

    The shortlink can be used all the time.

    I think Del the shortcode didn't return the error. So del the Long one, didn't del the shortcode in badger.

PHP functions implementation to Golang. This package is for the Go beginners who have developed PHP code before. You can use PHP like functions in your app, module etc. when you add this module to your project.

PHP Functions for Golang - phpfuncs PHP functions implementation to Golang. This package is for the Go beginners who have developed PHP code before. Y

Dec 30, 2022
Pokes users on Slack about outstanding risks found by Crowdstrike Spotlight or vmware Workspace ONE so they can secure their own endpoint.
Pokes users on Slack about outstanding risks found by Crowdstrike Spotlight or vmware Workspace ONE so they can secure their own endpoint.

?? security-slacker Pokes users on Slack about outstanding risks found by Crowdstrike Spotlight or vmware Workspace ONE so they can secure their own e

Nov 29, 2022
An improvement on the PoC for the privacy-preserving contact discovery scheme I implemented as part of my UCL masters degree

Privacy-Preserving Contact Discovery / ARKE - PoC This is an improved version of the work I submitted as part of my masters degree dissertation at UCL

Dec 18, 2021
Design, compile and deploy your own Endlesss soundpacks with rapid iteration in Studio and iOS
Design, compile and deploy your own Endlesss soundpacks with rapid iteration in Studio and iOS

Squonker is a tool for building and installing your own custom Endlesss instruments.

Dec 28, 2021
A fast and easy to use URL health checker ⛑️ Keep your links healthy during tough times
A fast and easy to use URL health checker ⛑️ Keep your links healthy during tough times

AreYouOK? A minimal, fast & easy to use URL health checker Who is AreYouOk made for ? OSS Package Maintainers ??️

Oct 7, 2022
GONET-Scanner - Golang network scanner with arp discovery and own parser
GONET-Scanner - Golang network scanner with arp discovery and own parser

GO/NET Scanner ScreenShots Install chmod +x install.sh ./install.sh [as root] U

Dec 11, 2022
Community edition nuclei templates, a simple tool that allows you to organize all the Nuclei templates offered by the community in one place

cent Community edition nuclei templates, a simple tool that allows you to organize all the Nuclei templates offered by the community in one place Inst

Jan 9, 2023
ARP spoofing tool based on go language, supports LAN host scanning, ARP poisoning, man-in-the-middle attack, sensitive information sniffing, HTTP packet sniffing
ARP spoofing tool based on go language, supports LAN host scanning, ARP poisoning, man-in-the-middle attack, sensitive information sniffing, HTTP packet sniffing

[ARP Spoofing] [Usage] Commands: clear clear the screen cut 通过ARP欺骗切断局域网内某台主机的网络 exit exit the program help display help hosts 主机管理功能 loot 查看嗅探到的敏感信息

Dec 30, 2022
Tool to check whether one of your applications is affected by a vulnerability in log4j: CVE-2021-44228
Tool to check whether one of your applications is affected by a vulnerability in log4j: CVE-2021-44228

log4shell.tools log4shell.tools is a tool allows you to run a test to check whether one of your applications is affected by a vulnerability in log4j:

Nov 2, 2022
Use golang.org/x/vuln to scan your dependencies

vulnz - Use golang.org/x/vuln to scan your dependencies vulnz uses golang.org/x/vuln to scan the dependencies in your go.mod. Install go install githu

Oct 10, 2022