2021-08-10 04:58:26 +02:00
# 🔗 LittleLink-Server
This project is based on the great work from [littlelink ](https://github.com/sethcottle/littlelink )
2021-10-09 06:42:06 +02:00
It takes the same simple approach to a link page and hosts it within a NodeJS server with React Server Side Rendering, containerized for you to use. Now, customizing `LittleLink` with `littlelink-server` is as easy as passing in some environment variables. If you need help configuring this, please see [this video that explains everything ](https://www.youtube.com/watch?v=42SqfI_AjXU ) and a live example at [technotim.live ](https://technotim.live/ ).
2021-08-10 04:58:26 +02:00
2021-10-17 21:24:04 +02:00
## 🚀 Getting Started
2022-03-21 02:00:13 +01:00
## 📍 Supported Links & Buttons & Config
2021-08-11 05:35:59 +02:00
2022-03-21 02:00:13 +01:00
Check the [config ](https://github.com/techno-tim/littlelink-server/blob/master/src/config.js ) file for all supported buttons and configuration!
2021-10-06 05:00:18 +02:00
2021-10-17 21:24:04 +02:00
## 📈 Analytics Support
### Google Analytics
2021-10-06 05:00:18 +02:00
See [Getting Started with Analytics ](https://support.google.com/analytics/answer/1008015?hl=en ). After getting your GA Tracking Id, use your tracking Id as environment variable like `GA_TRACKING_ID=G-XXXXXXXXXX` (See the example below)
2021-10-09 07:17:14 +02:00
All buttons clicked will be tracked automatically if `GA_TRACKING_ID` exists.
Sample event for YouTube button.
2021-10-09 07:19:13 +02:00
```javascript
2021-10-16 21:53:23 +02:00
window.gtag('event', 'youtube-button');
2021-10-09 07:17:14 +02:00
```
2021-10-17 21:24:04 +02:00
### Umami
2021-10-16 21:41:08 +02:00
See [Adding a website & Collecting data ](https://umami.is/docs/collect-data ) page to add and generate your tracking code.
Generated tracking code should look like:
```javascript
< script async defer data-website-id = "00000000-1111-2222-3333-444444444444" src = "https://your-umami-app.com/umami.js" > < / script >
```
Use `data-website-id` as environment variable `UMAMI_WEBSITE_ID` and `src` as `UMAMI_APP_URL` .
2021-10-16 21:53:23 +02:00
Sample event for YouTube button.
```javascript
window.umami('youtube-button');
```
2022-03-19 20:27:50 +01:00
### Matomo
See [Installing Matomo fo how to configure analytics ](https://matomo.org/docs/installation/ ) and [how to find your site id ](https://matomo.org/faq/general/faq_19212/ )
Use `MATOMO_URL` for your URL and `MATOMO_SITE_ID` for your site id
Sample event for YouTube button.
```javascript
2022-03-19 20:28:42 +01:00
window._paq.push(['trackEvent', 'youtube-button']]);
2022-03-19 20:27:50 +01:00
```
2021-10-19 05:44:52 +02:00
## 🩺 Health Check
A health check endpoint exists on `/healthcheck` . If healthy, it will return with a `200` and the following response:
```json
{
"status": "ok"
}
```
2021-11-13 01:35:49 +01:00
To skip express from logging these calls, add the environment variable:
```bash
SKIP_HEALTH_CHECK_LOGS=true
```
2021-10-17 21:24:04 +02:00
## 🐳 Docker
2021-08-19 00:32:47 +02:00
2021-08-27 03:16:24 +02:00
This container image is published on both [GitHub Container Registry ](https://github.com/techno-tim/littlelink-server/pkgs/container/littlelink-server ) and [DockerHub ](https://hub.docker.com/repository/docker/timothystewart6/littlelink-server ) choose whichever one works for you. They will both be updated during CI.
2022-03-21 02:00:13 +01:00
The example below will generate a site exactly like < https: / / technotim . live >
2021-08-11 05:35:59 +02:00
`docker-compose.yml`
```yml
---
2021-09-24 03:44:52 +02:00
version: "3.0"
2021-08-11 05:35:59 +02:00
services:
2021-10-18 04:38:08 +02:00
littlelink-server:
2021-08-11 05:35:59 +02:00
image: ghcr.io/techno-tim/littlelink-server:latest
2021-08-27 03:16:24 +02:00
# dockerhub is also supported timothystewart6/littlelink-server
2021-11-24 04:17:45 +01:00
# image: timothystewart6/littlelink-server:latest
2021-08-11 05:35:59 +02:00
container_name: littlelink-server
environment:
- META_TITLE=Techno Tim
2022-03-21 02:00:13 +01:00
- META_DESCRIPTION=Software Engineer | Gamer | Twitch Streamer | Content Creator on YouTube | Homelab | 🇺🇸 🇯🇵 | Full Nerd
2021-08-11 05:35:59 +02:00
- META_AUTHOR=Techno Tim
2022-06-04 06:42:29 +02:00
- META_KEYWORDS=HomeLab, HTML, CSS, Engineering
2021-10-09 06:38:21 +02:00
- LANG=en
2021-09-24 03:44:52 +02:00
- META_INDEX_STATUS=all
2022-03-21 02:00:13 +01:00
- OG_SITE_NAME=Techno Tim
- OG_TITLE=Techno Tim
- OG_DESCRIPTION=The home of Techno Tim
- OG_URL=https://technotim.live
- OG_IMAGE=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
- OG_IMAGE_WIDTH=400
- OG_IMAGE_HEIGHT=400
2021-10-09 07:17:14 +02:00
- GA_TRACKING_ID=G-XXXXXXXXXX
2021-08-11 05:35:59 +02:00
- THEME=Dark
2021-08-14 23:47:16 +02:00
- FAVICON_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg
- AVATAR_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg
- AVATAR_2X_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
2021-08-11 05:35:59 +02:00
- AVATAR_ALT=Techno Tim Profile Pic
- NAME=TechnoTim
- BIO=Hey! Just a place where you can connect with me!
2021-12-15 16:59:31 +01:00
# use ENV variable names for order, listed buttons will be boosted to the top
2022-03-21 02:00:13 +01:00
- BUTTON_ORDER=YOUTUBE,TWITCH,TWITTER,GITHUB,INSTAGRAM,DISCORD,FACEBOOK,TIKTOK,PATREON,GEAR,DOCUMENTATION
2021-12-15 16:59:31 +01:00
# you can render an unlimited amount of custom buttons by adding
# the CUSTOM_BUTTON_* variables and by using a comma as a separator.
2022-03-21 02:00:13 +01:00
- CUSTOM_BUTTON_TEXT=Documentation,Recommended Gear
- CUSTOM_BUTTON_URL=https://l.technotim.live/docs,https://l.technotim.live/gear
- CUSTOM_BUTTON_COLOR=#000000,#000000
2021-12-15 16:59:31 +01:00
- CUSTOM_BUTTON_TEXT_COLOR=#ffffff,#ffffff
2022-03-21 02:00:13 +01:00
- CUSTOM_BUTTON_ALT_TEXT=Tech documentation site for my videos and more,Recommended Gear
- CUSTOM_BUTTON_NAME=DOCUMENTATION,GEAR
- CUSTOM_BUTTON_ICON=fas file-alt,fas fa-cog
- GITHUB=https://l.technotim.live/github
- TWITTER=https://l.technotim.live/twitter
- INSTAGRAM=https://l.technotim.live/instagram
- YOUTUBE=https://l.technotim.live/subscribe
- TWITCH=https://l.technotim.live/twitch
2022-01-09 04:55:23 +01:00
- DISCORD=https://l.technotim.live/discord
2022-03-21 02:04:45 +01:00
- TIKTOK=https://l.technotim.live/tiktok
2022-03-21 02:00:13 +01:00
- FACEBOOK=https://l.technotim.live/facebook
- PATREON=https://l.technotim.live/patreon
- FOOTER=Techno Tim © 2022
2021-08-11 05:35:59 +02:00
ports:
- 8080:3000
restart: unless-stopped
security_opt:
- no-new-privileges:true
2021-08-12 04:08:21 +02:00
```
2021-08-14 18:39:45 +02:00
Docker command
2021-10-17 21:24:04 +02:00
```bash
2021-08-14 18:39:45 +02:00
docker run -d \
--name=littlelink-server \
-p 8080:3000 \
-e META_TITLE='Techno Tim' \
-e META_DESCRIPTION='Techno Tim Link page' \
-e META_AUTHOR='Techno Tim' \
2022-06-04 06:42:29 +02:00
-e META_KEYWORDS='HomeLab, HTML, CSS, Engineering \
2021-10-09 06:38:21 +02:00
-e LANG=en \
2021-09-24 03:44:52 +02:00
-e META_INDEX_STATUS='noindex' \
2021-08-14 18:39:45 +02:00
-e THEME='Dark' \
2021-08-14 23:47:16 +02:00
-e FAVICON_URL='https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg' \
-e AVATAR_URL='https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg' \
-e AVATAR_2X_URL='https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg' \
2021-08-14 18:39:45 +02:00
-e AVATAR_ALT='Techno Tim Profile Pic' \
-e NAME='TechnoTim' \
-e BIO='Hey! Just a place where you can connect with me!' \
2022-03-21 02:00:13 +01:00
-e GITHUB='https://l.technotim.live/github' \
-e TWITTER='https://l.technotim.live/twitter' \
2021-08-14 18:39:45 +02:00
-e INSTAGRAM='https://www.instagram.com/techno.tim' \
2022-03-21 02:00:13 +01:00
-e YOUTUBE='https://l.technotim.live/subscribe' \
-e TWITCH='https://l.technotim.live/twitch' \
2022-01-09 04:55:23 +01:00
-e DISCORD='https://l.technotim.live/discord' \
2022-03-21 02:00:13 +01:00
-e TIKTOK='https://l.technotim.live/discord' \
-e KIT='https://l.technotim.live/gear' \
-e FOOTER=Techno Tim © 2022 \
2021-08-14 18:39:45 +02:00
--restart unless-stopped \
ghcr.io/techno-tim/littlelink-server:latest
```
2021-10-17 21:24:04 +02:00
## ☸ Kubernetes
2021-08-19 00:32:47 +02:00
2021-08-26 02:16:09 +02:00
[Unofficial helm chart provided by k8s-at-home ](https://github.com/k8s-at-home/charts/tree/master/charts/stable/littlelink-server )
2021-08-19 00:32:47 +02:00
2021-10-17 21:24:04 +02:00
```bash
2021-08-19 00:32:47 +02:00
helm repo add k8s-at-home https://k8s-at-home.com/charts/
helm repo update
helm install littlelink-server \
--set env.TZ="America/New York" \
2021-08-26 02:16:09 +02:00
--set env.META_TITLE="TechnoTim"
2021-08-19 00:32:47 +02:00
k8s-at-home/littlelink-server
```
2021-10-17 21:24:04 +02:00
2021-08-19 00:32:47 +02:00
Or use a values.yaml files
`helm install littlelink-server k8s-at-home/littlelink-server -f values.yaml`
2021-10-17 21:24:04 +02:00
## 👇 What is LittleLink?
2021-08-12 05:29:39 +02:00
![LittleLink ](https://cdn.cottle.cloud/littlelink/social-circle.png )
LittleLink is a lightweight DIY alternative to services like [Linktree ](https://linktr.ee )
and [many.link ](https://www.google.com ). LittleLink was built using [Skeleton ](http://getskeleton.com/ ), a dead simple, responsive boilerplate—we just stripped out some additional code you wouldn't need and added in branded styles for popular services. 😊
![Themes ](https://cdn.cottle.cloud/littlelink/themes.png )
2021-10-16 20:44:28 +02:00
LittleLink has more than 20 company button styles you can use and we'll be throwing more in soon. You'll also find a light and dark theme ready to go. Not a fan of the colors? Update `skeleton-light.css` or `skeleton-dark.css` to the HEX values of your choosing.
2021-08-12 05:29:39 +02:00
![Performance ](https://cdn.cottle.cloud/littlelink/performance.png )
Using [Skeleton ](http://getskeleton.com/ ) let us build something that loads quickly & doesn't have any of the unnecessary bloat you would get from using a large framework for a page that requires nothing more than simplicity. LittleLink scored a 99/100 in performance when tested with [Google Lighthouse ](https://developers.google.com/web/tools/lighthouse ).