diff --git a/blueprints/lavalink/docker-compose.yml b/blueprints/lavalink/docker-compose.yml new file mode 100644 index 00000000..1f4e91cf --- /dev/null +++ b/blueprints/lavalink/docker-compose.yml @@ -0,0 +1,41 @@ +services: + fix-perms: + image: busybox:1.36 + command: > + sh -c "mkdir -p /opt/Lavalink/plugins && + chmod -R 0777 /opt/Lavalink/plugins || true && + chown -R 1000:1000 /opt/Lavalink/plugins || true && + echo perms-fixed && sleep 1" + volumes: + - "../files/plugins/:/opt/Lavalink/plugins/" + - "../files/application.yml:/opt/Lavalink/application.yml" + restart: "no" + lavalink: + image: ghcr.io/lavalink-devs/lavalink:4 + depends_on: + - fix-perms + restart: unless-stopped + environment: + _JAVA_OPTIONS: "${_JAVA_OPTIONS:--Xmx6G}" + LAVALINK_SERVER_PASSWORD: "${LAVALINK_SERVER_PASSWORD:-youshallnotpass}" + SERVER_PORT: "${SERVER_PORT:-2333}" + volumes: + - "../files/application.yml:/opt/Lavalink/application.yml:rw" + - "../files/plugins/:/opt/Lavalink/plugins/:rw" + ports: + - ${SERVER_PORT} + + healthcheck: + test: > + sh -c 'wget --header="Authorization: ${LAVALINK_SERVER_PASSWORD}" -qO- http://127.0.0.1:${SERVER_PORT}/v4/info >/dev/null 2>&1 || exit 1' + interval: 100s + timeout: 5s + retries: 5 + start_period: 30s + + entrypoint: > + sh -c 'until [ -w /opt/Lavalink/plugins ] ; do + echo "waiting for /opt/Lavalink/plugins to be writable"; + sleep 1; + done; + exec java -jar /opt/Lavalink/Lavalink.jar' diff --git a/blueprints/lavalink/lavalink.svg b/blueprints/lavalink/lavalink.svg new file mode 100644 index 00000000..0ade923f --- /dev/null +++ b/blueprints/lavalink/lavalink.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + diff --git a/blueprints/lavalink/template.toml b/blueprints/lavalink/template.toml new file mode 100644 index 00000000..6c9a92cd --- /dev/null +++ b/blueprints/lavalink/template.toml @@ -0,0 +1,123 @@ +[variables] +main_domain = "${domain}" +server_port = "2333" +lavalink_server_password = "${password}" + +[config] +[[config.mounts]] +filePath = "./application.yml" +content = """ +server: # REST and WS server + port: 2333 + address: 0.0.0.0 + http2: + enabled: false +plugins: +# name: # Name of the plugin +# some_key: some_value # Some key-value pair for the plugin +# another_key: another_value +lavalink: + plugins: + # - dependency: "com.github.username.pluginName:pluginName-plugin:x.y.z" + # snapshot: false + # pluginsDir: "/opt/Lavalink/plugins" + # defaultPluginRepository: "https://maven.lavalink.dev/releases" + # defaultPluginSnapshotRepository: "https://maven.lavalink.dev/snapshots" + server: + password: "youshallnotpass" + sources: + # The default Youtube source is now deprecated and won't receive further updates. Please use https://github.com/lavalink-devs/youtube-source#plugin instead. + youtube: true + bandcamp: true + soundcloud: true + twitch: true + vimeo: true + nico: true + http: true + local: false + filters: + volume: true + equalizer: true + karaoke: true + timescale: true + tremolo: true + vibrato: true + distortion: true + rotation: true + channelMix: true + lowPass: true + nonAllocatingFrameBuffer: false + bufferDurationMs: 400 + frameBufferDurationMs: 5000 + opusEncodingQuality: 10 + resamplingQuality: LOW + trackStuckThresholdMs: 10000 + useSeekGhosting: true + youtubePlaylistLoadLimit: 6 + playerUpdateInterval: 5 + youtubeSearchEnabled: true + soundcloudSearchEnabled: true + gc-warnings: true + #ratelimit: + #ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks + #excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by 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 + timeouts: + connectTimeoutMs: 3000 + connectionRequestTimeoutMs: 3000 + socketTimeoutMs: 3000 + +metrics: + prometheus: + enabled: false + endpoint: /metrics + +sentry: + dsn: "" + environment: "" +# tags: +# some_key: some_value +# another_key: another_value + +logging: + file: + path: ./logs/ + + level: + root: INFO + lavalink: INFO + + request: + enabled: true + includeClientInfo: true + includeHeaders: false + includeQueryString: true + includePayload: true + maxPayloadLength: 10000 + + + logback: + rollingpolicy: + max-file-size: 1GB + max-history: 30 +""" + +[[config.domains]] +serviceName = "lavalink" +port = 2_333 +host = "${main_domain}" + +[config.env] +_JAVA_OPTIONS = "-Xmx6G" +LAVALINK_SERVER_PASSWORD = "${lavalink_server_password}" +SERVER_PORT = "${server_port}" diff --git a/meta.json b/meta.json index 7b624bfa..7dc8663c 100644 --- a/meta.json +++ b/meta.json @@ -3390,6 +3390,22 @@ "ai" ] }, + { + "id": "lavalink", + "name": "Lavalink", + "version": "4.1.1", + "description": "Lavalink is an open source standalone audio sending node based on Lavaplayer.", + "logo": "lavalink.svg", + "links": { + "github": "https://github.com/lavalink-devs/Lavalink", + "website": "https://lavalink.dev/", + "docs": "https://lavalink.dev/getting-started/index.html" + }, + "tags": [ + "voice", + "discord" + ] + }, { "id": "letterfeed", "name": "Letterfeed",