Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

statico/statico.link

Repository files navigation

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 maplike 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 aReferrer-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 likefoobarbaz https://... ; and then pastehttps://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 fromhttps://dashboard.ipdata.co/api.html
  • LINKS_CONF - Path to the links config file (see above)
  • BASE_URL - Base URL likehttps://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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp