├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── README_es.md ├── SetupAcestream.bat ├── SetupAcestream_es.bat ├── config ├── acestream.conf ├── entrypoint.sh └── requirements.txt ├── docker-compose.yml ├── resources └── acestream.tar.gz └── web ├── favicon.ico └── player.html /.gitignore: -------------------------------------------------------------------------------- 1 | # IntelliJ project files 2 | .idea 3 | *.iml 4 | out 5 | gen 6 | .cursor/ 7 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Use the official Ubuntu 22.04 LTS (Jammy Jellyfish) base image 2 | FROM ubuntu:22.04 3 | 4 | # Define environment variables for encoding and app configuration 5 | ENV LANG=C.UTF-8 6 | ENV LC_ALL=C.UTF-8 7 | ENV ACESTREAM_VERSION="acestream_3.2.3_ubuntu_22.04_x86_64_py3.10.tar.gz" 8 | ENV INTERNAL_IP="127.0.0.1" 9 | ENV HTTP_PORT="6878" 10 | ENV HTTPS_PORT="6879" 11 | 12 | # Install all system and Python dependencies in a single layer 13 | RUN apt-get update && apt-get install -y --no-install-recommends \ 14 | # Basic tools 15 | wget procps dos2unix \ 16 | # Python environment 17 | python3 libpython3.10 python3-pip python3-setuptools python3-wheel \ 18 | python3-greenlet python3-gevent python3-psutil python3-simplejson \ 19 | # Build tools for Python modules 20 | build-essential python3-dev libsqlite3-dev libxml2-dev libxslt1-dev \ 21 | && pip install --no-cache-dir \ 22 | # Python modules required by Acestream 23 | apsw lxml PyNaCl requests pycryptodome isodate \ 24 | && rm -rf /var/lib/apt/lists/* 25 | 26 | # Copy the entrypoint script, fix line endings, and grant execute permissions 27 | COPY config/entrypoint.sh /entrypoint.sh 28 | RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh 29 | 30 | # Copy and extract Acestream from the local archive 31 | COPY resources/acestream.tar.gz /tmp/acestream.tar.gz 32 | RUN mkdir -p /opt/acestream && \ 33 | tar --extract --gzip --directory /opt/acestream --file /tmp/acestream.tar.gz && \ 34 | rm /tmp/acestream.tar.gz 35 | 36 | # Overwrite the default web player with the custom version 37 | COPY web/player.html /opt/acestream/data/webui/html/player.html 38 | 39 | # Copy the Acestream configuration file 40 | COPY config/acestream.conf /opt/acestream/acestream.conf 41 | 42 | # Expose the default Acestream port 43 | EXPOSE 6878 44 | 45 | # Entrypoint for the container 46 | ENTRYPOINT ["/entrypoint.sh"] 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Sergio Márquez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dockerized Acestream 2 | 3 | [Leer documentación en Español](README_es.md) 4 | 5 | This project deploys Acestream within a Docker container using Ubuntu 22.04 and Python 3.10 for compatibility. 6 | 7 | Acestream is a platform for live streaming via peer-to-peer networks. Dockerizing Acestream simplifies its setup and provides isolated environments. 8 | 9 | ## Prerequisites 10 | 11 | 1. **Docker Installation**: Ensure Docker Desktop is installed on your system. 12 | - [Docker Products Page](https://www.docker.com/products/docker-desktop) 13 | - [Official Documentation](https://docs.docker.com/get-docker/) 14 | 15 | ## Automatic Installation and Execution with Setup Scripts (Windows) 16 | 17 | ### Language Selection 18 | Choose the setup script based on your preferred language: 19 | 20 | - **🇺🇸 English**: Use `SetupAcestream.bat` 21 | - **🇪🇸 Español**: Use `SetupAcestream_es.bat` 22 | 23 | Both scripts have **identical functionality** and only differ in the interface language. 24 | 25 | ### Script Overview 26 | The setup scripts automate the following tasks: 27 | 28 | - Checking for Docker installation and operational status. 29 | - Downloading the latest Acestream Docker image. 30 | - Setting up the container with dynamic port assignment (to avoid conflicts). 31 | - Updating the `docker-compose.yml` file dynamically based on the available ports. 32 | - Starting the Acestream container and opening the web interface. 33 | 34 | ### Usage 35 | 1. **Choose your language**: Download either `SetupAcestream.bat` (English) or `SetupAcestream_es.bat` (Spanish) 36 | 2. **Run as Administrator**: Right-click the chosen script and select "Run as Administrator" 37 | 3. **Follow prompts**: The script will guide you through the setup process 38 | 39 | > **Note:** The script ensures the latest Acestream Docker image is used and that the container management is handled 40 | > efficiently. 41 | 42 | ## Building the Image 43 | 44 | This project uses the **ubuntu:22.04** base image. You must clone the project first. Then, to build the image, use: 45 | 46 | ```bash 47 | docker build --no-cache -t docker-acestream . 48 | ``` 49 | 50 | ## Running the Container 51 | 52 | To start a container and run Acestream with dynamic port assignment: 53 | 54 | ```bash 55 | docker run --name docker-acestream -d -p 6878:6878 -e INTERNAL_IP=127.0.0.1 --restart unless-stopped docker-acestream 56 | ``` 57 | 58 | The `SetupAcestream.bat` script handles the dynamic assignment of ports to prevent conflicts when running multiple 59 | instances. 60 | 61 | ## Docker Compose 62 | 63 | 1. **Start the Container**: Use `docker-compose` to start the container: 64 | 65 | ```bash 66 | docker-compose up -d 67 | ``` 68 | 69 | 2. **Update the Image**: To get the latest image version: 70 | 71 | ```bash 72 | docker-compose pull && docker-compose up -d 73 | ``` 74 | 75 | ## Accessing the Web Interface 76 | 77 | Access Acestream via the web interface. The `SetupAcestream.bat` script automatically opens the correct URL based on the 78 | assigned port: 79 | 80 | ```plaintext 81 | http://:/webui/player/ 82 | ``` 83 | 84 | You can load Acestream links directly in the provided input field. 85 | 86 | ## Verifying Container Health 87 | 88 | Check the health status of the Acestream container: 89 | 90 | ```bash 91 | docker inspect --format='{{json .State.Health}}' docker-acestream 92 | ``` 93 | 94 | Alternatively, use the web interface: 95 | 96 | ```plaintext 97 | http://:/webui/api/service?method=get_version 98 | ``` 99 | 100 | ## Customization 101 | 102 | ### Dynamic Port Assignment 103 | 104 | The project includes dynamic port assignment for both HTTP and HTTPS ports to prevent conflicts when running multiple 105 | instances. This is handled in the `SetupAcestream.bat` script. 106 | 107 | ### Web Interface Configuration 108 | 109 | The `player.html` file is dynamically updated with the correct IP address and port during the container startup process. 110 | This ensures that the web interface points to the correct Acestream engine instance. 111 | 112 | ## Environment Variables 113 | 114 | | Variable | Description | Default | 115 | |----------|-------------|---------| 116 | | INTERNAL_IP | IP address used by the player and engine to bind as the advertised endpoint. | 127.0.0.1 | 117 | | HTTP_PORT | Port exposed for HTTP traffic inside the container. | 6878 | 118 | | HTTPS_PORT | Port exposed for HTTPS traffic inside the container. | 6879 | 119 | 120 | ## Key Features 121 | 122 | - One-click Windows setup scripts with automatic Docker image download and dynamic port assignment. 123 | - Pre-configured `acestream.conf` with production-ready limits for concurrent peers and robust caching. 124 | - Hardened startup script (`entrypoint.sh`) that validates environment variables and outputs detailed diagnostics. 125 | - Automatic patch of `player.html` so the web UI always points to the correct IP and port. 126 | - Multi-instance support: launch several containers simultaneously without port clashes. 127 | - Offline builds thanks to the bundled `resources/acestream.tar.gz` archive (no external downloads required). 128 | - Built-in **port conflict detection**: if the default port `6878` is already occupied (e.g. by the desktop Acestream Player), the Windows setup script automatically picks the next free even port. 129 | - Optional `--auto-clean` flag: after pulling a newer image the script can safely delete outdated Acestream container images to keep your Docker host tidy. 130 | 131 | ## Troubleshooting & Tips 132 | 133 | - Ensure the ports selected by the Windows script are **open in your firewall**. 134 | - If you see "port already in use" errors, the script should automatically switch to the next free port — verify the final port printed in the console. 135 | - For Linux/macOS usage set `INTERNAL_IP`, `HTTP_PORT`, and `HTTPS_PORT` accordingly when running `docker run` or `docker-compose`. 136 | - Use `--auto-clean` with the setup script to automatically remove obsolete Acestream images after an update (or answer *Y* when prompted). 137 | - View real-time logs with `docker logs -f ` to diagnose engine issues. 138 | - The engine writes additional debug information when the `--log-debug` flag is enabled in `acestream.conf`. 139 | 140 | ## Legal Notice 141 | 142 | This repository only distributes automation scripts. The Acestream binary blob is provided for **personal, educational or research purposes**. 143 | You are solely responsible for ensuring that your usage complies with all applicable laws and regulations. 144 | 145 | ## Contributions 146 | 147 | We welcome contributions. Fork, make changes, and submit a pull request for review. 148 | 149 | ## License 150 | 151 | This project is under the MIT License. See [LICENSE](LICENSE) for more details. 152 | -------------------------------------------------------------------------------- /README_es.md: -------------------------------------------------------------------------------- 1 | # Acestream Dockerizado 2 | 3 | [Read documentation in English](README.md) 4 | 5 | Este proyecto despliega Acestream dentro de un contenedor Docker usando Ubuntu 22.04 y Python 3.10 para garantizar la 6 | compatibilidad. 7 | 8 | Acestream es una plataforma para streaming en vivo a través de redes peer-to-peer. Dockerizar Acestream simplifica su 9 | configuración y proporciona entornos aislados. 10 | 11 | ## Requisitos Previos 12 | 13 | 1. **Instalación de Docker**: Asegúrate de que Docker Desktop esté instalado en tu sistema. 14 | - [Página de productos de Docker](https://www.docker.com/products/docker-desktop) 15 | - [Documentación Oficial](https://docs.docker.com/get-docker/) 16 | 17 | ## Instalación Automática y Ejecución con Scripts de Configuración (Windows) 18 | 19 | ### Selección de Idioma 20 | Elige el script de configuración según tu idioma preferido: 21 | 22 | - **🇺🇸 English**: Usa `SetupAcestream.bat` 23 | - **🇪🇸 Español**: Usa `SetupAcestream_es.bat` 24 | 25 | Ambos scripts tienen **funcionalidad idéntica** y solo difieren en el idioma de la interfaz. 26 | 27 | ### Descripción del Script 28 | Los scripts de configuración automatizan las siguientes tareas: 29 | 30 | - Verificación de la instalación y estado operativo de Docker. 31 | - Descarga de la imagen Docker más reciente de Acestream. 32 | - Configuración del contenedor con asignación dinámica de puertos (para evitar conflictos). 33 | - Actualización del archivo `docker-compose.yml` de forma dinámica según los puertos disponibles. 34 | - Inicio del contenedor Acestream y apertura de la interfaz web. 35 | 36 | ### Uso 37 | 1. **Elige tu idioma**: Descarga `SetupAcestream.bat` (inglés) o `SetupAcestream_es.bat` (español) 38 | 2. **Ejecutar como Administrador**: Haz clic derecho en el script elegido y selecciona "Ejecutar como administrador" 39 | 3. **Seguir las instrucciones**: El script te guiará a través del proceso de configuración 40 | 41 | > **Nota:** El script garantiza que se utilice la imagen Docker más reciente de Acestream y que la gestión del 42 | > contenedor se maneje de manera eficiente. 43 | 44 | ## Construir la Imagen 45 | 46 | Este proyecto utiliza la imagen base **ubuntu:22.04**. Debes clonar el proyecto completo primero. Luego, para construir 47 | la imagen, utiliza: 48 | 49 | ```bash 50 | docker build --no-cache -t docker-acestream . 51 | ``` 52 | 53 | ## Ejecutar el Contenedor 54 | 55 | Para iniciar un contenedor y ejecutar Acestream con asignación dinámica de puertos: 56 | 57 | ```bash 58 | docker run --name docker-acestream -d -p 6878:6878 -e INTERNAL_IP=127.0.0.1 --restart unless-stopped docker-acestream 59 | ``` 60 | 61 | El script `SetupAcestream.bat` maneja la asignación dinámica de puertos para evitar conflictos al ejecutar múltiples 62 | instancias. 63 | 64 | ## Docker Compose 65 | 66 | 1. **Iniciar el Contenedor**: Usa `docker-compose` para iniciar el contenedor: 67 | 68 | ```bash 69 | docker-compose up -d 70 | ``` 71 | 72 | 2. **Actualizar la Imagen**: Para obtener la última versión de la imagen: 73 | 74 | ```bash 75 | docker-compose pull && docker-compose up -d 76 | ``` 77 | 78 | ## Acceder a la Interfaz Web 79 | 80 | Accede a Acestream a través de la interfaz web. El script `SetupAcestream.bat` abre automáticamente la URL correcta 81 | basada en el puerto asignado: 82 | 83 | ```plaintext 84 | http://:/webui/player/ 85 | ``` 86 | 87 | Puedes cargar enlaces de Acestream directamente en el campo de entrada proporcionado. 88 | 89 | ## Verificar la Salud del Contenedor 90 | 91 | Verifica el estado de salud del contenedor de Acestream: 92 | 93 | ```bash 94 | docker inspect --format='{{json .State.Health}}' docker-acestream 95 | ``` 96 | 97 | Alternativamente, utiliza la interfaz web: 98 | 99 | ```plaintext 100 | http://:/webui/api/service?method=get_version 101 | ``` 102 | 103 | ## Personalización 104 | 105 | ### Asignación Dinámica de Puertos 106 | 107 | El proyecto incluye la asignación dinámica de puertos tanto para HTTP como para HTTPS para evitar conflictos al ejecutar 108 | múltiples instancias. Esto se maneja en el script `SetupAcestream.bat`. 109 | 110 | ### Configuración de la Interfaz Web 111 | 112 | El archivo `player.html` se actualiza dinámicamente con la dirección IP y el puerto correctos durante el proceso de 113 | inicio del contenedor. Esto asegura que la interfaz web apunte a la instancia correcta del motor de Acestream. 114 | 115 | ## Variables de Entorno 116 | 117 | | Variable | Descripción | Valor por defecto | 118 | |----------|-------------|-------------------| 119 | | INTERNAL_IP | Dirección IP que usan el reproductor y el motor como endpoint anunciado. | 127.0.0.1 | 120 | | HTTP_PORT | Puerto expuesto para tráfico HTTP dentro del contenedor. | 6878 | 121 | | HTTPS_PORT | Puerto expuesto para tráfico HTTPS dentro del contenedor. | 6879 | 122 | 123 | ## Características Principales 124 | 125 | - Scripts de instalación en Windows de un solo clic con descarga automática de la imagen Docker y asignación dinámica de puertos. 126 | - `acestream.conf` preconfigurado con límites de concurrencia y caché adecuados para producción. 127 | - Script de arranque reforzado (`entrypoint.sh`) que valida variables de entorno y muestra diagnósticos detallados. 128 | - Parche automático de `player.html` para que la interfaz web siempre apunte a la IP y puerto correctos. 129 | - Soporte multi-instancia: puedes lanzar varios contenedores simultáneamente sin conflictos de puertos. 130 | - Construcciones offline gracias al archivo `resources/acestream.tar.gz` incluido (no se requieren descargas externas). 131 | - **Detección automática de conflictos de puertos**: si el puerto por defecto `6878` está ocupado (por ejemplo, por Acestream Player de escritorio), el script de Windows asigna el siguiente puerto par libre. 132 | - Flag opcional `--auto-clean`: tras descargar una nueva imagen, el script puede eliminar de forma segura las imágenes antiguas de Acestream para mantener limpio tu host Docker. 133 | 134 | ## Solución de Problemas y Consejos 135 | 136 | - Asegúrate de que los puertos seleccionados por el script de Windows estén **abiertos en tu firewall**. 137 | - Si aparece el mensaje "puerto ya en uso", el script cambiará automáticamente al siguiente puerto libre — verifica el puerto final mostrado en consola. 138 | - Para uso en Linux/macOS establece `INTERNAL_IP`, `HTTP_PORT` y `HTTPS_PORT` al ejecutar `docker run` o `docker-compose`. 139 | - Utiliza `--auto-clean` con el script para eliminar automáticamente imágenes obsoletas de Acestream tras una actualización (o responde *S* cuando se solicite). 140 | - Visualiza los registros en tiempo real con `docker logs -f ` para diagnosticar problemas del motor. 141 | - El motor escribe información de depuración adicional cuando la opción `--log-debug` está habilitada en `acestream.conf`. 142 | 143 | ## Aviso Legal 144 | 145 | Este repositorio solo distribuye scripts de automatización. El binario de Acestream se proporciona para **uso personal, educativo o de investigación**. 146 | Eres el único responsable de garantizar que tu uso cumpla con todas las leyes y regulaciones aplicables. 147 | 148 | ## Contribuciones 149 | 150 | Agradecemos las contribuciones. Haz un fork, realiza cambios y envía un pull request para revisión. 151 | 152 | ## Licencia 153 | 154 | Este proyecto está bajo la licencia MIT. Consulta el archivo [LICENSE](LICENSE) para más detalles. 155 | -------------------------------------------------------------------------------- /SetupAcestream.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION 3 | 4 | :: ------------------------- 5 | :: Definition of constants for the script configuration. 6 | :: ------------------------- 7 | set "IMAGE_NAME=smarquezp/docker-acestream-ubuntu-home:latest" 8 | set "INTERNAL_IP=127.0.0.1" 9 | set "PORT_BASE=6878" 10 | set "SERVICE_NAME_BASE=acestream_" 11 | set "DOCKER_COMPOSE_FILE=docker-compose.yml" 12 | set "PREFIX=acestream://" 13 | set "HTTP_PORT_BASE=6878" 14 | set "HTTPS_PORT_BASE=6879" 15 | :: ------------------------- 16 | :: Parse command line arguments for optional flags 17 | :: ------------------------- 18 | set "AUTO_CLEAN=false" 19 | for %%A in (%*) do ( 20 | if /I "%%A"=="--auto-clean" set "AUTO_CLEAN=true" 21 | ) 22 | :: ------------------------- 23 | :: Checking for Docker installation and operational status. 24 | :: ------------------------- 25 | :dockerCheck 26 | echo Checking Docker... 27 | docker --version >nul 2>&1 && docker info >nul 2>&1 || ( 28 | echo ERROR: Docker not found or not active. Please install and start Docker to continue. 29 | start https://www.docker.com/get-started/ 30 | pause 31 | goto dockerCheck 32 | ) 33 | echo Docker successfully verified and ready for use. 34 | 35 | :: ------------------------- 36 | :: Obtaining a non-loopback internal IP address. 37 | :: ------------------------- 38 | for /f "tokens=2 delims=:" %%a in ('ipconfig ^| findstr /C:"IPv4"') do ( 39 | set "IP_TEMP=%%a" 40 | set "IP_TEMP=!IP_TEMP: =!" 41 | if "!IP_TEMP!" NEQ "127.0.0.1" ( 42 | set "INTERNAL_IP=!IP_TEMP!" 43 | goto installAcestream 44 | ) 45 | ) 46 | 47 | :: ------------------------- 48 | :: Acestream and Docker configuration section. 49 | :: ------------------------- 50 | :installAcestream 51 | echo. 52 | echo [Acestream Installation on Docker] 53 | echo ---------------------------------------- 54 | echo Configuring the environment for Acestream... 55 | 56 | :: Requesting the user to validate or modify the detected IP address. 57 | echo. 58 | echo Internal IP address verification... 59 | echo Your current internal IP address is: %INTERNAL_IP% 60 | echo If this is correct, press ENTER. Otherwise, enter the correct IP and press ENTER. 61 | echo. 62 | set /p USER_IP=Enter the IP or press ENTER if it is correct: 63 | if not "%USER_IP%"=="" set "INTERNAL_IP=%USER_IP%" 64 | echo Using IP: %INTERNAL_IP% 65 | 66 | :: ------------------------- 67 | :: Dynamic port and service name assignment 68 | :: ------------------------- 69 | set "PORT=%PORT_BASE%" 70 | set "SERVICE_NAME=%SERVICE_NAME_BASE%%PORT%" 71 | set "HTTP_PORT=%HTTP_PORT_BASE%" 72 | set "HTTPS_PORT=%HTTPS_PORT_BASE%" 73 | 74 | :checkPort 75 | rem First, ensure the desired port is not already taken by another process (e.g., native Acestream Player) 76 | netstat -ano | findstr /R /C:":!PORT!\>" >nul 2>&1 77 | if !errorlevel! == 0 ( 78 | echo Port !PORT! is already occupied by another application. Trying the next port... 79 | set /a "PORT+=2" 80 | set /a "HTTP_PORT+=2" 81 | set /a "HTTPS_PORT+=2" 82 | set "SERVICE_NAME=%SERVICE_NAME_BASE%!PORT!" 83 | goto checkPort 84 | ) 85 | 86 | set CONTAINER_ID= 87 | for /f "tokens=*" %%i in ('docker ps -q --filter "name=!SERVICE_NAME!"') do set CONTAINER_ID=%%i 88 | 89 | if not defined CONTAINER_ID ( 90 | set /a "HTTPS_PORT+=1" 91 | echo Using port !PORT!, HTTP port !HTTP_PORT!, HTTPS port !HTTPS_PORT!, and service name !SERVICE_NAME!. 92 | ) else ( 93 | echo Port !PORT! is already in use. Trying the next port... 94 | set /a "PORT+=2" 95 | set /a "HTTP_PORT+=2" 96 | set /a "HTTPS_PORT+=2" 97 | set "SERVICE_NAME=%SERVICE_NAME_BASE%!PORT!" 98 | echo DEBUG: Now using port !PORT!, HTTP port !HTTP_PORT!, HTTPS port !HTTPS_PORT!, and service name !SERVICE_NAME!. 99 | goto checkPort 100 | ) 101 | 102 | :: ------------------------- 103 | :: Creation or update of the docker-compose.yml file. 104 | :: ------------------------- 105 | :startDocker 106 | docker stop !SERVICE_NAME! >NUL 2>&1 107 | docker rm !SERVICE_NAME! -f >NUL 2>&1 108 | echo. 109 | echo Creating or updating the docker-compose.yml file... 110 | >%DOCKER_COMPOSE_FILE% ( 111 | echo services: 112 | echo !SERVICE_NAME!: 113 | echo image: !IMAGE_NAME! 114 | echo container_name: !SERVICE_NAME! 115 | echo ports: 116 | echo - !PORT!:!PORT! 117 | echo environment: 118 | echo - INTERNAL_IP=!INTERNAL_IP! 119 | echo - HTTP_PORT=!HTTP_PORT! 120 | echo - HTTPS_PORT=!HTTPS_PORT! 121 | echo networks: 122 | echo default: 123 | echo driver: bridge 124 | ) 125 | echo. 126 | echo docker-compose.yml file created or updated successfully. 127 | 128 | :: Pull the latest image before starting the service 129 | echo Pulling the latest Docker image... 130 | docker-compose -f !DOCKER_COMPOSE_FILE! pull !SERVICE_NAME! 131 | 132 | :: === SAFE CLEANUP OF OUTDATED ACESTREAM IMAGES === 133 | echo Checking for outdated Acestream images... 134 | set "NEW_IMAGE_ID=" 135 | for /f "tokens=1" %%I in ('docker images %IMAGE_NAME% -q') do ( 136 | if not defined NEW_IMAGE_ID ( 137 | set "NEW_IMAGE_ID=%%I" 138 | ) else ( 139 | set "OLD_IMAGE_ID=%%I" 140 | if "!AUTO_CLEAN!"=="true" ( 141 | echo Auto-clean: removing obsolete image !OLD_IMAGE_ID! ... 142 | docker rmi -f !OLD_IMAGE_ID! >nul 2>&1 143 | ) else ( 144 | choice /M "Remove outdated image !OLD_IMAGE_ID!? (Y/N)" /C YN 145 | if !errorlevel! == 1 ( 146 | echo Removing image !OLD_IMAGE_ID! ... 147 | docker rmi -f !OLD_IMAGE_ID! 148 | ) else ( 149 | echo Skipped image !OLD_IMAGE_ID!. 150 | ) 151 | ) 152 | ) 153 | ) 154 | :: ------------------------- 155 | 156 | :: Attempt to start the service and handle errors in case of failure. 157 | echo Starting the Acestream service... 158 | docker-compose -f !DOCKER_COMPOSE_FILE! up -d !SERVICE_NAME! || ( 159 | echo ERROR: Could not start the Acestream service. Ensure the 'docker-compose.yml' file is correctly configured. 160 | pause 161 | goto startDocker 162 | ) 163 | echo Acestream service started successfully. 164 | 165 | echo Acestream container successfully launched on port: !PORT! using internal HTTP port: !HTTP_PORT!. 166 | echo. 167 | 168 | :: ------------------------- 169 | :: Starting the content playback in the browser. 170 | :: ------------------------- 171 | echo [Content Playback of Acestream] 172 | echo ---------------------------------------- 173 | echo The browser will open in 5 seconds to start playing the content. 174 | timeout /t 5 /nobreak >nul 175 | echo Preparing the Acestream stream playback... 176 | start http://!INTERNAL_IP!:!PORT!/webui/player/ 177 | 178 | :: ------------------------- 179 | :: Farewell message and script termination. 180 | :: ------------------------- 181 | echo. 182 | echo [Farewell] 183 | echo ------------------------------------------------------------- 184 | echo Thank you for using the Acestream x Docker setup assistant. 185 | echo We hope you enjoy an excellent streaming experience! 186 | echo @sergiomarquezdev 187 | echo ------------------------------------------------------------- 188 | echo Finalizing the script and restoring the environment... 189 | pause 190 | ENDLOCAL 191 | exit /b 192 | -------------------------------------------------------------------------------- /SetupAcestream_es.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION 3 | 4 | :: ------------------------- 5 | :: Definicion de constantes para la configuracion del script. 6 | :: ------------------------- 7 | set "IMAGE_NAME=smarquezp/docker-acestream-ubuntu-home:latest" 8 | set "INTERNAL_IP=127.0.0.1" 9 | set "PORT_BASE=6878" 10 | set "SERVICE_NAME_BASE=acestream_" 11 | set "DOCKER_COMPOSE_FILE=docker-compose.yml" 12 | set "PREFIX=acestream://" 13 | set "HTTP_PORT_BASE=6878" 14 | set "HTTPS_PORT_BASE=6879" 15 | 16 | :: ------------------------- 17 | :: Analizar argumentos de linea de comandos para flags opcionales 18 | :: ------------------------- 19 | set "AUTO_CLEAN=false" 20 | for %%A in (%*) do ( 21 | if /I "%%A"=="--auto-clean" set "AUTO_CLEAN=true" 22 | ) 23 | :: ------------------------- 24 | :: Verificacion de la instalacion y estado de funcionamiento de Docker. 25 | :: ------------------------- 26 | :dockerCheck 27 | echo Verificando Docker... 28 | docker --version >nul 2>&1 && docker info >nul 2>&1 || ( 29 | echo ERROR: Docker no encontrado o inactivo. Instala o inicia Docker y vuelve a intentar. 30 | start https://www.docker.com/get-started/ 31 | pause 32 | goto dockerCheck 33 | ) 34 | echo Docker verificado con exito y listo para su uso. 35 | 36 | :: ------------------------- 37 | :: Obtencion de una direccion IP interna no loopback. 38 | :: ------------------------- 39 | for /f "tokens=2 delims=:" %%a in ('ipconfig ^| findstr /C:"IPv4"') do ( 40 | set "IP_TEMP=%%a" 41 | set "IP_TEMP=!IP_TEMP: =!" 42 | if "!IP_TEMP!" NEQ "127.0.0.1" ( 43 | set "INTERNAL_IP=!IP_TEMP!" 44 | goto installAcestream 45 | ) 46 | ) 47 | 48 | :: ------------------------- 49 | :: Seccion de configuracion de Acestream y Docker. 50 | :: ------------------------- 51 | :installAcestream 52 | echo. 53 | echo [Instalacion de Acestream en Docker] 54 | echo ---------------------------------------- 55 | echo Configurando el entorno para Acestream... 56 | 57 | :: Solicitar al usuario que valide o modifique la direccion IP detectada. 58 | echo. 59 | echo Verificacion de la direccion IP interna... 60 | echo Tu direccion IP interna actual es: %INTERNAL_IP% 61 | echo Si esta es correcta, presiona ENTER. Si no, ingresa la IP correcta y presiona ENTER. 62 | echo. 63 | set /p USER_IP=Introduce la IP o presiona ENTER si es correcta: 64 | if not "%USER_IP%"=="" set "INTERNAL_IP=%USER_IP%" 65 | echo Usando IP: %INTERNAL_IP% 66 | 67 | :: ------------------------- 68 | :: Asignacion dinamica de puertos y nombre del servicio. 69 | :: ------------------------- 70 | set "PORT=%PORT_BASE%" 71 | set "SERVICE_NAME=%SERVICE_NAME_BASE%%PORT%" 72 | set "HTTP_PORT=%HTTP_PORT_BASE%" 73 | set "HTTPS_PORT=%HTTPS_PORT_BASE%" 74 | 75 | :checkPort 76 | rem Primero, verificar si el puerto deseado ya esta ocupado por otro proceso (p.ej. Acestream Player nativo) 77 | netstat -ano | findstr /R /C:":!PORT!\>" >nul 2>&1 78 | if !errorlevel! == 0 ( 79 | echo El puerto !PORT! esta ocupado por otra aplicacion. Probando con el siguiente puerto... 80 | set /a "PORT+=2" 81 | set /a "HTTP_PORT+=2" 82 | set /a "HTTPS_PORT+=2" 83 | set "SERVICE_NAME=%SERVICE_NAME_BASE%!PORT!" 84 | goto checkPort 85 | ) 86 | 87 | set CONTAINER_ID= 88 | for /f "tokens=*" %%i in ('docker ps -q --filter "name=!SERVICE_NAME!"') do set CONTAINER_ID=%%i 89 | 90 | if not defined CONTAINER_ID ( 91 | set /a "HTTPS_PORT+=1" 92 | echo Usando el puerto !PORT!, puerto HTTP !HTTP_PORT!, puerto HTTPS !HTTPS_PORT!, y el nombre del servicio !SERVICE_NAME!. 93 | ) else ( 94 | echo El puerto !PORT! ya esta en uso. Probando con el siguiente puerto... 95 | set /a "PORT+=2" 96 | set /a "HTTP_PORT+=2" 97 | set /a "HTTPS_PORT+=2" 98 | set "SERVICE_NAME=%SERVICE_NAME_BASE%!PORT!" 99 | echo DEBUG: Ahora usando el puerto !PORT!, puerto HTTP !HTTP_PORT!, puerto HTTPS !HTTPS_PORT!, y el nombre del servicio !SERVICE_NAME!. 100 | goto checkPort 101 | ) 102 | 103 | :: ------------------------- 104 | :: Creacion o actualizacion del archivo docker-compose.yml. 105 | :: ------------------------- 106 | :startDocker 107 | docker stop !SERVICE_NAME! >NUL 2>&1 108 | docker rm !SERVICE_NAME! -f >NUL 2>&1 109 | echo. 110 | echo Creando o actualizando el archivo docker-compose.yml... 111 | >%DOCKER_COMPOSE_FILE% ( 112 | echo services: 113 | echo !SERVICE_NAME!: 114 | echo image: !IMAGE_NAME! 115 | echo container_name: !SERVICE_NAME! 116 | echo ports: 117 | echo - !PORT!:!PORT! 118 | echo environment: 119 | echo - INTERNAL_IP=!INTERNAL_IP! 120 | echo - HTTP_PORT=!HTTP_PORT! 121 | echo - HTTPS_PORT=!HTTPS_PORT! 122 | echo networks: 123 | echo default: 124 | echo driver: bridge 125 | ) 126 | echo. 127 | echo Archivo docker-compose.yml creado o actualizado exitosamente. 128 | 129 | :: Descarga la imagen Docker mas actualizada antes de arrancar el servicio 130 | echo Descargando la imagen Docker mas actualizada... 131 | docker-compose -f !DOCKER_COMPOSE_FILE! pull !SERVICE_NAME! 132 | 133 | :: === LIMPIEZA SEGURA DE IMAGENES OBSOLETAS DE ACESTREAM === 134 | echo Comprobando imagenes obsoletas de Acestream... 135 | set "NEW_IMAGE_ID=" 136 | for /f "tokens=1" %%I in ('docker images %IMAGE_NAME% -q') do ( 137 | if not defined NEW_IMAGE_ID ( 138 | set "NEW_IMAGE_ID=%%I" 139 | ) else ( 140 | set "OLD_IMAGE_ID=%%I" 141 | if "!AUTO_CLEAN!"=="true" ( 142 | echo Auto-clean activado: eliminando imagen obsoleta !OLD_IMAGE_ID! ... 143 | docker rmi -f !OLD_IMAGE_ID! >nul 2>&1 144 | ) else ( 145 | choice /M "Eliminar imagen obsoleta !OLD_IMAGE_ID!? (S/N)" /C SN 146 | if !errorlevel! == 1 ( 147 | echo Eliminando imagen !OLD_IMAGE_ID! ... 148 | docker rmi -f !OLD_IMAGE_ID! 149 | ) else ( 150 | echo Imagen !OLD_IMAGE_ID! omitida. 151 | ) 152 | ) 153 | ) 154 | ) 155 | :: ------------------------- 156 | 157 | :: Intento de iniciar el servicio y manejo de errores en caso de fallo. 158 | echo Iniciando el servicio de Acestream... 159 | docker-compose -f !DOCKER_COMPOSE_FILE! up -d !SERVICE_NAME! || ( 160 | echo ERROR: No se pudo iniciar el servicio Acestream. Asegurate de que el archivo 'docker-compose.yml' este configurado correctamente. 161 | pause 162 | goto startDocker 163 | ) 164 | echo Servicio Acestream iniciado correctamente. 165 | 166 | echo Contenedor de Acestream iniciado con exito en el puerto: !PORT! usando el puerto HTTP interno: !HTTP_PORT!. 167 | echo. 168 | 169 | :: ------------------------- 170 | :: Iniciar la reproduccion de contenido en el navegador. 171 | :: ------------------------- 172 | echo [Reproduccion de Contenido Acestream] 173 | echo ---------------------------------------- 174 | echo El navegador se abrira en 5 segundos para reproducir el contenido seleccionado. 175 | timeout /t 5 /nobreak >nul 176 | echo Preparando la reproduccion del stream Acestream... 177 | start http://!INTERNAL_IP!:!PORT!/webui/player/ 178 | 179 | :: ------------------------- 180 | :: Mensaje de despedida y finalizacion del script. 181 | :: ------------------------- 182 | echo. 183 | echo [Despedida] 184 | echo ------------------------------------------------------------- 185 | echo Gracias por utilizar el asistente de configuracion de Acestream x Docker. 186 | echo Esperamos que disfrutes de una excelente experiencia de streaming! 187 | echo @sergiomarquezdev 188 | echo ------------------------------------------------------------- 189 | echo Finalizando el script y restaurando el entorno... 190 | pause 191 | ENDLOCAL 192 | exit /b 193 | -------------------------------------------------------------------------------- /config/acestream.conf: -------------------------------------------------------------------------------- 1 | # ================================================ 2 | # ACESTREAM ENGINE CONFIGURATION 3 | # Configuración completa para producción 4 | # ================================================ 5 | 6 | # === CONFIGURACIÓN BÁSICA === 7 | --allow-user-config 8 | --bind-all 9 | --client-console 10 | 11 | # === MÚLTIPLES CLIENTES Y CONCURRENCIA === 12 | # Corrige Issues #3 y #4 - problemas múltiples clientes 13 | --max-connections 1000 14 | --max-peers 50 15 | --max-upload-slots 7 16 | 17 | # === LOGGING Y DEBUGGING === 18 | # Corrige Issue #7 - fallos de carga de media 19 | --log-stdout 20 | --log-debug 355 21 | 22 | # === ESTABILIDAD Y RENDIMIENTO === 23 | --cache-limit 5 24 | --use-internal-buffering true 25 | 26 | # === CONFIGURACIÓN DE RED === 27 | --make-default-access-token true 28 | 29 | # === OPTIMIZACIÓN DE CONEXIONES === 30 | --cache-auto true 31 | -------------------------------------------------------------------------------- /config/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ================================================ 4 | # ACESTREAM DOCKER ENTRYPOINT 5 | # Mejorado con logging y manejo de errores 6 | # ================================================ 7 | 8 | set -e # Exit on any error 9 | 10 | # === LOGGING SETUP === 11 | echo "=== ACESTREAM DOCKER STARTUP ===" 12 | echo "Timestamp: $(date)" 13 | echo "Internal IP: ${INTERNAL_IP}" 14 | echo "HTTP Port: ${HTTP_PORT}" 15 | echo "HTTPS Port: ${HTTPS_PORT}" 16 | 17 | # === CONFIGURATION VALIDATION === 18 | echo "=== VALIDATING CONFIGURATION ===" 19 | 20 | # Validate required environment variables 21 | if [ -z "${INTERNAL_IP}" ]; then 22 | echo "ERROR: INTERNAL_IP environment variable not set" 23 | exit 1 24 | fi 25 | 26 | if [ -z "${HTTP_PORT}" ]; then 27 | echo "ERROR: HTTP_PORT environment variable not set" 28 | exit 1 29 | fi 30 | 31 | if [ -z "${HTTPS_PORT}" ]; then 32 | echo "ERROR: HTTPS_PORT environment variable not set" 33 | exit 1 34 | fi 35 | 36 | # Validate acestream.conf exists 37 | if [ ! -f "/opt/acestream/acestream.conf" ]; then 38 | echo "ERROR: acestream.conf not found" 39 | exit 1 40 | fi 41 | 42 | echo "Configuration validation: OK" 43 | 44 | # === PLAYER HTML CONFIGURATION === 45 | echo "=== CONFIGURING PLAYER HTML ===" 46 | if [ -f "/opt/acestream/data/webui/html/player.html" ]; then 47 | sed -i "s|http://127.0.0.1:6878/|http://${INTERNAL_IP}:${HTTP_PORT}/|g" /opt/acestream/data/webui/html/player.html 48 | echo "Player HTML configured successfully" 49 | else 50 | echo "WARNING: player.html not found, skipping configuration" 51 | fi 52 | 53 | # === ACESTREAM ENGINE STARTUP === 54 | echo "=== STARTING ACESTREAM ENGINE ===" 55 | echo "Command: /opt/acestream/start-engine --http-port ${HTTP_PORT} --https-port ${HTTPS_PORT} \"@/opt/acestream/acestream.conf\"" 56 | 57 | # Add error handling for engine startup 58 | if ! /opt/acestream/start-engine --http-port ${HTTP_PORT} --https-port ${HTTPS_PORT} "@/opt/acestream/acestream.conf"; then 59 | echo "ERROR: Failed to start Acestream engine" 60 | echo "Configuration file contents:" 61 | cat /opt/acestream/acestream.conf 62 | exit 1 63 | fi 64 | -------------------------------------------------------------------------------- /config/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | pycryptodome 3 | isodate 4 | lxml 5 | apsw 6 | PyNaCl 7 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | acestream: 3 | image: smarquezp/docker-acestream-ubuntu-home:latest 4 | container_name: acestream 5 | ports: 6 | - 6878:6878 7 | environment: 8 | - INTERNAL_IP=127.0.0.1 9 | - HTTP_PORT=6878 10 | - HTTPS_PORT=6879 11 | networks: 12 | default: 13 | driver: bridge 14 | -------------------------------------------------------------------------------- /resources/acestream.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiomarquezdev/acestream-docker-home/67fa1c62cd2dbe0815f8e7b6e092b5a66253174e/resources/acestream.tar.gz -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiomarquezdev/acestream-docker-home/67fa1c62cd2dbe0815f8e7b6e092b5a66253174e/web/favicon.ico -------------------------------------------------------------------------------- /web/player.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ace Link Player 7 | 9 | 10 | 191 | 192 | 193 | 194 |
195 |
196 | 201 | 203 | 205 | 207 | 208 |
209 | 210 | 216 | 217 |
218 |
219 |
220 |
221 | 222 | 223 |
224 |
225 | 238 | 244 |
245 |
246 |
247 |
248 | 249 | 250 | 407 | 408 | 409 | 410 | --------------------------------------------------------------------------------