Skip to content

🔗 Personal link shortener that uses an NGINX-compatible map file as a config

License

Notifications You must be signed in to change notification settings

statico/statico.link

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

statico.link / ianl.link short URLs

build status

Why? I wanted an easy way to paste URLs that I use and share a lot.

How? This started as a simple NGINX redirect map like this because I already run NGINX for other things and wanted the simplest thing possible. Then people wanted an index page, and then the ipdata.co free API stopped working, so I made it a tiny service that would parse the existing config file.

What else? The site is marked noindex, nofollow to prevent crawling. Redirects are sent with a Referrer-Policy: unsafe-url header for reasons that I think sounded smart at the time but I'm too lazy to look up right now.

image

Link configuration file

Keys should be whole words. The server strips all hyphens from the key so that you can add a link like foobarbaz https://... ; and then paste https://your.links/foo-bar-baz into chat to make it more readable.

The link config file is a simple file full of lines in this format, which is compatible with NGINX for the above historical reasons:

<key> <url> ;

Or, for links you want to work but don't want to list on the page,

<key> <url> ; # private

Environment variables

Configure the following env vars either through Docker or a .env file or whatever:

  • PORT - Port number to listen on, defaults to 5000
  • IPDATA_KEY - Get an API key from https://dashboard.ipdata.co/api.html
  • LINKS_CONF - Path to the links config file (see above)
  • BASE_URL - Base URL like https://cool.link/
  • TITLE - Title to appear on the page
  • DESCRIPTION - Byline to appear on the page
  • GITHUB_URL - Link to this page

Develop

Get a recent Node.js and Yarn and run:

$ yarn install
$ yarn global add nodemon
$ nodemon

Deploy

$ docker build . --tag ghcr.io/statico/statico.link

Etc.

License

MIT