50 lines
13 KiB
JSON
50 lines
13 KiB
JSON
{
|
|
"meta": "name: libretime\ntitle: LibreTime (EasyPanel)\ndescription: \"Plantilla para desplegar LibreTime usando docker-compose adaptado a EasyPanel. Incluye variables para credenciales y el archivo de configuración montado.\"\nversion: \"1.0.0\"\nauthor: \"Tu nombre\"\nlogo: logo.png\nscreenshot: screenshot.png\ntags:\n - media\n - radio\n - docker\n - libretime\n\n# Formulario que EasyPanel mostrará al crear una instancia desde la plantilla.\nform:\n - id: postgres_password\n type: password\n title: Contraseña Postgres\n default: \"P@5sW0rd!8xYv7Q2z9L\"\n - id: rabbitmq_password\n type: password\n title: Contraseña RabbitMQ\n default: \"R@bbiTmq!2025xYz\"\n - id: public_url\n type: string\n title: URL pública\n default: \"http://{{hostname}}:8080\"\n\n# Nota: este archivo es solo metadatos y ejemplo. El motor de plantillas de Easypanel\n# usa además un archivo TypeScript (`index.ts`) para generar artefactos dinámicos.\n",
|
|
"files": [
|
|
{
|
|
"path": "README.easypanel.md",
|
|
"encoding": "utf8",
|
|
"content": "Plantilla EasyPanel para LibreTime\n\nPasos rápidos:\n\n1) Copia la carpeta `easypanel-template-libretime` a un repositorio nuevo o en tu instancia de EasyPanel.\n2) Si usas el Playground de EasyPanel (`npm run dev` en https://github.com/easypanel-io/templates), duplica una plantilla existente y ajusta `meta.yaml` e `index.ts`.\n3) Desde el panel EasyPanel puedes crear una plantilla usando el JSON generado por `index.ts` o subiendo los archivos.\n\nCómo instalar un template personalizado en EasyPanel (resumen):\n- En la UI de EasyPanel ve a \"Templates\" -> \"Create from JSON\" y pega el JSON del template (o sube el ZIP con los archivos generados).\n- Alternativamente, añade la carpeta al repositorio oficial de templates y abre un Pull Request siguiendo las pautas en https://github.com/easypanel-io/templates.\n\nNotas de seguridad:\n- Sustituye contraseñas por secretos gestionados o variables del entorno en producción.\n- No uses `latest` en imágenes en producción; fija versiones.\n"
|
|
},
|
|
{
|
|
"path": "docker/nginx/default.conf",
|
|
"encoding": "utf8",
|
|
"content": "server {\n listen 8080;\n listen [::]:8080;\n\n root /var/www/html/public;\n\n index index.php index.html index.htm;\n\n client_max_body_size 512M;\n client_body_timeout 300s;\n\n location ~ \\.php$ {\n fastcgi_buffers 64 4K;\n fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n\n try_files $fastcgi_script_name =404;\n\n include fastcgi_params;\n\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n set $path_info $fastcgi_path_info;\n fastcgi_param PATH_INFO $path_info;\n include fastcgi_params;\n\n fastcgi_index index.php;\n fastcgi_pass legacy:9000;\n }\n\n location / {\n try_files $uri $uri/ /index.php$is_args$args;\n }\n\n location ^~ /api/_media {\n internal;\n alias /srv/libretime;\n }\n\n location ^~ /api/version {\n return 307 /api/v2/version;\n }\n\n location ^~ /api/version/ {\n return 307 /api/v2/version;\n }\n\n location = /api/register-component {\n try_files $uri $uri/ /index.php$is_args$args;\n }\n\n location = /api/register-component/ {\n try_files $uri $uri/ /index.php$is_args$args;\n }\n\n location /api/ {\n proxy_set_header Host $http_host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_redirect off;\n proxy_pass http://api:9001;\n }\n\n location ~ ^/api/(v2|browser) {\n proxy_set_header Host $http_host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n\n proxy_redirect off;\n proxy_pass http://api:9001;\n }\n}\n"
|
|
},
|
|
{
|
|
"path": "docker-compose.yml",
|
|
"encoding": "utf8",
|
|
"content": "version: '3.8'\nservices:\n postgres:\n image: postgres:15\n restart: unless-stopped\n environment:\n POSTGRES_USER: ${POSTGRES_USER:-libretime}\n POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-libretime}\n POSTGRES_DB: ${POSTGRES_DB:-libretime}\n volumes:\n - postgres_data:/var/lib/postgresql/data\n\n rabbitmq:\n image: rabbitmq:3.13-alpine\n restart: unless-stopped\n environment:\n RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_DEFAULT_VHOST:-/libretime}\n RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER:-libretime}\n RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS:-libretime}\n\n api:\n image: ghcr.io/libretime/libretime-api:${LIBRETIME_VERSION:-4.5}\n restart: unless-stopped\n init: true\n ulimits:\n nofile: 1024\n depends_on:\n postgres:\n condition: service_healthy\n rabbitmq:\n condition: service_healthy\n environment:\n LIBRETIME_GENERAL_PUBLIC_URL: ${LIBRETIME_GENERAL_PUBLIC_URL:-http://localhost:8080}\n volumes:\n - ${LIBRETIME_CONFIG_FILEPATH:-./config.local.yml}:/etc/libretime/config.yml:ro\n - libretime_storage:/srv/libretime\n\n legacy:\n image: ghcr.io/libretime/libretime-legacy:${LIBRETIME_VERSION:-4.5}\n restart: unless-stopped\n init: true\n ulimits:\n nofile: 1024\n depends_on:\n postgres:\n condition: service_healthy\n rabbitmq:\n condition: service_healthy\n volumes:\n - ${LIBRETIME_CONFIG_FILEPATH:-./config.local.yml}:/etc/libretime/config.yml:ro\n - libretime_storage:/srv/libretime\n\n nginx:\n image: ghcr.io/libretime/libretime-nginx:${LIBRETIME_VERSION:-4.5}\n restart: unless-stopped\n depends_on:\n - legacy\n - api\n ports:\n - \"${NGINX_PORT:-8080}:8080\"\n volumes:\n - libretime_storage:/srv/libretime:ro\n - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro\n environment:\n - NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-auto}\n\n icecast:\n image: ghcr.io/libretime/icecast:2.4.4\n restart: unless-stopped\n ports:\n - \"${ICECAST_PORT:-8000}:8000\"\n environment:\n ICECAST_SOURCE_PASSWORD: ${ICECAST_SOURCE_PASSWORD:-hackme}\n ICECAST_ADMIN_PASSWORD: ${ICECAST_ADMIN_PASSWORD:-hackme}\n ICECAST_RELAY_PASSWORD: ${ICECAST_RELAY_PASSWORD:-hackme}\n ICECAST_ADMIN_USER: ${ICECAST_ADMIN_USER:-admin}\n ICECAST_HOSTNAME: ${ICECAST_HOSTNAME:-localhost}\n\n playout:\n image: ghcr.io/libretime/libretime-playout:${LIBRETIME_VERSION:-4.5}\n restart: unless-stopped\n init: true\n ulimits:\n nofile: 1024\n depends_on:\n rabbitmq:\n condition: service_healthy\n volumes:\n - ${LIBRETIME_CONFIG_FILEPATH:-./config.local.yml}:/etc/libretime/config.yml:ro\n - libretime_playout:/app\n environment:\n LIBRETIME_GENERAL_PUBLIC_URL: ${LIBRETIME_GENERAL_PUBLIC_URL:-http://localhost:8080}\n\n liquidsoap:\n image: ghcr.io/libretime/libretime-playout:${LIBRETIME_VERSION:-4.5}\n command: /usr/local/bin/libretime-liquidsoap\n restart: unless-stopped\n init: true\n ulimits:\n nofile: 1024\n depends_on:\n rabbitmq:\n condition: service_healthy\n ports:\n - \"${LIQUIDSOAP_HARBOR_PORT:-8001}:8001\"\n - \"${LIQUIDSOAP_TELNET_PORT:-8002}:8002\"\n volumes:\n - ${LIBRETIME_CONFIG_FILEPATH:-./config.local.yml}:/etc/libretime/config.yml:ro\n - libretime_playout:/app\n environment:\n LIBRETIME_GENERAL_PUBLIC_URL: ${LIBRETIME_GENERAL_PUBLIC_URL:-http://localhost:8080}\n\n worker:\n image: ghcr.io/libretime/libretime-worker:${LIBRETIME_VERSION:-4.5}\n restart: unless-stopped\n init: true\n ulimits:\n nofile: 1024\n depends_on:\n rabbitmq:\n condition: service_healthy\n volumes:\n - ./config.local.yml:/etc/libretime/config.yml:ro\n - libretime_storage:/srv/libretime\n environment:\n LIBRETIME_GENERAL_PUBLIC_URL: ${LIBRETIME_GENERAL_PUBLIC_URL:-http://localhost:8080}\n\n analyzer:\n image: ghcr.io/libretime/libretime-analyzer:${LIBRETIME_VERSION:-4.5}\n restart: unless-stopped\n init: true\n ulimits:\n nofile: 1024\n depends_on:\n rabbitmq:\n condition: service_healthy\n volumes:\n - ./config.local.yml:/etc/libretime/config.yml:ro\n - libretime_storage:/srv/libretime\n\nvolumes:\n postgres_data:\n driver: local\n libretime_storage:\n driver: local\n libretime_playout:\n driver: local\n\nnetworks:\n default:\n name: libretime_network\n"
|
|
},
|
|
{
|
|
"path": "docker_nginx_default.conf",
|
|
"encoding": "utf8",
|
|
"content": "server {\n listen 8080;\n listen [::]:8080;\n\n root /var/www/html/public;\n\n index index.php index.html index.htm;\n\n client_max_body_size 512M;\n client_body_timeout 300s;\n\n location ~ \\.php$ {\n fastcgi_buffers 64 4K;\n fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n\n #try_files $uri =404;\n try_files $fastcgi_script_name =404;\n\n include fastcgi_params;\n\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n set $path_info $fastcgi_path_info;\n fastcgi_param PATH_INFO $path_info;\n include fastcgi_params;\n\n fastcgi_index index.php;\n fastcgi_pass legacy:9000;\n }\n\n location / {\n try_files $uri $uri/ /index.php$is_args$args;\n }\n\n location ^~ /api/_media {\n internal;\n alias /srv/libretime;\n }\n\n location ^~ /api/version {\n return 307 /api/v2/version;\n }\n\n location ^~ /api/version/ {\n return 307 /api/v2/version;\n }\n\n location = /api/register-component {\n try_files $uri $uri/ /index.php$is_args$args;\n }\n\n location = /api/register-component/ {\n try_files $uri $uri/ /index.php$is_args$args;\n }\n\n location /api/ {\n proxy_set_header Host $http_host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_redirect off;\n proxy_pass http://api:9001;\n }\n\n location ~ ^/api/(v2|browser) {\n proxy_set_header Host $http_host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n\n proxy_redirect off;\n proxy_pass http://api:9001;\n }\n}\n"
|
|
},
|
|
{
|
|
"path": "index.ts",
|
|
"encoding": "utf8",
|
|
"content": "// Minimal EasyPanel template generator that emits the canonical docker-compose\n// and an .env file. This follows the standard LibreTime Docker deployment and\n// does not add any extra services (e.g. composer).\n\nimport { Template } from '@easypanel/template-sdk';\nconst fs = require('fs');\n\nconst t: Template = {\n meta: require('./meta.yaml'),\n render: (values: any) => {\n const composePath = './docker-compose.yml';\n let composeContent = '';\n try {\n composeContent = fs.readFileSync(composePath, 'utf8');\n } catch (e) {\n composeContent = '# docker-compose source not found: ' + composePath + '\\n';\n }\n\n const env = `POSTGRES_PASSWORD=${values.postgres_password || ''}\\nRABBITMQ_DEFAULT_PASS=${values.rabbitmq_password || ''}\\nLIBRETIME_GENERAL_PUBLIC_URL=${values.public_url || 'http://{{hostname}}:8080'}\\n`;\n\n let nginxConf = '';\n try {\n nginxConf = fs.readFileSync('./docker/nginx/default.conf', 'utf8');\n } catch (e) {\n nginxConf = '';\n }\n\n return {\n files: [\n { path: 'docker-compose.yml', content: composeContent },\n { path: '.env', content: env },\n { path: 'docker/nginx/default.conf', content: nginxConf },\n ],\n };\n },\n};\n\nexport default t;\n"
|
|
},
|
|
{
|
|
"path": "logo.png",
|
|
"encoding": "utf8",
|
|
"content": "iVBORw0KGgoAAAANSUhEUgAAAAUA\n"
|
|
},
|
|
{
|
|
"path": "meta.ts",
|
|
"encoding": "utf8",
|
|
"content": "// meta.ts is generated by the template tooling from meta.yaml. It's included as a placeholder.\nexport default require('./meta.yaml');\n"
|
|
},
|
|
{
|
|
"path": "meta.yaml",
|
|
"encoding": "utf8",
|
|
"content": "name: libretime\ntitle: LibreTime (EasyPanel)\ndescription: \"Plantilla para desplegar LibreTime usando docker-compose adaptado a EasyPanel. Incluye variables para credenciales y el archivo de configuración montado.\"\nversion: \"1.0.0\"\nauthor: \"Tu nombre\"\nlogo: logo.png\nscreenshot: screenshot.png\ntags:\n - media\n - radio\n - docker\n - libretime\n\n# Formulario que EasyPanel mostrará al crear una instancia desde la plantilla.\nform:\n - id: postgres_password\n type: password\n title: Contraseña Postgres\n default: \"P@5sW0rd!8xYv7Q2z9L\"\n - id: rabbitmq_password\n type: password\n title: Contraseña RabbitMQ\n default: \"R@bbiTmq!2025xYz\"\n - id: public_url\n type: string\n title: URL pública\n default: \"http://{{hostname}}:8080\"\n\n# Nota: este archivo es solo metadatos y ejemplo. El motor de plantillas de Easypanel\n# usa además un archivo TypeScript (`index.ts`) para generar artefactos dinámicos.\n"
|
|
},
|
|
{
|
|
"path": "screenshot.png",
|
|
"encoding": "utf8",
|
|
"content": "iVBORw0KGgoAAAANSUhEUgAAAAUA\n"
|
|
}
|
|
]
|
|
} |