Skip to content

Commit

Permalink
Merge pull request lavalink-devs#729 from freyacodes/dev
Browse files Browse the repository at this point in the history
* Call AudioPlayer#destroy() instead of #stop()

* Add first draft of a plugin API

* Add plugins endpoint

* Make Player implement IPlayer

* Add AudioPlayerManager configuration via plugins

* Fix error when enabling timescale and lowpass filters (lavalink-devs#572)

* Add plugin loading

* Add automatic plugin downloading

* Use JDK 11 for Jitpack build

* Use custom jitpack install command

* Add maven plugin to API module

* Configure plugin api build

* Fix player is not playing after move between vc or changing regions (lavalink-devs#577)

* Configure plugin api publishing

* Load plugins on startup

* Implement plugin event handling and ISocketContext

* Fix PluginsEndpoint

* Allow closing with custom close frame

* Update plugin api version

* Fix spring initialization

* Fix jitpack build

* Re-add JCenter for now

* Refactor EventEmitter

* Add JCenter to the right block

* Reconfigure build of Lavalink-Server

* Use default jitpack tasks

* Load plugin @components upon strtup

* Add filter extension support

* Fix jar loading URL

* Add custom WS handler support

* Fix WS handling

* Set plugin-api to Java 8

* Fix jar and class loading

* Load classes into a single Classloader

* Fix plugin jar management

* updaate lavalink-client & use lavalinks rest api to load tracks (lavalink-devs#580)

* Add API javadoc

* Bump plugin-api version

* Add spring-boot dependency instead of spring-context

* Fix broken tests

* fix guild ids sent as numbers in json (lavalink-devs#581)

* add onDestroyPlayer event for plugins to use (lavalink-devs#583)

* Plugin version 0.7.0

* Bump lavaplayer and add YT config for avoiding age restrictions (lavalink-devs#582)

* Bump lavaplayer and add YT config for avoiding age restrictions

* Move youtubeconfig to serverconfig

* Tweak log message

* Convert event handler from interface to abstract class

* Add plugin documentation

* Fix plugin event handler access modifiers

* add spotify plugin & reword sponsorblock (lavalink-devs#585)

* Fix ClassNotFoundException in PluginManager outside of dev environment

* Fix lateinit exception in FilterChain

* Document audio source manager beans

* Plugin API 0.9.0

* Rename dunctebot repo (lavalink-devs#587)

* Register http source manager last

* Refactor plugin loading

* Simplify startup slightly

* Fix REST endpoints

* Document /plugins endpoint

* Add beta warning

* Fix merge error and tests

* Fix http manager being registered before plugin managers

* Add google cloud tts plugin (lavalink-devs#597)

* fix: missing timescale natives (lavalink-devs#600)

Fixes the error when trying to apply timescale filters using the dev branch: lavalink-devs#599

* feat: http proxy config for httpAudioSourceManager (lavalink-devs#595)

* feat: http proxy config for httpAudioSourceManager

* feat(application.yml.example): add httpProxy example
fix(HttpConfig): indentation

* feat: http proxy auth

* chore: add missing config examples and comments

* chore(application.yml.example): description httpconfig

* Set endMarkerHit to correctly set FINISHED as the reason (lavalink-devs#609)

* update links to plugins (lavalink-devs#613)

* update spotify plugin repo link (lavalink-devs#617)

* Added a missing space in WebSocketHandler.kt (lavalink-devs#625)

* Added details of additional audio filter plugin (lavalink-devs#634)

* Added new plugin details

* Added filter plugin details

* Fixed format

* Update spring dependencies

This commit should tackle any possibility of CVE-2022-22965 being exploited on LavaLink. As far as the current information available states, LavaLink is not vulnerable as we are using the Undertow container and running as a deployable jar instead of a war-file.

This dependency update required an upgrade to Gradle 6.9 as the spring-boot dependency now requires at least gradle 6.8, since 7.0 made changes to how a lot of APIs work, I've sticked with 6.9 for now.

Signed-off-by: Fabricio Winter <git@notfab.net>

* Remove doLast step from bootJar configuration

Signed-off-by: Fabricio Winter <git@notfab.net>

* fix docker workdir permisions for creation of plugins folder (lavalink-devs#666)

* Update Lavaplayer (lavalink-devs#661)

Resolves track searching issues.

* update koe version (lavalink-devs#648)

* update to Walkyst koe fork, renamed VoiceConnection -> MediaConnection

* use walkyst fork ext-udpqueue

* use latest koe master branch commit

* update to latest koe commit

* update to koe 2.0.0-rc1

* Document search prefixes in IMPLEMENTATION (lavalink-devs#657)

* Document search prefixes in IMPLEMENTATION

* Change wording of track search

Co-authored-by: Freya Arbjerg <freya@arbjerg.dev>

* Allow adding new MediaContainerProbes via plugins (lavalink-devs#631)

* Allow adding new MediaContainerProbes via plugins

* Document custom MediaContainerProbe bean support

* Changes plugin decoumentation wording

Co-authored-by: Freya Arbjerg <freya@arbjerg.dev>

* Add log message when application is ready (lavalink-devs#665)

* Add log message when application is ready

This marks the moment the application is ready more clearly now
that there are 2 'Started Launcher' log messages.

Additionally, this is somewhat helpful for people running LL through
subprocess that want to programmatically detect when application starts
to accept connections.

* Change "Application" to "Lavalink"

Co-authored-by: Freya Arbjerg <freya@arbjerg.dev>

* Merge event listeners

* undeprecate volume property in play op

* (LowPass) Change enable value, update docs. (lavalink-devs#673)

* LowPass: enforce minimum, change enable value, update docs.

* Remove coercing to allow the filter to actually be disabled.

* Bump lowpass minimum to 1.0f

* Enforce >1.0

* add configurable track stuck threshold

* Enforce minimum bufferDuration of 50ms (lavalink-devs#674)

* Enforce minimum of 50ms due to unexpected behaviour

* Allow exactly 50ms.

* Minimum should be divisible by 20 due to 20ms packet times.

* Lower to 40ms, mention possibility of stuttering

* 'more' is redundant, under ideal conditions there are no pauses.

* increase minimum track stuck threshold to 100ms

* Bump lavaplayer (lavalink-devs#683)

* Bump lavaplayer

* Email and pass not necessary

* 1.3.98.1

* Switch to kotlin gradle dsl and use version catalogs (lavalink-devs#672)

* Switch to kotlin gradle dsl and version catalogs

* Use jetbrains annotations

* We don't want tomcat

* Add spotbugs

* Revert annotation import change

Co-authored-by: TopiSenpai <tobi@strasserhof.com>

* added github actions to build jars & docker images

* fix dockerhub repo

* add minns updqueue natives to support more architecturtes

* specify platforms to build docker images for

* update to udpqueue natives 0.1.6 with m1 support

* fix check enabling jda nas on supported platforms

* fix github actions issues (lavalink-devs#698)

* remove on pull_request & block job from running if no dokcer secrets are provided

* remove on pull_request for workflow

* remove unneeded check & expression syntax in if

* run docker job only if secrets are set

* fix job name

* fix needs job name

* fix docker job output

* Test docker push

* Force docker push test

* fix misnamed job output

* hopefully fix the issue to run the docker job

* fix missing "

* Delete test

Co-authored-by: Freya Arbjerg <freya@arbjerg.dev>

* document now supported architecures in README.md

* fix github action to upload build artifacts to releases

* Allow adjustment of opus encoding & resampling quality fields in AudioConfiguration (lavalink-devs#699)

* Allow setting opusEncoding & resampling quality

* Mark resamplingQuality as nullable so it can be omitted

* Support useSeekGhosting setting.

* Update LP

* Update LP again.

1.3.98.2 was held by a previous build, so another release had to be made.

* Use zulu-openjdk 18 as base

* Update application.yml.example (lavalink-devs#710)

* remove docker arm/v7 builds for now

* Refactor GitHub actions (lavalink-devs#702)

* remove VERSION.txt and refactor github actions

* combine gradle & docker build into one job

* combine push and build

* use eclipse-temurin:18 as docker base image for linux/arm/v7 & linux/arm64/v8 images

* catch UnsatisfiedLinkError when jda nas is enabled on unsupported systems

* catch throwable instead of UnsatisfiedLinkError when jda nas is loaded

* Revert back to OpenJDK

* revert arm images

* catch throwable instead of UnsatisfiedLinkError when jda nas is loaded

* Bump lavaplayer

* mention github actions in readme

* Add XM module plugin to list (lavalink-devs#725)

* arm docker images (lavalink-devs#716)

* switch back to eclipse-temurin:18 docker image and reeanle linux/arm64/v8 and linux/arm/v7 docker builds

* use jre focal temurin image

Signed-off-by: Fabricio Winter <git@notfab.net>
Co-authored-by: Freya Arbjerg <freya@arbjerg.dev>
Co-authored-by: David Amorim <66310990+davidffa@users.noreply.github.com>
Co-authored-by: Walkyst <41806921+Walkyst@users.noreply.github.com>
Co-authored-by: Duncan Sterken <contact@duncte123.me>
Co-authored-by: Muh <52611945+Muh9049@users.noreply.github.com>
Co-authored-by: ToxicMushroom <merlijn.verstraete@gmail.com>
Co-authored-by: Devoxin <15076404+Devoxin@users.noreply.github.com>
Co-authored-by: mooner <moonmk10221@gmail.com>
Co-authored-by: Rohan Kumar <rohan.shuvam@gmail.com>
Co-authored-by: Fabricio Winter <git@notfab.net>
Co-authored-by: Essem <smswessem@gmail.com>
Co-authored-by: Jakub Kuczys <6032823+jack1142@users.noreply.github.com>
Co-authored-by: 2D <44017640+melike2d@users.noreply.github.com>
Co-authored-by: Kodehawa <david.alejandro.rubio@gmail.com>
Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com>
  • Loading branch information
16 people authored Aug 28, 2022
2 parents 5c37267 + 590ac96 commit e70f636
Show file tree
Hide file tree
Showing 51 changed files with 1,555 additions and 478 deletions.
68 changes: 19 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ name: Build

on:
push:
paths-ignore:
- '**.md'
branches: [ '**' ]
paths-ignore: [ '**.md' ]
workflow_call:
secrets:
DOCKERHUB_USERNAME:
DOCKERHUB_TOKEN:

jobs:
gradle:
build:
runs-on: ubuntu-latest
outputs:
rundocker: ${{ steps.rundocker.outputs.rundocker }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -33,29 +38,8 @@ jobs:
name: Lavalink.jar
path: LavalinkServer/build/libs/Lavalink.jar

- name: Check Docker Build
id: rundocker
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
echo "Run docker build: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
echo "::set-output name=rundocker::${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
docker:
needs: gradle
runs-on: ubuntu-latest
if: needs.gradle.outputs.rundocker == 'true'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: Lavalink.jar

- name: Docker Meta
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
id: meta
uses: docker/metadata-action@v4
with:
Expand All @@ -68,41 +52,27 @@ jobs:
type=sha,prefix=
- name: Set up QEMU
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}

- name: Build and push
- name: Build and Push
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
uses: docker/build-push-action@v3
with:
file: LavalinkServer/docker/Dockerfile
context: .
platforms: linux/amd64,linux/arm/v7
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

release:
needs: gradle
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: Lavalink.jar

- name: Upload Artifacts to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: Lavalink.jar
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
release:
types: [published]

jobs:
build:
uses: ./.github/workflows/build.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: Lavalink.jar

- name: Upload Artifacts to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: Lavalink.jar
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*.iml
/logs/
/target/
/application.yml
/LavalinkServer/application.yml
*/dependency-reduced-pom.xml
.gradle/*
build/*
Expand All @@ -13,3 +13,8 @@ build/*
.settings
/Testbot/build/
/Testbot/out/
/plugin-api/build/
/plugin-api/out/
gradle.properties
application.yml
plugins
41 changes: 32 additions & 9 deletions IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ Note that filters may take a moment to apply.
}

// Higher frequencies get suppressed, while lower frequencies pass through this filter, thus the name low pass.
// Any smoothing values equal to, or less than 1.0 will disable the filter.
"lowPass": {
"smoothing": 20.0
"smoothing": 20.0 // 1.0 < x
}
}
```
Expand Down Expand Up @@ -377,8 +378,7 @@ See the [Discord docs](https://discordapp.com/developers/docs/topics/opcodes-and
### Track Loading API
The REST api is used to resolve audio tracks for use with the `play` op.
```
GET /loadtracks?identifier=dQw4w9WgXcQ HTTP/1.1
Host: localhost:8080
GET /loadtracks?identifier=dQw4w9WgXcQ
Authorization: youshallnotpass
```

Expand Down Expand Up @@ -443,12 +443,16 @@ A severity level of `COMMON` indicates that the error is non-fatal and that the
}
```

#### Track Searching
Lavalink supports searching via YouTube, YouTube Music, and Soundcloud. To search, you must prefix your identifier with `ytsearch:`, `ytmsearch:`, or `scsearch:`respectively.

When a search prefix is used, the returned `loadType` will be `SEARCH_RESULT`. Note that, disabling the respective source managers renders these search prefixes redundant. Plugins may also implement prefixes to allow for more search engines.

### Track Decoding API

Decode a single track into its info
```
GET /decodetrack?track=QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRdzR3OVdnWGNRAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9ZFF3NHc5V2dYY1EAB3lvdXR1YmUAAAAAAAAAAA== HTTP/1.1
Host: localhost:8080
GET /decodetrack?track=QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRdzR3OVdnWGNRAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9ZFF3NHc5V2dYY1EAB3lvdXR1YmUAAAAAAAAAAA==
Authorization: youshallnotpass
```

Expand All @@ -469,8 +473,7 @@ Response:

Decode multiple tracks into info their info
```
POST /decodetracks HTTP/1.1
Host: localhost:8080
POST /decodetracks
Authorization: youshallnotpass
```

Expand Down Expand Up @@ -504,15 +507,35 @@ Response:
```
---

### Get list of plugins
Request information about the plugins running on Lavalink, if any.
```
GET /plugins
Authorization: youshallnotpass
```

Response:
```yaml
[
{
"name": "some-plugin",
"version": "1.0.0"
},
{
"name": "foo-plugin",
"version": "1.2.3"
}
]
```

### RoutePlanner API

Additionally there are a few REST endpoints for the ip rotation extension
Additionally, there are a few REST endpoints for the ip rotation extension

#### Get RoutePlanner status

```
GET /routeplanner/status
Host: localhost:8080
Authorization: youshallnotpass
```

Expand Down
1 change: 0 additions & 1 deletion LavalinkServer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
/debug_token
build/*
/out/
VERSION.txt
23 changes: 19 additions & 4 deletions LavalinkServer/application.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ lavalink:
vimeo: true
http: true
local: false
bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses
bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses. Minimum of 40ms, lower values may introduce pauses.
frameBufferDurationMs: 5000 # How many milliseconds of audio to keep buffered
opusEncodingQuality: 10 # Opus encoder quality. Valid values range from 0 to 10, where 10 is best quality but is the most expensive on the CPU.
resamplingQuality: LOW # Quality of resampling operations. Valid values are LOW, MEDIUM and HIGH, where HIGH uses the most CPU.
trackStuckThresholdMs: 10000 # The threshold for how long a track can be stuck. A track is stuck if does not return any audio data.
useSeekGhosting: true # Seek ghosting is the effect where whilst a seek is in progress, the audio buffer is read from until empty, or until seek is ready.
youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds
youtubeSearchEnabled: true
Expand All @@ -25,6 +29,14 @@ lavalink:
#strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
#searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
#retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times
#youtubeConfig: # Required for avoiding all age restrictions by YouTube, some restricted videos still can be played without.
#email: "" # Email of Google account
#password: "" # Password of Google account
#httpConfig: # Useful for blocking bad-actors from ip-grabbing your music node and attacking it, this way only the http proxy will be attacked
#proxyHost: "localhost" # Hostname of the proxy, (ip or domain)
#proxyPort: 3128 # Proxy port, 3128 is the default for squidProxy
#proxyUser: "" # Optional user for basic authentication fields, leave blank if you don't use basic auth
#proxyPassword: "" # Password for basic authentication

metrics:
prometheus:
Expand All @@ -40,10 +52,13 @@ sentry:

logging:
file:
max-history: 30
max-size: 1GB
path: ./logs/
path: ./logs/

level:
root: INFO
lavalink: INFO

logback:
rollingpolicy:
max-file-size: 1GB
max-history: 30
Loading

0 comments on commit e70f636

Please sign in to comment.