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
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,5 +55,5 @@ Here's a summary of which additional tools this repository offers:
55
55
56
56
-[AppifyHub's Monolith API](./appifyhub-api/README.md): The API service from the [AppifyHub Monolith repository](https://github.com/appifyhub/monolith)
57
57
-[The Agent's API](./the-agent-api/README.md): The service from [The Agent repository](https://github.com/appifyhub/the-agent)
58
-
-[n8n Workflow Automation](./n8n/README.md): The n8n workflow automation platform for connecting apps and automating workflows
59
-
-[shrtn URL Shortener](./shrtn/README.md): The shrtn URL shortener for creating short URLs
58
+
-[Workflow Automations](./n8n/README.md): The n8n workflow automation platform for connecting apps and automating workflows
59
+
-[URL Shortener](./url-shortener/README.md): A generic URL shortener powered by Shlink
This directory contains the Kubernetes (K8s) configuration and Helm chart manifests for deploying shrtn, a self-hosted URL shortener. Learn more at [shrtn.io](https://shrtn.io) and [GitHub](https://github.com/CordlessWool/shrtn).
3
+
This directory contains the Kubernetes (K8s) configuration and Helm chart manifests for deploying a URL shortener powered by Shlink. Learn more at [Shlink](https://shlink.io).
4
4
5
5
### How to use this?
6
6
7
-
Most of the prerequisites are available for exploration in the [root-level README](../README.md). This document will focus only on the specific steps needed to deploy shrtn.
7
+
Most of the prerequisites are available for exploration in the [root-level README](../README.md). This document will focus only on the specific steps needed to deploy the URL shortener.
8
8
9
9
Prerequisites:
10
10
@@ -17,30 +17,20 @@ Prerequisites:
17
17
18
18
## Installation Guide
19
19
20
-
This URL shortener is best deployed using a Helm chart, which is located next to this guide. The chart is designed to be installed into a K8s cluster, and it will create all of the necessary resources for shrtn to run.
20
+
This URL shortener is best deployed using a Helm chart, which is located next to this guide. The chart is designed to be installed into a K8s cluster, and it will create all of the necessary resources for Shlink to run.
21
21
22
-
This chart uses SQLite as the database backend by default, which is stored in a persistent volume. This is suitable for small to medium workloads. For production environments with high availability requirements, consider using PostgreSQL or Cloudflare D1 instead (see shrtn documentation for details).
22
+
This chart uses SQLite as the database backend by default, which is stored in a persistent volume. This is suitable for small to medium workloads. For production environments with high availability requirements, consider using PostgreSQL later (see Shlink documentation for details).
23
23
24
24
Going forward, we will assume that you want to manage secrets using [Doppler](https://www.doppler.com). If you don't want to use Doppler, you can create the secrets manually using the `kubectl create secret` command and disable Doppler via Helm value directives. More details on how Doppler manages secrets can be found in the [Secrets Check](../secrets-check/README.md) guide.
25
25
26
26
#### Required Secrets Configuration
27
27
28
-
Before deploying shrtn, you need to set up the following secrets in your Doppler project (or K8s secrets if not using Doppler):
28
+
Before deploying the URL shortener, you need to set up the following secrets in your Doppler project (or K8s secrets if not using Doppler):
29
29
30
-
##### Core Required Configuration
30
+
1.`GEOLITE_LICENSE_KEY` — Maxmind GeoLite2 license key. See [GeoLite2 license key](https://shlink.io/documentation/geolite-license-key/).
31
+
2.`INITIAL_API_KEY` — Bootstrap API key for Shlink. See [Install via Docker](https://shlink.io/documentation/install-docker-image/).
31
32
32
-
1.**`ORIGIN`** - Base URL for the public-facing site
33
-
- Example: `http://shrtn.example.com` or `https://shrtn.example.com`
34
-
- This is also available as a config value, but can be overridden via secrets
This basic setup **does not** automatically manage your secrets, and expects you to have them provided next to your new deployment. The ORIGIN will default to the value in `values.yaml` (`http://shrtn.cloud.appifyhub.local`).
48
+
This basic setup does not automatically manage your secrets. The `DEFAULT_DOMAIN` and `IS_HTTPS_ENABLED` values will be computed from the chart's `ingress.*` configuration by default.
59
49
60
-
The service created here will be exposed over HTTP (not HTTPS) at `http://shrtn.cloud.appifyhub.local`. Note the `.local` top-level domain: this is a fake domain that is used for development and testing. You can change this to a real domain in the next steps. In order to access the service on this fake domain, you need to add it to your local hosts file (e.g., `/etc/hosts`), as explained in the [Echo server](../echo/README.md) guide. In the next step, we will explore adding the secrets manager and a real domain.
61
-
62
-
**Important**: Short URL redirects (like `https://shrtn.example.com/abc123`) will always work publicly - only the creation/admin interface will be restricted.
50
+
The service here will typically be exposed over HTTP (TLS is terminated at Traefik/edge). In production behind Traefik/Cloudflare, set `IS_HTTPS_ENABLED=true` to ensure Shlink generates correct HTTPS links.
63
51
64
52
Here's how you can undo this installation if you want to start over:
Note that this setup is also implicitly enabling Doppler's secrets manager, which will automatically inject the secrets into your pods. For more information on how to set up Doppler, check the [Secrets Check](../secrets-check/README.md) guide.
101
88
102
89
> 💡 The deployment is configured to reload its secrets every 5 minutes. In addition, the deployment might create multiple pods while booting up. As soon as the pod with the secrets injected is up and running, the other pod will be shut down (potentially with some logged errors). This is normal behavior.
103
90
104
-
Make sure your Doppler project contains all the required secrets (at minimum `ORIGIN`) before deploying.
91
+
Make sure your Doppler project contains at least `GEOLITE_LICENSE_KEY` and `INITIAL_API_KEY` before deploying.
105
92
106
93
### TLS and HTTPS
107
94
108
95
The configurations shown so far are not using TLS or HTTPS. This is fine for development and testing, but in production, we should always use TLS and HTTPS to secure our traffic. We will now make some changes to the chart to enable TLS and HTTPS.
109
96
110
97
```bash
111
98
# Let's upgrade our existing Helm release to include TLS and HTTPS
> 💡 The deployment here relies on Traefik's integration with [Let's Encrypt](https://letsencrypt.org), a widely-used provider of free TLS certificates. The chart is now configured to use the `websecure` entrypoint, which is the default entrypoint for HTTPS traffic in Traefik. If you are using a different ingress controller, you need to adjust accordingly yourself.
128
114
129
-
Note that we've also updated the `ORIGIN` configuration value to use HTTPS. This is important for shortened URLs to work correctly.
115
+
Also set `IS_HTTPS_ENABLED=true` so Shlink generates HTTPS links.
116
+
130
117
131
118
It may take a few minutes for the TLS certificate to be issued and for the service to be accessible over HTTPS.
132
119
133
120
#### Additional configuration
134
121
135
-
In addition to the install values we changed above using `--set`, there are many other configuration options available in the chart (such as rollback history, resource consumption, TTL settings, etc). You can see all of them in the `values.yaml` file.
122
+
In addition to the install values we changed above using `--set`, there are many other configuration options available in the chart (such as rollback history, resource consumption, TTL settings, etc).
123
+
124
+
See `values.yaml` for overridable non-sensitive config and future DB/Redis toggles.
136
125
137
126
## Important Considerations
138
127
139
128
### Backups
140
129
141
-
Since shrtn uses SQLite stored in a persistent volume by default, it's critical to backup your data regularly. You can backup the persistent volume using your cloud provider's snapshot features or by using Kubernetes backup solutions like Velero.
130
+
Since Shlink uses SQLite stored in a persistent volume by default, it's critical to backup your data regularly. You can backup the persistent volume using your cloud provider's snapshot features or by using Kubernetes backup solutions like Velero.
142
131
143
-
To manually backup shrtn data:
132
+
To manually backup data:
144
133
145
134
```bash
146
135
# Get the pod name
147
-
POD_NAME=$(kubectl get pods -n staging -l app=shrtn -o jsonpath='{.items[0].metadata.name}')
136
+
POD_NAME=$(kubectl get pods -n staging -l app=url-shortener -o jsonpath='{.items[0].metadata.name}')
0 commit comments