mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(add): YOURLS Template
This commit is contained in:
1
apps/dokploy/public/templates/yourls.svg
Normal file
1
apps/dokploy/public/templates/yourls.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 14 KiB |
@@ -867,4 +867,18 @@ export const templates: TemplateData[] = [
|
|||||||
tags: ["support", "chat", "customer-service"],
|
tags: ["support", "chat", "customer-service"],
|
||||||
load: () => import("./chatwoot/index").then((m) => m.generate),
|
load: () => import("./chatwoot/index").then((m) => m.generate),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "yourls",
|
||||||
|
name: "YOURLS",
|
||||||
|
version: "latest",
|
||||||
|
description: "YOURLS (Your Own URL Shortener) is a set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or Bitly).",
|
||||||
|
logo: "yourls.svg",
|
||||||
|
links: {
|
||||||
|
github: "https://github.com/YOURLS/YOURLS",
|
||||||
|
website: "https://yourls.org/",
|
||||||
|
docs: "https://yourls.org/#documentation",
|
||||||
|
},
|
||||||
|
tags: ["url-shortener", "php"],
|
||||||
|
load: () => import("./yourls/index").then((m) => m.generate),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
43
apps/dokploy/templates/yourls/docker-compose.yml
Normal file
43
apps/dokploy/templates/yourls/docker-compose.yml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
version: '3.7'
|
||||||
|
|
||||||
|
services:
|
||||||
|
yourls-app:
|
||||||
|
image: yourls:latest
|
||||||
|
networks:
|
||||||
|
- dokploy-network
|
||||||
|
environment:
|
||||||
|
YOURLS_SITE: https://${YOURLS_HOST}
|
||||||
|
YOURLS_USER: ${YOURLS_ADMIN_USER}
|
||||||
|
YOURLS_PASS: ${YOURLS_ADMIN_PASSWORD}
|
||||||
|
YOURLS_DB_HOST: yourls-mysql
|
||||||
|
YOURLS_DB_USER: yourls
|
||||||
|
YOURLS_DB_PASS: ${MYSQL_PASSWORD}
|
||||||
|
YOURLS_DB_NAME: yourls
|
||||||
|
volumes:
|
||||||
|
- yourls-data:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
yourls-mysql:
|
||||||
|
condition: service_healthy
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
yourls-mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
networks:
|
||||||
|
- dokploy-network
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||||
|
MYSQL_DATABASE: yourls
|
||||||
|
MYSQL_USER: yourls
|
||||||
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- yourls-mysql-data:/var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u$$MYSQL_USER", "-p$$MYSQL_PASSWORD"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
yourls-data:
|
||||||
|
yourls-mysql-data:
|
||||||
35
apps/dokploy/templates/yourls/index.ts
Normal file
35
apps/dokploy/templates/yourls/index.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import {
|
||||||
|
type DomainSchema,
|
||||||
|
type Schema,
|
||||||
|
type Template,
|
||||||
|
generatePassword,
|
||||||
|
generateRandomDomain,
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
|
export function generate(schema: Schema): Template {
|
||||||
|
const mainDomain = generateRandomDomain(schema);
|
||||||
|
const mysqlPassword = generatePassword();
|
||||||
|
const mysqlRootPassword = generatePassword();
|
||||||
|
const adminPassword = generatePassword();
|
||||||
|
|
||||||
|
const domains: DomainSchema[] = [
|
||||||
|
{
|
||||||
|
host: mainDomain,
|
||||||
|
port: 80,
|
||||||
|
serviceName: "yourls-app",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const envs = [
|
||||||
|
`YOURLS_HOST=${mainDomain}`,
|
||||||
|
`YOURLS_ADMIN_USER=admin`,
|
||||||
|
`YOURLS_ADMIN_PASSWORD=${adminPassword}`,
|
||||||
|
`MYSQL_PASSWORD=${mysqlPassword}`,
|
||||||
|
`MYSQL_ROOT_PASSWORD=${mysqlRootPassword}`,
|
||||||
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
domains,
|
||||||
|
envs,
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user