Skip to content

Commit

Permalink
Merge pull request #988 from lavalink-devs/dev
Browse files Browse the repository at this point in the history
release 4.0.0
  • Loading branch information
topi314 authored Dec 3, 2023
2 parents 7978e9d + baec7f7 commit 92bffcc
Show file tree
Hide file tree
Showing 54 changed files with 2,790 additions and 1,385 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: Build
on:
push:
branches: [ '**' ]
paths-ignore: [ '**.md' ]
paths-ignore:
- '**.md'
- 'docs/**'
- '.github/workflows/docs.yml'
- '.github/workflows/docs-pr.yml'
workflow_call:
secrets:
DOCKER_USERNAME:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docs PR

on:
pull_request_target:
branches: [ '**' ]
paths:
- 'docs/**'

concurrency:
group: pages
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install -r requirements.txt
working-directory: docs
# - run: mkdocs build --verbose --strict
- run: mkdocs build --verbose
working-directory: docs
- uses: actions/upload-pages-artifact@v1
with:
path: 'site'
- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: site
branch: pr-${{ github.event.pull_request.number }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docs Push

on:
push:
branches: [ '**' ]
paths:
- 'docs/**'
- '.github/workflows/docs.yml'

concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install -r requirements.txt
working-directory: docs
# - run: mkdocs build --verbose --strict
- run: mkdocs build --verbose
working-directory: docs
- uses: actions/upload-pages-artifact@v1
with:
path: 'site'
- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: site
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ build/*
gradle.properties
application.yml
LavalinkServer/plugins
.cache/
site/
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@
Each release usually includes various fixes and improvements.
The most noteworthy of these, as well as any features and breaking changes, are listed here.

## 4.0.0
* Lavalink now requires Java 17 or higher to run
* **Removal of all websocket messages sent by the client. Everything is now done via [REST](../api/rest.md)**
* Remove default 4GB max heap allocation from docker image
* Removal of all `/v3` endpoints except `/version`. All other endpoints are now under `/v4`
* Reworked track loading result. For more info see [here](https://lavalink.dev/api/rest.md#track-loading-result)
* Update docker ubuntu base image from focal(`20`) to jammy(`22`)
* Update to Koe [`2.0.0-rc2`](https://github.com/KyokoBot/koe/releases/tag/2.0.0-rc2)
* Update Lavaplayer to [`2.0.4`](https://github.com/lavalink-devs/lavaplayer/releases/tag/2.0.4), which includes native support for artwork urls and ISRCs in the track info
* Update to the [Protocol Module](https://github.com/lavalink-devs/Lavalink/tree/master/protocol) to support Kotlin/JS
* Allow setting user data on tracks in the REST API. For more info see [here](https://lavalink.dev/api/rest.html#update-player-track)
* Added default plugin repository. Plugin devs can now request their plugin to be added to the default repository. For more info see [here](https://lavalink.dev/api/plugins.md#distributing-your-plugin)
* Addition of full `Track` objects in following events: `TrackStartEvent`, `TrackEndEvent`, `TrackExceptionEvent`, `TrackStuckEvent`
* Resuming a session now requires the `Session-Id` header instead of `Resume-Key` header
* Add JDA-NAS support for musl (`x86-64`, `aarch64`) based systems (most notably `alpine`)
* Add `Omissible#isPresent` & `Omissible#isOmitted` to the `protocol` module
* New config option to specify the directory to load plugins from. `lavalink.pluginsDir` (defaults to `./plugins`)
* Enable request logging by default
* Fixed error when seeking and player is not playing anything in
* Fixed null pointer when a playlist has no selected track

> [!WARNING]
> Lavalink previously set the `-Xmx` flag to `4G` in docker. This caused issues with some systems which had less than 4GB of RAM. We have now removed this flag and let the JVM decide the max heap allocation. The default is 1GB or 25% of total memory, whichever is lower.
> On how to increase the max heap allocation, see [here](https://lavalink.dev/configuration/docker.html#docker).
<details>
<summary>v4.0.0 - Betas</summary>

## 4.0.0-beta.5
* Update lavaplayer to [`2.0.3`](https://github.com/lavalink-devs/lavaplayer/releases/tag/2.0.2) - Fixed YouTube access token errors
* Added default plugin repository. Plugin devs can now request their plugin to be added to the default repository. For more info see [here](https://github.com/lavalink-devs/Lavalink/blob/master/PLUGINS.md#distributing-your-plugin)
Expand Down Expand Up @@ -39,6 +67,23 @@ The most noteworthy of these, as well as any features and breaking changes, are
Contributors:
[@topi314](https://github.com/topi314), [@freyacodes](https://github.com/freyacodes), [@DRSchlaubi](https://github.com/DRSchlaubi) and [@melike2d](https://github.com/melike2d)

</details>

## v3.7.10
* Update lavaplayer to [`1.5.2`](https://github.com/lavalink-devs/lavaplayer/releases/tag/1.5.2) - Fixed NPE on missing author in playlist tracks in YouTube

## 3.7.9
* Update lavaplayer to [`1.5.1`](https://github.com/lavalink-devs/lavaplayer/releases/tag/1.5.1) - Fixed YouTube access token errors
* Fixed websocket crash when seeking and nothing is playing
* Fixed error when seeking and player is not playing anything

## 3.7.8
* Fix YouTube 403 errors
* Fix YouTube access token errors

## 3.7.7
* Add JDA-NAS support for musl (`x86-64`, `aarch64`) based systems (most notably `alpine`)

## 3.7.6
* Update Lavaplayer to [`1.4.1`](https://github.com/Walkyst/lavaplayer-fork/releases/tag/1.4.1) & [`1.4.2`](https://github.com/Walkyst/lavaplayer-fork/releases/tag/1.4.2)
* New support for `MUSL` based systems (most notably `alpine`)
Expand Down
4 changes: 3 additions & 1 deletion LavalinkServer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ dependencies {
implementation(libs.koe.udpqueue) {
exclude(module="udp-queue")
}
implementation(libs.bundles.udpqueue.natives)
implementation(libs.bundles.udpqueue.natives) {
exclude(group = "com.sedmelluq", module = "lava-common")
}

implementation(libs.lavaplayer)
implementation(libs.lavaplayer.ip.rotator)
Expand Down
4 changes: 2 additions & 2 deletions LavalinkServer/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:18-jre-focal
FROM eclipse-temurin:18-jre-jammy

# Run as non-root user
RUN groupadd -g 322 lavalink && \
Expand All @@ -12,4 +12,4 @@ USER lavalink

COPY LavalinkServer/build/libs/Lavalink.jar Lavalink.jar

ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-Xmx4G", "-jar", "Lavalink.jar"]
ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-jar", "Lavalink.jar"]
2 changes: 1 addition & 1 deletion LavalinkServer/docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ USER lavalink

COPY LavalinkServer/build/libs/Lavalink-musl.jar Lavalink.jar

ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-Xmx4G", "-jar", "Lavalink.jar"]
ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-jar", "Lavalink.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class PluginManager(val config: PluginsConfig) {

var repository = declaration.repository
?: if (declaration.snapshot) config.defaultPluginSnapshotRepository else config.defaultPluginRepository
repository =
if (declaration.repository!!.endsWith("/")) declaration.repository!! else declaration.repository!! + "/"
repository = if (repository.endsWith("/")) repository else "$repository/"
Declaration(fragments[0], fragments[1], fragments[2], repository)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import org.springframework.context.annotation.Configuration

@Configuration
@ConfigurationProperties(prefix = "logging.request")
@ConditionalOnProperty("logging.request.enabled")
@ConditionalOnProperty("logging.request.enabled", matchIfMissing = true)
data class RequestLoggingConfig(
var includeClientInfo: Boolean = true,
var includeClientInfo: Boolean = false,
var includeHeaders: Boolean = false,
var includeQueryString: Boolean = true,
var includePayload: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,9 @@ class SocketContext(
override fun gatewayReady(target: InetSocketAddress?, ssrc: Int) {
SocketServer.sendPlayerUpdate(this@SocketContext, player)
}

override fun gatewayError(cause: Throwable) {
log.error("Koe encountered a voice gateway exception for guild ${player.guildId}", cause)
}
}
}
Loading

0 comments on commit 92bffcc

Please sign in to comment.