Skip to content

Commit 1c6f1c5

Browse files
topi314freyacodesdavidffaWalkystduncte123
authored
Merge pull request #729 from freyacodes/dev
* 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 (#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 (#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 (#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 (#581) * add onDestroyPlayer event for plugins to use (#583) * Plugin version 0.7.0 * Bump lavaplayer and add YT config for avoiding age restrictions (#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 (#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 (#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 (#597) * fix: missing timescale natives (#600) Fixes the error when trying to apply timescale filters using the dev branch: #599 * feat: http proxy config for httpAudioSourceManager (#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 (#609) * update links to plugins (#613) * update spotify plugin repo link (#617) * Added a missing space in WebSocketHandler.kt (#625) * Added details of additional audio filter plugin (#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 <[email protected]> * Remove doLast step from bootJar configuration Signed-off-by: Fabricio Winter <[email protected]> * fix docker workdir permisions for creation of plugins folder (#666) * Update Lavaplayer (#661) Resolves track searching issues. * update koe version (#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 (#657) * Document search prefixes in IMPLEMENTATION * Change wording of track search Co-authored-by: Freya Arbjerg <[email protected]> * Allow adding new MediaContainerProbes via plugins (#631) * Allow adding new MediaContainerProbes via plugins * Document custom MediaContainerProbe bean support * Changes plugin decoumentation wording Co-authored-by: Freya Arbjerg <[email protected]> * Add log message when application is ready (#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 <[email protected]> * Merge event listeners * undeprecate volume property in play op * (LowPass) Change enable value, update docs. (#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 (#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 (#683) * Bump lavaplayer * Email and pass not necessary * 1.3.98.1 * Switch to kotlin gradle dsl and use version catalogs (#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 <[email protected]> * 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 (#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 <[email protected]> * 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 (#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 (#710) * remove docker arm/v7 builds for now * Refactor GitHub actions (#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 (#725) * arm docker images (#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 <[email protected]> Co-authored-by: Freya Arbjerg <[email protected]> Co-authored-by: David Amorim <[email protected]> Co-authored-by: Walkyst <[email protected]> Co-authored-by: Duncan Sterken <[email protected]> Co-authored-by: Muh <[email protected]> Co-authored-by: ToxicMushroom <[email protected]> Co-authored-by: Devoxin <[email protected]> Co-authored-by: mooner <[email protected]> Co-authored-by: Rohan Kumar <[email protected]> Co-authored-by: Fabricio Winter <[email protected]> Co-authored-by: Essem <[email protected]> Co-authored-by: Jakub Kuczys <[email protected]> Co-authored-by: 2D <[email protected]> Co-authored-by: Kodehawa <[email protected]> Co-authored-by: aikaterna <[email protected]>
2 parents 1f318c8 + f8dfad7 commit 1c6f1c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1555
-478
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ name: Build
22

33
on:
44
push:
5-
paths-ignore:
6-
- '**.md'
5+
branches: [ '**' ]
6+
paths-ignore: [ '**.md' ]
7+
workflow_call:
8+
secrets:
9+
DOCKERHUB_USERNAME:
10+
DOCKERHUB_TOKEN:
711

812
jobs:
9-
gradle:
13+
build:
1014
runs-on: ubuntu-latest
11-
outputs:
12-
rundocker: ${{ steps.rundocker.outputs.rundocker }}
15+
env:
16+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
17+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
1318
steps:
1419
- name: Checkout
1520
uses: actions/checkout@v3
@@ -33,29 +38,8 @@ jobs:
3338
name: Lavalink.jar
3439
path: LavalinkServer/build/libs/Lavalink.jar
3540

36-
- name: Check Docker Build
37-
id: rundocker
38-
env:
39-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
40-
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
41-
run: |
42-
echo "Run docker build: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
43-
echo "::set-output name=rundocker::${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
44-
45-
docker:
46-
needs: gradle
47-
runs-on: ubuntu-latest
48-
if: needs.gradle.outputs.rundocker == 'true'
49-
steps:
50-
- name: Checkout
51-
uses: actions/checkout@v2
52-
53-
- name: Download Artifacts
54-
uses: actions/download-artifact@v2
55-
with:
56-
name: Lavalink.jar
57-
5841
- name: Docker Meta
42+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
5943
id: meta
6044
uses: docker/metadata-action@v4
6145
with:
@@ -68,41 +52,27 @@ jobs:
6852
type=sha,prefix=
6953
7054
- name: Set up QEMU
55+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
7156
uses: docker/setup-qemu-action@v2
7257

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

7662
- name: Login to DockerHub
63+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
7764
uses: docker/login-action@v2
7865
with:
79-
username: ${{ secrets.DOCKERHUB_USERNAME }}
80-
password: ${{ secrets.DOCKERHUB_TOKEN }}
66+
username: ${{ env.DOCKERHUB_USERNAME }}
67+
password: ${{ env.DOCKERHUB_TOKEN }}
8168

82-
- name: Build and push
69+
- name: Build and Push
70+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
8371
uses: docker/build-push-action@v3
8472
with:
8573
file: LavalinkServer/docker/Dockerfile
8674
context: .
87-
platforms: linux/amd64,linux/arm/v7
75+
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
8876
push: true
8977
tags: ${{ steps.meta.outputs.tags }}
9078
labels: ${{ steps.meta.outputs.labels }}
91-
92-
release:
93-
needs: gradle
94-
runs-on: ubuntu-latest
95-
if: startsWith(github.ref, 'refs/tags/')
96-
steps:
97-
- name: Checkout
98-
uses: actions/checkout@v2
99-
100-
- name: Download Artifacts
101-
uses: actions/download-artifact@v2
102-
with:
103-
name: Lavalink.jar
104-
105-
- name: Upload Artifacts to GitHub Release
106-
uses: softprops/action-gh-release@v1
107-
with:
108-
files: Lavalink.jar

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
uses: ./.github/workflows/build.yml
10+
secrets:
11+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
12+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
13+
14+
release:
15+
needs: build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Download Artifacts
22+
uses: actions/download-artifact@v2
23+
with:
24+
name: Lavalink.jar
25+
26+
- name: Upload Artifacts to GitHub Release
27+
uses: softprops/action-gh-release@v1
28+
with:
29+
files: Lavalink.jar

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*.iml
33
/logs/
44
/target/
5-
/application.yml
5+
/LavalinkServer/application.yml
66
*/dependency-reduced-pom.xml
77
.gradle/*
88
build/*
@@ -13,3 +13,8 @@ build/*
1313
.settings
1414
/Testbot/build/
1515
/Testbot/out/
16+
/plugin-api/build/
17+
/plugin-api/out/
18+
gradle.properties
19+
application.yml
20+
plugins

IMPLEMENTATION.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ Note that filters may take a moment to apply.
223223
}
224224

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

@@ -443,12 +443,16 @@ A severity level of `COMMON` indicates that the error is non-fatal and that the
443443
}
444444
```
445445

446+
#### Track Searching
447+
Lavalink supports searching via YouTube, YouTube Music, and Soundcloud. To search, you must prefix your identifier with `ytsearch:`, `ytmsearch:`, or `scsearch:`respectively.
448+
449+
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.
450+
446451
### Track Decoding API
447452

448453
Decode a single track into its info
449454
```
450-
GET /decodetrack?track=QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRdzR3OVdnWGNRAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9ZFF3NHc5V2dYY1EAB3lvdXR1YmUAAAAAAAAAAA== HTTP/1.1
451-
Host: localhost:8080
455+
GET /decodetrack?track=QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRdzR3OVdnWGNRAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9ZFF3NHc5V2dYY1EAB3lvdXR1YmUAAAAAAAAAAA==
452456
Authorization: youshallnotpass
453457
```
454458

@@ -469,8 +473,7 @@ Response:
469473

470474
Decode multiple tracks into info their info
471475
```
472-
POST /decodetracks HTTP/1.1
473-
Host: localhost:8080
476+
POST /decodetracks
474477
Authorization: youshallnotpass
475478
```
476479

@@ -504,15 +507,35 @@ Response:
504507
```
505508
---
506509

510+
### Get list of plugins
511+
Request information about the plugins running on Lavalink, if any.
512+
```
513+
GET /plugins
514+
Authorization: youshallnotpass
515+
```
516+
517+
Response:
518+
```yaml
519+
[
520+
{
521+
"name": "some-plugin",
522+
"version": "1.0.0"
523+
},
524+
{
525+
"name": "foo-plugin",
526+
"version": "1.2.3"
527+
}
528+
]
529+
```
530+
507531
### RoutePlanner API
508532

509-
Additionally there are a few REST endpoints for the ip rotation extension
533+
Additionally, there are a few REST endpoints for the ip rotation extension
510534

511535
#### Get RoutePlanner status
512536

513537
```
514538
GET /routeplanner/status
515-
Host: localhost:8080
516539
Authorization: youshallnotpass
517540
```
518541

LavalinkServer/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
/debug_token
77
build/*
88
/out/
9-
VERSION.txt

LavalinkServer/application.yml.example

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ lavalink:
1212
vimeo: true
1313
http: true
1414
local: false
15-
bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses
15+
bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses. Minimum of 40ms, lower values may introduce pauses.
1616
frameBufferDurationMs: 5000 # How many milliseconds of audio to keep buffered
17+
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.
18+
resamplingQuality: LOW # Quality of resampling operations. Valid values are LOW, MEDIUM and HIGH, where HIGH uses the most CPU.
19+
trackStuckThresholdMs: 10000 # The threshold for how long a track can be stuck. A track is stuck if does not return any audio data.
20+
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.
1721
youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
1822
playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds
1923
youtubeSearchEnabled: true
@@ -25,6 +29,14 @@ lavalink:
2529
#strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
2630
#searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
2731
#retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times
32+
#youtubeConfig: # Required for avoiding all age restrictions by YouTube, some restricted videos still can be played without.
33+
#email: "" # Email of Google account
34+
#password: "" # Password of Google account
35+
#httpConfig: # Useful for blocking bad-actors from ip-grabbing your music node and attacking it, this way only the http proxy will be attacked
36+
#proxyHost: "localhost" # Hostname of the proxy, (ip or domain)
37+
#proxyPort: 3128 # Proxy port, 3128 is the default for squidProxy
38+
#proxyUser: "" # Optional user for basic authentication fields, leave blank if you don't use basic auth
39+
#proxyPassword: "" # Password for basic authentication
2840

2941
metrics:
3042
prometheus:
@@ -40,10 +52,13 @@ sentry:
4052

4153
logging:
4254
file:
43-
max-history: 30
44-
max-size: 1GB
45-
path: ./logs/
55+
path: ./logs/
4656

4757
level:
4858
root: INFO
4959
lavalink: INFO
60+
61+
logback:
62+
rollingpolicy:
63+
max-file-size: 1GB
64+
max-history: 30

0 commit comments

Comments
 (0)