Documentar el despliegue que existe de verdad - #39
Merged
Merged
Conversation
The docs still described an AWS EC2 deployment that was replaced three weeks ago, and some of what they told the reader to do was actively wrong — most of all the cookie-rotation ritual, which is no longer part of running this bot at all. `deploy/README.md` now leads with the real deployment: a self-hosted Linux box on a residential connection. The reason is spelled out, because it is not the obvious one — the move was not about cost. From a datacenter IP YouTube demanded a cookies file exported from a logged-in account, and those cookies expired every few weeks with a dead bot at the end of it. From a residential IP the same requests work with none, and time-to-first-byte measured 4.3s against 9.1s. The cloud path is kept rather than deleted: `launch_ec2.sh` still works, the EC2 is stopped rather than terminated, and someone reading this may not have a spare machine. It moves to the bottom with the datacenter-IP caveat attached. The YouTube section was the most misleading part. It credited cookies with defeating the bot check, when what actually fixed it was the player-client chain (#25) — `web_embedded` works and most clients yt-dlp offers are bot-checked, with the measured numbers to say so. Cookies are now documented as supported and unnecessary rather than as routine maintenance. A residential IP reduces the bot-checking; it does not remove it, and the docs no longer imply it does. Two operational notes are new, both learned the hard way this week: that daily unattended-upgrades restart the service and can do it while glibc — the DNS resolver — is mid-replacement, and that `TimeoutStopSec` has to stay above the voice connect timeout because discord.py reuses that value as the deadline for Discord to confirm a departure. The top-level README's test description had also drifted: it listed neither the read-ahead buffer, the generated help, the Genius client, nor the startup and shutdown behaviour, and it did not mention that some tests render audio through real FFmpeg and skip without it. Every claim was checked against the code rather than carried over: the player client chain, the memory cap, `Persistent=true` on the timer, what `setup.sh` installs, and that no Spotify references survive anywhere. No host details are included — no hostnames, users or addresses. This is a public repository and the deployment is somebody's home network. Closes #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cierra #23.
Solo documentación, cero cambios de código. Los docs seguían describiendo un
despliegue en AWS EC2 que se reemplazó hace tres semanas, y parte de lo que le
decían al lector estaba activamente mal — sobre todo la ceremonia de rotar
cookies, que ya no forma parte de operar este bot.
deploy/README.mdAhora arranca con el despliegue real: una máquina Linux propia en una conexión
residencial. El motivo va explícito, porque no es el evidente: la mudanza no
fue por coste. Desde una IP de datacenter YouTube exigía un archivo de cookies
exportado de una cuenta logueada, y esas cookies caducaban cada pocas semanas con
un bot muerto al final. Desde IP residencial las mismas peticiones funcionan sin
ninguna, y el TTFB midió 4,3 s contra 9,1 s.
El camino en la nube se conserva, no se borra:
launch_ec2.shsiguefuncionando, la EC2 está detenida y no terminada, y quien lea esto puede no tener
una máquina de sobra. Baja al final, con la advertencia de la IP de datacenter.
La sección de YouTube era la más engañosa
Atribuía a las cookies el mérito de superar el bot-check, cuando lo que
realmente lo arregló fue la cadena de player clients (#25). Ahora dice lo que
se midió:
web_embeddedmwebdefault,web,android_vr,tv,ios,android_musicLas cookies pasan a documentarse como soportadas e innecesarias, no como
mantenimiento rutinario. Y se aclara que una IP residencial reduce el
bot-checking pero no lo elimina — los docs ya no insinúan lo contrario.
Dos notas operativas nuevas
Ambas aprendidas a golpes esta semana:
—que es el resolver de DNS— está a medio reemplazar. Por eso el login
reintenta (El bot muere en el arranque si el DNS falla un momento #33/Reintentar el login para que un fallo de DNS no mate al bot #34).
TimeoutStopSectiene que quedar por encima del timeout de conexión de voz,porque discord.py reutiliza ese valor como plazo para que Discord confirme una
salida al cerrar. Con los dos al revés, systemd mata un apagado que iba a
terminar (Un reinicio tras reproducir música agota TimeoutStopSec y dispara una alerta falsa #35/Apagar dentro del tiempo que systemd concede #36).
README.mdLa descripción de los tests también había derivado: no mencionaba el buffer de
read-ahead, el
!helpgenerado, el cliente de Genius ni el comportamiento dearranque y apagado, y no avisaba de que algunos tests renderizan audio con
FFmpeg real y se saltan si no está instalado.
La sección de despliegue deja de decir "Deploy to AWS (~$6/mo)" y explica en dos
frases dónde corre de verdad y por qué.
Verificación
Cada afirmación se comprobó contra el código en vez de arrastrarse:
services/media.pyMemoryMax=768MyPersistent=truecontradeploy/install-units.shsetup.sh(ffmpeg, python3-venv, git, unzip, curl, Deno).env.example, los READMEni los scripts
No se incluye ningún dato del host — ni nombres de máquina, ni usuarios, ni
direcciones. Es un repositorio público y el despliegue está en la red doméstica de
alguien.
Los 343 tests siguen pasando; no se tocó código.