From ad696ea54a37d51e64abcca39d22635dc976cc2c Mon Sep 17 00:00:00 2001 From: Samuel Date: Sun, 21 Jul 2024 11:05:44 +0300 Subject: [PATCH 1/4] feat: add jellyfin template --- public/templates/jellyfin.svg | 34 +++++++++++++++++++++++++++ templates/jellyfin/docker-compose.yml | 25 ++++++++++++++++++++ templates/jellyfin/index.ts | 19 +++++++++++++++ templates/templates.ts | 15 ++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 public/templates/jellyfin.svg create mode 100644 templates/jellyfin/docker-compose.yml create mode 100644 templates/jellyfin/index.ts diff --git a/public/templates/jellyfin.svg b/public/templates/jellyfin.svg new file mode 100644 index 000000000..4227a7064 --- /dev/null +++ b/public/templates/jellyfin.svg @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/templates/jellyfin/docker-compose.yml b/templates/jellyfin/docker-compose.yml new file mode 100644 index 000000000..b1af0ef71 --- /dev/null +++ b/templates/jellyfin/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.8' +services: + jellyfin: + image: jellyfin/jellyfin + networks: + - dokploy-network + labels: + - "traefik.enable=true" + - "traefik.http.routers.${HASH}.rule=Host(`${JELLYFIN_HOST}`)" + - "traefik.http.services.${HASH}.loadbalancer.server.port" + volumes: + - ./config:/config + - ./cache:/cache + - ./media:/media + restart: 'unless-stopped' + # Optional - alternative address used for autodiscovery + environment: + - JELLYFIN_PublishedServerUrl=http://${JELLYFIN_HOST} + # Optional - may be necessary for docker healthcheck to pass if running in host network mode + extra_hosts: + - 'host.docker.internal:host-gateway' + +networks: + dokploy-network: + external: true diff --git a/templates/jellyfin/index.ts b/templates/jellyfin/index.ts new file mode 100644 index 000000000..7af9884f8 --- /dev/null +++ b/templates/jellyfin/index.ts @@ -0,0 +1,19 @@ +// EXAMPLE +import { + generateHash, + generateRandomDomain, + type Template, + type Schema, +} from "../utils"; + +export function generate(schema: Schema): Template { + const randomDomain = generateRandomDomain(schema); + + const envs = [ + `JELLYFIN_HOST=${randomDomain}`, + ]; + + return { + envs, + }; +} diff --git a/templates/templates.ts b/templates/templates.ts index 0063013e3..a23273464 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -378,4 +378,19 @@ export const templates: TemplateData[] = [ tags: ["analytics"], load: () => import("./umami/index").then((m) => m.generate), }, + { + id: "jellyfin", + name: "jellyfin", + version: "v10.9.7", + description: + "Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. ", + logo: "jellyfin.svg", + links: { + github: "https://github.com/jellyfin/jellyfin", + website: "https://jellyfin.org/", + docs: "https://jellyfin.org/docs/", + }, + tags: ["media system"], + load: () => import("./jellyfin/index").then((m) => m.generate), + }, ]; From 54aaa511d5672b1f742a89f95b495fb5e8d9fba2 Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 22 Jul 2024 09:20:16 +0300 Subject: [PATCH 2/4] feat: add jellyfin template --- templates/jellyfin/docker-compose.yml | 15 +++++++++------ templates/jellyfin/index.ts | 5 ++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/templates/jellyfin/docker-compose.yml b/templates/jellyfin/docker-compose.yml index b1af0ef71..bdfcf2615 100644 --- a/templates/jellyfin/docker-compose.yml +++ b/templates/jellyfin/docker-compose.yml @@ -1,17 +1,17 @@ version: '3.8' services: jellyfin: - image: jellyfin/jellyfin + image: jellyfin/jellyfin:10 networks: - dokploy-network labels: - "traefik.enable=true" - "traefik.http.routers.${HASH}.rule=Host(`${JELLYFIN_HOST}`)" - - "traefik.http.services.${HASH}.loadbalancer.server.port" + - "traefik.http.services.${HASH}.loadbalancer.server.port=${JELLYFIN_PORT}" volumes: - - ./config:/config - - ./cache:/cache - - ./media:/media + - config:/config + - cache:/cache + - media:/media restart: 'unless-stopped' # Optional - alternative address used for autodiscovery environment: @@ -19,7 +19,10 @@ services: # Optional - may be necessary for docker healthcheck to pass if running in host network mode extra_hosts: - 'host.docker.internal:host-gateway' - +volumes: + config: + cache: + media: networks: dokploy-network: external: true diff --git a/templates/jellyfin/index.ts b/templates/jellyfin/index.ts index 7af9884f8..61bd0f08b 100644 --- a/templates/jellyfin/index.ts +++ b/templates/jellyfin/index.ts @@ -7,10 +7,13 @@ import { } from "../utils"; export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); const randomDomain = generateRandomDomain(schema); - + const port = 8096; const envs = [ `JELLYFIN_HOST=${randomDomain}`, + `HASH=${mainServiceHash}`, + `JELLYFIN_PORT=${port}` ]; return { From 94bcea36c6af834f83782df6e868fdb8ce26cc47 Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 22 Jul 2024 20:34:26 +0300 Subject: [PATCH 3/4] feat: add jellyfin template --- templates/jellyfin/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/jellyfin/docker-compose.yml b/templates/jellyfin/docker-compose.yml index bdfcf2615..16ae6be96 100644 --- a/templates/jellyfin/docker-compose.yml +++ b/templates/jellyfin/docker-compose.yml @@ -4,6 +4,8 @@ services: image: jellyfin/jellyfin:10 networks: - dokploy-network + ports: + - ${JELLYFIN_PORT} labels: - "traefik.enable=true" - "traefik.http.routers.${HASH}.rule=Host(`${JELLYFIN_HOST}`)" From c13eb65b5a424968d3a4b3960278fab8f28ebb72 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 22 Jul 2024 12:58:14 -0600 Subject: [PATCH 4/4] refactor: format --- templates/jellyfin/index.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/templates/jellyfin/index.ts b/templates/jellyfin/index.ts index 61bd0f08b..dc33b121a 100644 --- a/templates/jellyfin/index.ts +++ b/templates/jellyfin/index.ts @@ -1,22 +1,22 @@ // EXAMPLE import { - generateHash, - generateRandomDomain, - type Template, - type Schema, + type Schema, + type Template, + generateHash, + generateRandomDomain, } from "../utils"; export function generate(schema: Schema): Template { - const mainServiceHash = generateHash(schema.projectName); - const randomDomain = generateRandomDomain(schema); - const port = 8096; - const envs = [ - `JELLYFIN_HOST=${randomDomain}`, - `HASH=${mainServiceHash}`, - `JELLYFIN_PORT=${port}` - ]; + const mainServiceHash = generateHash(schema.projectName); + const randomDomain = generateRandomDomain(schema); + const port = 8096; + const envs = [ + `JELLYFIN_HOST=${randomDomain}`, + `HASH=${mainServiceHash}`, + `JELLYFIN_PORT=${port}`, + ]; - return { - envs, - }; + return { + envs, + }; }