You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vanityURLs is a _simple_ solution to deploy a budget-friendly Url Shortener. It runs at scale in your Cloudflare subscription with continuous integration.
5
+
vanityURLs is a Cloudflare Workers redirector for running a branded short-link domain as code. Links, schedules, destination policies, localized instance pages, and operator configuration live in Git; the build produces the Worker assets Cloudflare deploys.
6
6
7
-
> 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.
7
+
## Documentation
8
8
9
-
Features:
10
-
* Fully branded internet domain using Cloudflare's [DNS](https://www.cloudflare.com/en-ca/application-services/products/dns/) & [Pages](https://pages.cloudflare.com/) so your links are compact and pretty
11
-
* URL redirection (301, 302, 303, 307 and 308)
12
-
* Advanced redirection with splats (e.g., /news/*→ /blog/:splat )
13
-
* Continuous integration managed by Cloudflare Page Engine
14
-
* Configurable destination policies with `blocked_keywords` in `v8s-policies.json`
15
-
* Exact-match destination previews through `/expand/` and the `v8s --print <slug>` CLI helper
16
-
* Link expiration dates with the `expires_at` field in `v8s-links.txt`
9
+
The website is the source of truth for setup and operations:
17
10
18
-
My objective is to work at the command line and automate it. So feel free to fork, and customize.
*[Validation and CI](https://www.VanityURLs.link/en/docs/validation-ci/)
19
21
20
-
## What problem does it solve and why is it useful?
22
+
## Local Workflow
21
23
22
-
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.
24
+
Common commands:
23
25
24
-
This kind of solution is known as TinyURL, tiny url, shorten that long URL, URL Shortening Service, goo.gl, bit.ly, short.io, etc.
26
+
```sh
27
+
npm install
28
+
npm run setup
29
+
npm run check
30
+
npm run build
31
+
./scripts/lnk --help
32
+
```
25
33
26
-
### It's bullet proof
34
+
Run `npm run local-install` to install workstation helpers and create local configuration. Run `npm run local-publish` after local edits when you want checks, commit selection, and push handled in one step.
27
35
28
-
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.
29
-
30
-
## Setup
31
-
32
-
1. Register a _tiny_ internet domain name with your [preferred vendor](https://www.cloudflare.com/en-ca/products/registrar/)
33
-
2. If you don't own an a [Cloudflare subscription](https://dash.cloudflare.com/) already, you need to create a free account
34
-
3. Add the _tiny_ internet domain name to [Cloudflare DNS](https://dash.cloudflare.com/)
35
-
4.[Follow the instructions](https://vanityurls.link/en/docs/getting-started/) to fork the GitHub repository and customize your setup
36
-
5. Use the [`lnk` bash script](https://vanityurls.link/en/docs/guide/advanced/cli/) to shorten, personalize, and share fully branded short URLs with continuous integration on Cloudflare
37
-
38
-
## Implemented request references
39
-
40
-
The 2.x runtime includes a few requested capabilities that are easy to
41
-
miss because they are implemented through configuration or helper scripts:
42
-
43
-
* Short URL policies are handled through `blocked_keywords` in
44
-
`defaults/v8s-policies.json` or an instance-specific
45
-
`custom/v8s-policies.json`.
46
-
* Looking up a destination from a short name is available in two places:
47
-
`/expand/` previews exact-match short links in the deployed Worker, and
48
-
`v8s --print <slug>` prints a destination from the generated local
49
-
registry after `npm run build`. Run `npm run local-install` once to
50
-
install the Bash/Zsh helper and opt in to local registry syncing.
51
-
* Expiration dates are stored with the `expires_at` field in
52
-
`v8s-links.txt`; `./scripts/lnk --expires-at DATE ...` writes that
53
-
value, and the Worker treats expired links as expired at runtime.
54
-
55
-
## Developer CLI reference
56
-
57
-
Use `./scripts/lnk --help` as the local quick reference for link,
58
-
schedule, and block policy edits. The detailed product documentation lives
59
-
at <https://www.VanityURLs.link/en/docs>.
60
-
61
-
Run `npm run local-install` to create or update
62
-
`custom/v8s-local-config.json`, install the shell helper, install the
63
-
`lnk` CLI, and write the local repository path used by workstation helpers.
64
-
Run `npm run local-publish` after manual local edits; it runs
65
-
`npm run check`, then commits and pushes the configured local paths with the
66
-
commit message from `v8s-local-config.json`. It uses a more specific
67
-
configured message when only `custom/v8s-links.txt`,
68
-
`custom/v8s-policies.json`, or `custom/v8s-site-config.json` changed.
69
-
70
-
The CLI intentionally documents only the user-facing environment flags:
71
-
72
-
*`DRY_RUN=true` prints the planned change without writing, committing, or
73
-
pushing.
74
-
*`V8S_REPO=PATH` points copied local helpers at the local repository path.
75
-
*`V8S_LINKS_OWNER=OWNER` changes the default owner field for new links.
76
-
*`V8S_LINKS_FILE=FILE` overrides the links file.
77
-
*`V8S_SCHEDULES_FILE=FILE` overrides the schedule file.
78
-
*`V8S_POLICY_FILE=FILE` overrides the block policy file.
79
-
80
-
Successful write operations run `npm run check`, then commit and push
81
-
automatically so Cloudflare can deploy the generated site.
82
-
83
-
## Limitations
84
-
85
-
As this code is deployed on Cloudflare Pages, there are some product limits to be aware of:
86
-
87
-
* A maximum of 2,000 static redirects and 100 dynamic redirects, for a combined total of 2,100 redirects ([source](https://developers.cloudflare.com/pages/platform/limits/#redirects)).
88
-
* The Free plan supports up to 500 automated builds per month ([source](https://developers.cloudflare.com/pages/platform/limits/#builds)).
89
-
90
-
Most of these limits wouldn't be reached in general use, but it's good to note for larger-scale deployments.
91
-
92
-
Platform-wise, the `lnk` scripts require `bash` and so are not natively compatible with Windows at this time.
36
+
See the [CLI documentation](https://www.VanityURLs.link/en/docs/cli/) and [custom override documentation](https://www.VanityURLs.link/en/docs/custom-overrides/) for the details.
93
37
94
38
## Contributions
95
39
@@ -101,10 +45,10 @@ Platform-wise, the `lnk` scripts require `bash` and so are not natively compatib
0 commit comments