This setup runs the service as root, if you don't want to do this that is fine however you will need to run some commands here prefixed with sudo
.
sudo -i
# or
ssh root@...
sysctl -w net.ipv6.ip_nonlocal_bind=1
echo 'net.ipv6.ip_nonlocal_bind = 1' >> /etc/sysctl.conf
mkdir -p /root/lavalink
Get a IPV6 /48 block assigned to you from https://tunnelbroker.net
- Once you created the tunnel and assigned an
/48
block to it go to "Advanced" and copy the "Example Update URL:"
nano /root/lavalink/tunnel_ip_updater.sh
#!/bin/sh
curl -4 <Example Update URL>
nano /root/lavalink/network.sh
- When prompted for the
<IP BLOCK>
, If your assigned IP block is2005:258:bf28::/48
your<IP BLOCK>
will be2005:258:bf28::2/48
#!/bin/sh
# If your host is behind a NAT then you will need to use the NAT IPv4 here
# If your host is not behind a NAT, then you will use the public IPv4 of the host.
ip tunnel add <TunnelName> mode sit remote <Tunnel Server IPv4> local <Host IPv4/NAT IPv4> ttl 255 || ip tunnel change <TunnelName> mode sit remote <Tunnel Server IPv4> local <Host IPv4/NAT IPv4> ttl 25
ip link set <TunnelName> up
ip addr replace <IP BLOCK> dev <TunnelName>
ip route replace ::/0 dev <TunnelName>
ip -6 route replace local <IP BLOCK> dev l
nano /root/lavalink/application.yml
lavalink:
plugins:
- dependency: com.github.Topis-Lavalink-Plugins:Topis-Source-Managers-Plugin:v2.0.7
repository: https://jitpack.io
- dependency: com.dunctebot:skybot-lavalink-plugin:1.4.0
repository: https://m2.duncte123.dev/releases
- dependency: com.github.topisenpai:sponsorblock-plugin:v1.0.3
repository: https://jitpack.io
server:
bufferDurationMs: 400
frameBufferDurationMs: 1000
gc-warnings: true
opusEncodingQuality: 10
password: <Password required to connect to Node>
playerUpdateInterval: 1
resamplingQuality: HIGH
soundcloudSearchEnabled: true
sources:
bandcamp: true
http: true
local: false
soundcloud: true
twitch: true
vimeo: true
youtube: true
trackStuckThresholdMs: 10000
useSeekGhosting: true
youtubePlaylistLoadLimit: 100
youtubeSearchEnabled: true
ratelimit:
ipBlocks: ["<IP BLOCK>"] # For example <2a02::2/48>
excludedIps: []
strategy: "RotatingNanoSwitch" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
searchTriggersFail: true
retryLimit: -1
youtubeConfig: # if you dont want the Age restriction bypass from this just remove this line and the 2 below it.
email: "<Google Email>"
password: "<Google Password>" # if the account has 2FA you will need an app password, I recommend making a dummy account
logging:
file:
path: ./logs/
level:
lavalink: INFO
root: INFO
logback:
rollingpolicy:
max-file-size: 25MB
max-history: 7
total-size-cap: 1GB
metrics:
prometheus:
enabled: false
endpoint: /metrics
plugins:
dunctebot:
sources:
clypit: true
getyarn: true
mixcloud: true
ocremix: true
pornhub: true
reddit: true
soundgasm: true
tiktok: true
tts: true
ttsLanguage: en-US
topissourcemanagers:
applemusic:
countryCode: <Apple Music Country Code - https://gist.github.com/daFish/5990634 - Make sure its Upper case>
providers:
- ytmsearch:"%ISRC%"
- ytsearch:"%ISRC%"
- ytmsearch:%QUERY%
- ytsearch:%QUERY%
- scsearch:%QUERY%
sources:
applemusic: true
spotify: true
spotify:
clientId: <Spotify Client ID>
clientSecret: <Spotify Client Secret>
countryCode: <Apple Music Country Code - https://gist.github.com/frankkienl/a594807bf0dcd23fdb1b>
server:
address: localhost
port: <Connection Port>
nano /etc/systemd/system/lavalink.service
[Unit]
Description=Lavalink Webserver
Requires=6to4tunnel.service
[Service]
ExecStart=/usr/bin/java -Xmx4G -Djdk.tls.client.protocols=TLSv1.1,TLSv1.2 -jar /root/lavalink/Lavalink.jar
WorkingDirectory=/root/lavalink/
User=root
Group=root
Type=idle
Restart=always
RestartSec=15
TimeoutStopSec=10
[Install]
WantedBy=multi-user.target
nano /etc/systemd/system/6to4tunnel.service
[Unit]
Description=Tunnel Setup
After=multi-user.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/bash -c '/root/lavalink/network.sh'
User=root
Group=root
RemainAfterExit=true
Type=oneshot
[Install]
WantedBy=multi-user.targe
apt-get -yq install gnupg curl
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-3_all.deb
apt-get install ./zulu-repo_1.0.0-3_all.deb
rm ./zulu-repo_1.0.0-3_all.deb
apt-get update
apt-get install zulu13-ca-jre-headless -yq
crontab -e
Add the following line to the end of the file
* * * * * bash -c "/root/lavalink/tunnel_ip_updater.sh"
systemctl enable lavalink.service
systemctl enable 6to4tunnel.service
systemctl start 6to4tunnel.service
systemctl start lavalink.service