From 475830f15cefec750209403d6adb3b1895addfdc Mon Sep 17 00:00:00 2001 From: topi314 Date: Sat, 20 Jul 2024 12:30:04 +0200 Subject: [PATCH 01/10] fix dead docs link and add dark reader meta tag --- docs/api/rest.md | 2 +- docs/overrides/main.html | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api/rest.md b/docs/api/rest.md index 27daf6930..4f94fdd59 100644 --- a/docs/api/rest.md +++ b/docs/api/rest.md @@ -751,7 +751,7 @@ When `identifier` is used, Lavalink will try to resolve the identifier as a sing Response: -[Player](#Player) object +[Player](#player) object
Example Payload diff --git a/docs/overrides/main.html b/docs/overrides/main.html index af7d54ba8..ccacc1186 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -1,3 +1,7 @@ +{%- block extrahead -%} + +{%- endblock -%} + {% extends "base.html" %} {% block announce %} From c5b503f0c91d8a12c8dcc6f535c5116ccc3dec62 Mon Sep 17 00:00:00 2001 From: topi314 Date: Sun, 22 Sep 2024 13:57:40 +0200 Subject: [PATCH 02/10] update more detailed logging --- docs/getting-started/troubleshooting.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/getting-started/troubleshooting.md b/docs/getting-started/troubleshooting.md index 554892b2d..a555ce6ce 100644 --- a/docs/getting-started/troubleshooting.md +++ b/docs/getting-started/troubleshooting.md @@ -34,14 +34,15 @@ In general there are 6 log levels: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` and ```yaml title="application.yml" logging: level: - # Set this to DEBUG to enable more detailed logging. Please note that this will log probably spam your console. root: INFO # Set this to DEBUG to enable more detailed logging from Lavalink lavalink: DEBUG - # Set this to TRACE to see all WebSocket messages + # Set this to TRACE to see all WebSocket messages sent lavalink.server.io.SocketContext: TRACE # Log all track exceptions (COMMON, SUSPICIOUS & FAULT) com.sedmelluq.discord.lavaplayer.tools.ExceptionTools: DEBUG + # Log YouTube Plugin stuff (only needed if you have issues with YouTube) + dev.lavalink.youtube: DEBUG # This will log all requests to the REST API request: From 184367d9971e884c804045ef495f3493d10b8f1a Mon Sep 17 00:00:00 2001 From: topi314 Date: Sun, 13 Oct 2024 16:43:20 +0200 Subject: [PATCH 03/10] add mising changelog entries --- docs/changelog/v3.md | 11 +++++++++-- docs/changelog/v4.md | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/changelog/v3.md b/docs/changelog/v3.md index 0e2c009ed..bc7edde60 100644 --- a/docs/changelog/v3.md +++ b/docs/changelog/v3.md @@ -1,10 +1,17 @@ +## v3.7.13 +!!! danger + This is the last Lavalink `v3` release, see: https://github.com/lavalink-devs/Lavalink/discussions/1100 + +* Updated Lavaplayer to [`1.5.6`](https://github.com/lavalink-devs/lavaplayer/releases/tag/1.5.6) +* Updated koe to [`2.0.3-rc2`](https://github.com/KyokoBot/koe/releases/tag/2.0.3-rc2) & use voice gateway v8 in https://github.com/lavalink-devs/Lavalink/pull/1098 + ## v3.7.12 * Updated Lavaplayer to [`1.5.4`](https://github.com/lavalink-devs/lavaplayer/releases/tag/1.5.4) * Updated Koe to [`2.0.1`](https://github.com/KyokoBot/koe/releases/tag/2.0.1) (fixes the `IndexOutOfBoundsException` when playing a YouTube track) !!! warning - The default Youtube source is now deprecated and won't receive further updates. Please use https://github.com/lavalink-devs/youtube-source#plugin instead. + The default Youtube source is now deprecated and won't receive further updates. Please use https://github.com/lavalink-devs/youtube-source#plugin instead. ## v3.7.11 * Fixed not being able to seek when player is paused @@ -42,7 +49,7 @@ !!! info - Lavalink Docker images are now found in the GitHub Container Registry instead of DockerHub + Lavalink Docker images are now found in the GitHub Container Registry instead of DockerHub ## v3.7.4 diff --git a/docs/changelog/v4.md b/docs/changelog/v4.md index 0c2ed346f..4b9e755ab 100644 --- a/docs/changelog/v4.md +++ b/docs/changelog/v4.md @@ -1,3 +1,9 @@ +## v4.0.8 +* Updated koe to [`2.0.3-rc2`](https://github.com/KyokoBot/koe/releases/tag/2.0.3-rc2) & use voice gateway `v8` in [#1097](https://github.com/lavalink-devs/Lavalink/pull/1097) +* Updated Lavaplayer to [`2.2.2`](https://github.com/lavalink-devs/lavaplayer/releases/tag/2.2.2) in [#1105](https://github.com/lavalink-devs/Lavalink/pull/1105) +* Allow usage of non-allocating frame buffers in [#1095](https://github.com/lavalink-devs/Lavalink/pull/1095) +* Added shutdown handling to close sessions cleanly in [#1102](https://github.com/lavalink-devs/Lavalink/pull/1102) + ## v4.0.7 * Updated Lavaplayer to [`2.2.1`](https://github.com/lavalink-devs/lavaplayer/releases/tag/2.2.1) * Updated spring-boot to `3.3.0` & spring-websocket to `6.1.9` From 0d7decb7cc5fda0f3d7b2a6185c1d7be17e66300 Mon Sep 17 00:00:00 2001 From: topi314 Date: Sun, 13 Oct 2024 16:46:24 +0200 Subject: [PATCH 04/10] fix links --- docs/changelog/v3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changelog/v3.md b/docs/changelog/v3.md index bc7edde60..aa9a3bfbe 100644 --- a/docs/changelog/v3.md +++ b/docs/changelog/v3.md @@ -1,9 +1,9 @@ ## v3.7.13 !!! danger - This is the last Lavalink `v3` release, see: https://github.com/lavalink-devs/Lavalink/discussions/1100 + This is the last Lavalink `v3` release, see [here](https://github.com/lavalink-devs/Lavalink/discussions/1100) for more info. * Updated Lavaplayer to [`1.5.6`](https://github.com/lavalink-devs/lavaplayer/releases/tag/1.5.6) -* Updated koe to [`2.0.3-rc2`](https://github.com/KyokoBot/koe/releases/tag/2.0.3-rc2) & use voice gateway v8 in https://github.com/lavalink-devs/Lavalink/pull/1098 +* Updated koe to [`2.0.3-rc2`](https://github.com/KyokoBot/koe/releases/tag/2.0.3-rc2) & use voice gateway v8 in [#1098](https://github.com/lavalink-devs/Lavalink/pull/1098) ## v3.7.12 * Updated Lavaplayer to [`1.5.4`](https://github.com/lavalink-devs/lavaplayer/releases/tag/1.5.4) From 62dd4822a2f6b5248dbb3c2326093554e909e25c Mon Sep 17 00:00:00 2001 From: Neu <38368299+Neuheit@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:19:06 -0500 Subject: [PATCH 05/10] add plugin update checker --- LavalinkServer/build.gradle.kts | 3 +- .../server/bootstrap/PluginManager.kt | 35 +++++++++++++++++++ settings.gradle.kts | 1 + 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/LavalinkServer/build.gradle.kts b/LavalinkServer/build.gradle.kts index ddb62b35a..457f3440d 100644 --- a/LavalinkServer/build.gradle.kts +++ b/LavalinkServer/build.gradle.kts @@ -65,11 +65,12 @@ dependencies { implementation(libs.kotlin.reflect) implementation(libs.logback) implementation(libs.sentry.logback) + implementation("io.github.z4kn4fein:semver:2.0.0") implementation(libs.oshi) { // This version of SLF4J does not recognise Logback 1.2.3 exclude(group = "org.slf4j", module = "slf4j-api") } - + testImplementation(libs.spring.boot.test) } diff --git a/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt b/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt index c3ed4cb73..38e0ddab2 100644 --- a/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt +++ b/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt @@ -9,9 +9,11 @@ import java.io.FileOutputStream import java.io.InputStream import java.net.URL import java.net.URLClassLoader +import java.net.HttpURLConnection import java.nio.channels.Channels import java.util.* import java.util.jar.JarFile +import io.github.z4kn4fein.semver.toVersion @SpringBootApplication class PluginManager(val config: PluginsConfig) { @@ -83,6 +85,39 @@ class PluginManager(val config: PluginsConfig) { val file = File(directory, declaration.canonicalJarName) downloadJar(file, url) } + + checkPluginForUpdates(declaration) + } + } + + private fun checkPluginForUpdates(declaration: Declaration) { + val splitPath = declaration.url.split('/') + + val baseSplitPath = splitPath.dropLast(2) + var basePath = baseSplitPath.joinToString("/") + + basePath += "/maven-metadata.xml" + + val connection = URL(basePath).openConnection() as HttpURLConnection + connection.inputStream.bufferedReader().use { + for(line in it.readLines()) { + val regex = "(.*?)".toRegex() + val match = regex.find(line) + val latest = match?.groups?.get(1)?.value + if (latest != null) { + val latestVersion = latest.toVersion() + //val latest2 = "1.10.3".toVersion() + val currentVersion = declaration.version.toVersion() + + if(latestVersion > currentVersion) { + log.warn("A newer version of ${declaration.name} was found: $latestVersion. " + + "The current version is $currentVersion.") + } else { + log.info("Plugin {} is up to date", declaration.name) + } + break + } + } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 14cbf4aa8..68eb7f315 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -76,6 +76,7 @@ fun VersionCatalogBuilder.common() { library("logback", "ch.qos.logback", "logback-classic").version("1.5.6") library("sentry-logback", "io.sentry", "sentry-logback").version("7.10.0") library("oshi", "com.github.oshi", "oshi-core").version("6.4.11") + library("semver", "io.github.z4kn4fein", "semver").version("2.0.0") } fun VersionCatalogBuilder.other() { From 56ab480c501d71d4e6654a1d6156f6032930c7b9 Mon Sep 17 00:00:00 2001 From: Neu <38368299+Neuheit@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:30:20 -0500 Subject: [PATCH 06/10] change line parsing --- .../src/main/java/lavalink/server/bootstrap/PluginManager.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt b/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt index 38e0ddab2..19f6df54f 100644 --- a/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt +++ b/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt @@ -100,7 +100,8 @@ class PluginManager(val config: PluginsConfig) { val connection = URL(basePath).openConnection() as HttpURLConnection connection.inputStream.bufferedReader().use { - for(line in it.readLines()) { + val lines = it.readLines() + for(line in lines) { val regex = "(.*?)".toRegex() val match = regex.find(line) val latest = match?.groups?.get(1)?.value From ad32c22d0c68f16279b42c532167a3704a789368 Mon Sep 17 00:00:00 2001 From: Neu <38368299+Neuheit@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:58:12 -0500 Subject: [PATCH 07/10] cleanup --- .../main/java/lavalink/server/bootstrap/PluginManager.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt b/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt index 19f6df54f..be432ae2d 100644 --- a/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt +++ b/LavalinkServer/src/main/java/lavalink/server/bootstrap/PluginManager.kt @@ -94,27 +94,24 @@ class PluginManager(val config: PluginsConfig) { val splitPath = declaration.url.split('/') val baseSplitPath = splitPath.dropLast(2) - var basePath = baseSplitPath.joinToString("/") - - basePath += "/maven-metadata.xml" + val basePath = baseSplitPath.joinToString("/") + "/maven-metadata.xml" val connection = URL(basePath).openConnection() as HttpURLConnection connection.inputStream.bufferedReader().use { val lines = it.readLines() - for(line in lines) { + for (line in lines) { val regex = "(.*?)".toRegex() val match = regex.find(line) val latest = match?.groups?.get(1)?.value if (latest != null) { val latestVersion = latest.toVersion() - //val latest2 = "1.10.3".toVersion() val currentVersion = declaration.version.toVersion() if(latestVersion > currentVersion) { log.warn("A newer version of ${declaration.name} was found: $latestVersion. " + "The current version is $currentVersion.") } else { - log.info("Plugin {} is up to date", declaration.name) + log.info("Plugin ${declaration.name} is up to date") } break } From 2e68d611d9a6b15c6864860eaedf61591f5b68b3 Mon Sep 17 00:00:00 2001 From: Neu <38368299+Neuheit@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:01:48 -0500 Subject: [PATCH 08/10] fix gradle --- LavalinkServer/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LavalinkServer/build.gradle.kts b/LavalinkServer/build.gradle.kts index 457f3440d..f50b43195 100644 --- a/LavalinkServer/build.gradle.kts +++ b/LavalinkServer/build.gradle.kts @@ -65,7 +65,7 @@ dependencies { implementation(libs.kotlin.reflect) implementation(libs.logback) implementation(libs.sentry.logback) - implementation("io.github.z4kn4fein:semver:2.0.0") + implementation(libs.semver) implementation(libs.oshi) { // This version of SLF4J does not recognise Logback 1.2.3 exclude(group = "org.slf4j", module = "slf4j-api") From cb5d7be3f55a20858d5d61095bead62bcc42c216 Mon Sep 17 00:00:00 2001 From: Neu <38368299+Neuheit@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:02:25 -0500 Subject: [PATCH 09/10] fix whitespace --- LavalinkServer/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/LavalinkServer/build.gradle.kts b/LavalinkServer/build.gradle.kts index f50b43195..b5260758d 100644 --- a/LavalinkServer/build.gradle.kts +++ b/LavalinkServer/build.gradle.kts @@ -70,7 +70,6 @@ dependencies { // This version of SLF4J does not recognise Logback 1.2.3 exclude(group = "org.slf4j", module = "slf4j-api") } - testImplementation(libs.spring.boot.test) } From e4b41211f8db8b65fbcb99fb3c537a7ceeeb64e8 Mon Sep 17 00:00:00 2001 From: Neu <38368299+Neuheit@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:03:55 -0500 Subject: [PATCH 10/10] whitespace --- LavalinkServer/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/LavalinkServer/build.gradle.kts b/LavalinkServer/build.gradle.kts index b5260758d..f50b43195 100644 --- a/LavalinkServer/build.gradle.kts +++ b/LavalinkServer/build.gradle.kts @@ -70,6 +70,7 @@ dependencies { // This version of SLF4J does not recognise Logback 1.2.3 exclude(group = "org.slf4j", module = "slf4j-api") } + testImplementation(libs.spring.boot.test) }