https://github.com/ghostdevv/short
A microservice for creating short links
https://github.com/ghostdevv/short
Last synced: 12 months ago
JSON representation
A microservice for creating short links
- Host: GitHub
- URL: https://github.com/ghostdevv/short
- Owner: ghostdevv
- License: mit
- Created: 2022-11-20T01:05:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T22:37:47.000Z (over 1 year ago)
- Last Synced: 2025-03-17T07:11:37.631Z (12 months ago)
- Language: Svelte
- Size: 540 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Short
A foss, self hostable, and private link shortener. Every element of the shortner is self-hostable for **free** using Cloudflare.
> ### Demo instance available here: https://short.willow.sh/
## Self Host
1. Create KV Namespaces
You need to create two KV Namespaces for short, you can [do that here](https://dash.cloudflare.com/?to=/:account/workers/kv/namespaces). They can be named anything but I chose `SHORT_LINKS` and `SHORT_LINKS_MAP`.

2. Hosting on Cloudflare Pages
Fork this repo and connect it to [Cloudflare pages](https://dash.cloudflare.com/?to=/:account/pages). You should use the following deploy settings:

3. Add the KV Bindings to your Pages project
On pages under `Settings > Functions > KV namespace bindings` you need to add the following `LINKS` and `LINKS_MAP` variables for preview and production. They must be named exactly otherwise they won't work

## Configuration
All configuration is done with environment variables.
### Auth
If you want to protect your installation with auth you can set the `SHORT_AUTH_USERNAME` and `SHORT_AUTH_PASSWORD` environment variable. This will prevent access to the UI and still allow people with a valid link to use it.
## Versioning
This project follows SemVer and has a [changelog](./CHANGELOG.md) available. However, you should always read the changes before updating your self hosted version!
## Migrating to v2
In v2 we removed the need for a seperate backend cf worker. After you migrate the frontend you can just delete the worker, since all your data is in KV you won't lose anything or have any migration for it.
To migrate you should update your fork, and add the following KV under `Settings > Functions > KV namespace bindings` of your pages project:
