From 7b06fd47b8fbcc6fcbeb0747ae7e6ba3cbbbd118 Mon Sep 17 00:00:00 2001 From: DrMxrcy Date: Tue, 12 Nov 2024 13:34:37 -0500 Subject: [PATCH] Add: Linkstack --- apps/dokploy/public/templates/linkstack.svg | 105 ++++++++++++++++++ .../templates/linkstack/docker-compose.yml | 51 +++++++++ apps/dokploy/templates/linkstack/index.ts | 36 ++++++ apps/dokploy/templates/templates.ts | 14 +++ 4 files changed, 206 insertions(+) create mode 100644 apps/dokploy/public/templates/linkstack.svg create mode 100644 apps/dokploy/templates/linkstack/docker-compose.yml create mode 100644 apps/dokploy/templates/linkstack/index.ts diff --git a/apps/dokploy/public/templates/linkstack.svg b/apps/dokploy/public/templates/linkstack.svg new file mode 100644 index 00000000..775632d2 --- /dev/null +++ b/apps/dokploy/public/templates/linkstack.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/dokploy/templates/linkstack/docker-compose.yml b/apps/dokploy/templates/linkstack/docker-compose.yml new file mode 100644 index 00000000..53f1456b --- /dev/null +++ b/apps/dokploy/templates/linkstack/docker-compose.yml @@ -0,0 +1,51 @@ +version: "3.8" + +services: + linkstack: + image: linkstackorg/linkstack:latest + networks: + - dokploy-network + volumes: + - linkstack_data:/htdocs + environment: + - TZ=UTC + - SERVER_ADMIN=admin@${LINKSTACK_HOST} + - HTTP_SERVER_NAME=${LINKSTACK_HOST} + - HTTPS_SERVER_NAME=${LINKSTACK_HOST} + - LOG_LEVEL=info + - PHP_MEMORY_LIMIT=256M + - UPLOAD_MAX_FILESIZE=8M + - DB_CONNECTION=mysql + - DB_HOST=mysql + - DB_PORT=3306 + - DB_DATABASE=${MYSQL_DATABASE} + - DB_USERNAME=${MYSQL_USER} + - DB_PASSWORD=${MYSQL_PASSWORD} + - FORCE_HTTPS=true + - APP_URL=https://${LINKSTACK_HOST} + depends_on: + mysql: + condition: service_healthy + restart: unless-stopped + + mysql: + image: mysql:8 + networks: + - dokploy-network + volumes: + - mysql_data:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u${MYSQL_USER}", "-p${MYSQL_PASSWORD}"] + interval: 10s + timeout: 5s + retries: 5 + restart: unless-stopped + +volumes: + linkstack_data: + mysql_data: \ No newline at end of file diff --git a/apps/dokploy/templates/linkstack/index.ts b/apps/dokploy/templates/linkstack/index.ts new file mode 100644 index 00000000..38852061 --- /dev/null +++ b/apps/dokploy/templates/linkstack/index.ts @@ -0,0 +1,36 @@ +import { + type DomainSchema, + type Schema, + type Template, + generatePassword, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainDomain = generateRandomDomain(schema); + const mysqlRootPassword = generatePassword(); + const mysqlPassword = generatePassword(); + const mysqlUser = "linkstack"; + const mysqlDatabase = "linkstack"; + + const domains: DomainSchema[] = [ + { + host: mainDomain, + port: 443, + serviceName: "linkstack", + }, + ]; + + const envs = [ + `LINKSTACK_HOST=${mainDomain}`, + `MYSQL_ROOT_PASSWORD=${mysqlRootPassword}`, + `MYSQL_DATABASE=${mysqlDatabase}`, + `MYSQL_USER=${mysqlUser}`, + `MYSQL_PASSWORD=${mysqlPassword}`, + ]; + + return { + domains, + envs, + }; +} \ No newline at end of file diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index cdfa312e..74d38c43 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -786,4 +786,18 @@ export const templates: TemplateData[] = [ tags: ["bookmarks", "link-shortener", "self-hosted"], load: () => import("./slash/index").then((m) => m.generate), }, + { + id: "linkstack", + name: "LinkStack", + version: "latest", + description: "LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface.", + logo: "linkstack.svg", + links: { + github: "https://github.com/LinkStackOrg/LinkStack", + website: "https://linkstack.org/", + docs: "https://docs.linkstack.org/", + }, + tags: ["links", "sharing", "social"], + load: () => import("./linkstack/index").then((m) => m.generate), + }, ];