forked from techno-tim/littlelink-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f8ac025
Showing
48 changed files
with
2,435 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: timothystewart6 | ||
patreon: technotim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: CI for releases | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
js-install-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [v14.17.4] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Dependencies, Test, and Build | ||
run: | | ||
yarn install --frozen-lockfile --check-files | ||
env: | ||
CI: true | ||
|
||
build-and-push-docker-image: | ||
needs: [js-install-and-test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Show structure | ||
run: | | ||
ls -R | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64,linux/386 | ||
push: true | ||
tags: timothystewart6/littlelink-server:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v14.17.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:14.17.4-alpine | ||
RUN apk --no-cache add \ | ||
gettext \ | ||
bash | ||
ENV NODE_ENV=production | ||
WORKDIR /usr/src/app | ||
COPY package.json yarn.lock ./ | ||
RUN yarn install --frozen-lockfile --check-files --production=true | ||
COPY www ./www | ||
COPY app.js ./ | ||
COPY ./entrypoint.sh / | ||
RUN chmod +x /entrypoint.sh | ||
EXPOSE 3000 | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD [ "node", "app.js" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 🔗 LittleLink-Server | ||
|
||
[](https://hub.docker.com/r/timothystewart6/littlelink-server/) | ||
|
||
This project is based on the great work from [littlelink](https://github.com/sethcottle/littlelink) | ||
It takes the same simple approach to a link page and hosts it within a nodeJS server containerized for you to use. Now, customizing `littlelink` with `littlelink-server` is as easy as passing in some environment variables. | ||
|
||
|
||
|
||
# 👇 What is `littlelink`? | ||
|
||
 | ||
|
||
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. 😊 | ||
|
||
 | ||
|
||
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. | ||
|
||
 | ||
|
||
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). | ||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require('dotenv').config() | ||
const express = require('express') | ||
const helmet = require("helmet"); | ||
const morgan = require('morgan') | ||
const compression = require('compression') | ||
|
||
const app = express(); | ||
app.use( | ||
helmet.contentSecurityPolicy({ | ||
useDefaults: true, | ||
directives: { | ||
"img-src": '* data:', // this is needed to load images off site | ||
}, | ||
}) | ||
); | ||
app.use(morgan('combined')); | ||
app.use(express.static('www')); | ||
app.use(compression()) | ||
|
||
const server = app.listen(process.env.PORT || 3000, () => { | ||
const host = server.address().address | ||
const port = server.address().port | ||
console.log('Express app listening at http://%s:%s', host, port) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
# this is used for local development and testing | ||
version: '3.0' | ||
services: | ||
little-link: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
environment: | ||
- META_TITLE=Techno Tim | ||
- META_DESCRIPTION=Techno Tim Link page | ||
- META_AUTHOR=Techno Tim | ||
- THEME=Dark | ||
- FAVICON_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg | ||
- AVATAR_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg | ||
- AVATAR_ALT=Techno Tim Profile Pic | ||
- NAME=TechnoTim | ||
- BIO=Hey! Just a place where you can connect with me! | ||
- GITHUB=https://github.com/timothystewart6 | ||
- TWITTER=https://twitter.com/TechnoTimLive | ||
- INSTAGRAM=https://www.instagram.com/techno.tim | ||
- YOUTUBE=https://www.youtube.com/channel/UCOk-gHyjcWZNj3Br4oxwh0A/ | ||
- TWITCH=https://www.twitch.tv/technotim/ | ||
- DISCORD=https://discord.gg/DJKexrJ | ||
- KIT=https://kit.co/TechnoTim | ||
- FOOTER=Thanks for stopping by! | ||
|
||
ports: | ||
- 8080:3000 | ||
restart: unless-stopped | ||
security_opt: | ||
- no-new-privileges:true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
originalfile="/usr/src/app/www/js/env.js" | ||
tmpfile=$(mktemp) | ||
cp --attributes-only --preserve $originalfile $tmpfile | ||
cat $originalfile | envsubst | tee $tmpfile && mv $tmpfile $originalfile | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "littlelink-server", | ||
"version": "1.0.0", | ||
"description": "A server based on littlelink", | ||
"main": "app.js", | ||
"license": "MIT", | ||
"private": true, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"start": "node app.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/timothystewart6/littlelink.git" | ||
}, | ||
"keywords": [ | ||
"littlelink", | ||
"linktree", | ||
"linktr.ee", | ||
"javascript", | ||
"open", | ||
"source", | ||
"html", | ||
"css", | ||
"docker" | ||
], | ||
"author": "Timothy Stewart", | ||
"bugs": { | ||
"url": "https://github.com/timothystewart6/littlelink/issues" | ||
}, | ||
"homepage": "https://github.com/timothystewart6/littlelink#readme", | ||
"dependencies": { | ||
"compression": "^1.7.4", | ||
"dotenv": "^10.0.0", | ||
"express": "^4.17.1", | ||
"helmet": "^4.6.0", | ||
"morgan": "^1.10.0" | ||
} | ||
} |
Oops, something went wrong.