fixing some stuff
CI/CD / build (push) Successful in 44s
CI/CD / deploy (push) Failing after 21s

This commit is contained in:
2026-07-10 00:41:56 +02:00
parent cbefb7b21f
commit 80719eb253
4 changed files with 31 additions and 6 deletions
+11 -3
View File
@@ -44,6 +44,14 @@ jobs:
chmod 600 ~/.ssh/key chmod 600 ~/.ssh/key
ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
ssh -i ~/.ssh/key \ HOST=${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}
${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} \ DIR=~/programs/botinator
"cd ~/programs/botinator && docker compose pull && docker compose up -d"
# Ship the compose file and Lavalink config to the server. .env and
# catchphrases.txt live on the server and are intentionally not copied.
ssh -i ~/.ssh/key $HOST "mkdir -p $DIR/lavalink"
scp -i ~/.ssh/key docker-compose.yaml $HOST:'~/programs/botinator/docker-compose.yaml'
scp -i ~/.ssh/key lavalink/application.yml $HOST:'~/programs/botinator/lavalink/application.yml'
ssh -i ~/.ssh/key $HOST \
"cd $DIR && docker compose pull && docker compose up -d"
+9 -1
View File
@@ -14,16 +14,24 @@ services:
- .env - .env
environment: environment:
- LAVALINK_URI=ws://lavalink:2333 - LAVALINK_URI=ws://lavalink:2333
# Catchphrases are supplied at deploy time # Catchphrases and the AR-meter user lists are supplied at deploy time,
# not baked into the image.
volumes: volumes:
- ./catchphrases.txt:/app/catchphrases.txt:ro - ./catchphrases.txt:/app/catchphrases.txt:ro
- ./always100.txt:/app/always100.txt:ro
- ./always90.txt:/app/always90.txt:ro
lavalink: lavalink:
image: ghcr.io/lavalink-devs/lavalink:4 image: ghcr.io/lavalink-devs/lavalink:4
container_name: lavalink container_name: lavalink
restart: unless-stopped restart: unless-stopped
env_file:
- .env
environment: environment:
- _JAVA_OPTIONS=-Xmx1G - _JAVA_OPTIONS=-Xmx1G
# Lavalink reads this for lavalink.server.password in application.yml.
# Keep it equal to LAVALINK_PASSWORD (what the bot uses to connect).
- LAVALINK_SERVER_PASSWORD=${LAVALINK_PASSWORD}
volumes: volumes:
- ./lavalink/application.yml:/opt/Lavalink/application.yml:ro - ./lavalink/application.yml:/opt/Lavalink/application.yml:ro
- ./lavalink/plugins/:/opt/Lavalink/plugins/ - ./lavalink/plugins/:/opt/Lavalink/plugins/
+3 -1
View File
@@ -11,7 +11,9 @@ lavalink:
- dependency: "dev.lavalink.youtube:youtube-plugin:1.18.1" - dependency: "dev.lavalink.youtube:youtube-plugin:1.18.1"
snapshot: false snapshot: false
server: server:
password: "youshallnotpass" # Sourced from the LAVALINK_SERVER_PASSWORD env var (set by docker-compose
# from LAVALINK_PASSWORD in .env). Required — the server won't start without it.
password: "${LAVALINK_SERVER_PASSWORD}"
sources: sources:
youtube: false # handled by the plugin below, not the core source youtube: false # handled by the plugin below, not the core source
bandcamp: true bandcamp: true
+8 -1
View File
@@ -34,13 +34,20 @@ public class Main extends ListenerAdapter {
System.exit(1); System.exit(1);
} }
String lavalinkPassword = System.getenv("LAVALINK_PASSWORD");
if (lavalinkPassword == null || lavalinkPassword.isBlank()) {
System.err.println("ERROR: environment variable LAVALINK_PASSWORD is not set. "
+ "Set it to your Lavalink server password (see .env) and try again.");
System.exit(1);
}
// Lavalink client must be created before JDA so we can plug in the voice // Lavalink client must be created before JDA so we can plug in the voice
// interceptor. Its node points at a running Lavalink v4 server. // interceptor. Its node points at a running Lavalink v4 server.
LavalinkClient lavalink = new LavalinkClient(Helpers.getUserIdFromToken(token)); LavalinkClient lavalink = new LavalinkClient(Helpers.getUserIdFromToken(token));
lavalink.addNode(new NodeOptions.Builder() lavalink.addNode(new NodeOptions.Builder()
.setName("main") .setName("main")
.setServerUri(getenv("LAVALINK_URI", "ws://localhost:2333")) .setServerUri(getenv("LAVALINK_URI", "ws://localhost:2333"))
.setPassword(getenv("LAVALINK_PASSWORD", "youshallnotpass")) .setPassword(lavalinkPassword)
.build()); .build());
MusicManager musicManager = new MusicManager(lavalink); MusicManager musicManager = new MusicManager(lavalink);