Skip to content

Commit e3aa83e

Browse files
authored
Merge pull request #186 from Darkside138/daveProtocol
Dave protocol
2 parents c3bfe96 + a864edf commit e3aa83e

File tree

32 files changed

+255
-262
lines changed

32 files changed

+255
-262
lines changed

.github/workflows/gradle.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v4
21-
- name: Set up JDK 17
22-
uses: actions/setup-java@v1
21+
- name: Set up JDK 25
22+
uses: actions/setup-java@v4
2323
with:
24-
java-version: 17
24+
java-version: '25'
25+
distribution: 'temurin'
2526
- name: Grant execute permission for gradlew
2627
run: chmod +x gradlew
2728
- name: Build with Gradle

.github/workflows/publish.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Master Branch Publish
1+
name: Docker Publish
22
permissions:
33
contents: read
44

55
on:
66
push:
7-
branches: [ master ]
7+
branches:
8+
- '**'
89

910
jobs:
1011
publish-docker-image:
@@ -28,6 +29,7 @@ jobs:
2829
password: ${{ secrets.SOUNDBOARD_GHCR }}
2930

3031
# Generate tags + labels for BOTH registries
32+
# master -> latest, other branches -> branch name
3133
- name: Extract metadata (tags, labels) for Docker
3234
id: meta
3335
uses: docker/metadata-action@v5
@@ -36,7 +38,8 @@ jobs:
3638
davefurrer/discordsoundboard
3739
ghcr.io/${{ github.repository }}
3840
tags: |
39-
type=raw,value=latest
41+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
42+
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master' }}
4043
4144
# Build & push using metadata
4245
- name: Build and push Docker images
@@ -47,9 +50,20 @@ jobs:
4750
tags: ${{ steps.meta.outputs.tags }}
4851
labels: ${{ steps.meta.outputs.labels }}
4952

53+
- name: Get Docker tag and version
54+
id: docker_info
55+
run: |
56+
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
57+
echo "tag=latest" >> $GITHUB_OUTPUT
58+
else
59+
echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
60+
fi
61+
VERSION=$(grep '^projectVersion=' gradle.properties | cut -d'=' -f2)
62+
echo "version=$VERSION" >> $GITHUB_OUTPUT
63+
5064
- name: Actions for Discord
5165
uses: Ilshidur/action-discord@0.4.0
5266
env:
5367
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
5468
with:
55-
args: '{{ EVENT_PAYLOAD.repository.full_name }} Unraid/Docker image has been updated.'
69+
args: '{{ EVENT_PAYLOAD.repository.full_name }} v${{ steps.docker_info.outputs.version }} Docker image updated: `${{ steps.docker_info.outputs.tag }}`'

.github/workflows/version.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

Docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#This Dockerfile is for general use (Unraid dockerfiles are in the root of the project
2-
FROM ubuntu:22.04
2+
FROM ubuntu:24.04
33

44
#Install required packages
55
RUN apt update && \
66
apt upgrade -y && \
7-
apt install wget openjdk-17-jdk dos2unix unzip jq curl -y \
7+
apt install wget openjdk-25-jdk dos2unix unzip jq curl -y \
88

99
#Set working dir
1010
WORKDIR "/etc"

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# ---- Build Stage ----
2-
FROM gradle:7.4.2-jdk17 AS builder
2+
FROM eclipse-temurin:25-jdk AS builder
33

44
LABEL org.opencontainers.image.source = https://github.com/Darkside138/DiscordSoundboard
55

6-
USER root
7-
RUN apt-get update && apt-get install -y nodejs npm
6+
RUN apt-get update && apt-get install -y nodejs npm unzip
87

98
WORKDIR /app
109

@@ -25,7 +24,8 @@ RUN unzip DiscordSoundboard.zip
2524
RUN rm DiscordSoundboard.zip
2625

2726
# ---- Runtime Stage ----
28-
FROM bellsoft/liberica-openjdk-alpine:17.0.2-9
27+
# Using Debian-based image (not alpine) for glibc compatibility with jDave native libraries
28+
FROM eclipse-temurin:25-jre
2929

3030
WORKDIR /etc/DiscordSoundboard
3131

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
Simple soundboard for discord. You can trigger sounds by commands typed in discord chat, or you can
99
choose the sound from the web UI. You will need to create a bot account that the bot will use to join
1010
and play sounds. The bot can only play sounds/respond to commands for servers it has been given access to.
11-
Requires java 8 or higher. This bot uses the [DiscordJDA](https://github.com/DV8FromTheWorld/JDA) library.
11+
Requires Java 25 or higher. This bot uses the [DiscordJDA](https://github.com/DV8FromTheWorld/JDA) library (version 6.3.0) with DAVE protocol support for Discord audio encryption.
1212

1313

1414
[4.1.9.zip](https://github.com/Darkside138/DiscordSoundboard/releases/latest)
1515

16-
## Must have Java 17+ 64bit version installed in order for the soundboard to work properly
16+
## Must have Java 25+ 64bit version installed in order for the soundboard to work properly
1717

1818
Join the official discord: [https://discord.gg/kZTNtfW](https://discord.gg/kZTNtfW)
1919

2020
## 4.* Releases
2121
**If you're updating from any version prior to 4.0 you will need to delete your old DB file.** The release of 4.* updates
22-
the JDA library to 6.1.1 and some updates to the legacy UI. In 4.1.* and above, I added a new UI available at {BASE_URL}/indexV2.html.
22+
the JDA library to 6.3.0 with DAVE (Discord Audio Video Encryption) protocol support and some updates to the legacy UI. In 4.1.* and above, I added a new UI available at {BASE_URL}/indexV2.html.
2323
The new UI allows OAuth through Discord. The UI should work fine without configuring OAuth but will give extra functionality
2424
if you do configure it for users you grant roles to (Admin, Moderator, or DJ). To configure, you'll need to go to the [Discord
2525
developer portal](https://discord.com/developers/applications/), click your application, select OAuth2. From this screen

build.gradle

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test {
4747

4848
java {
4949
toolchain {
50-
languageVersion = JavaLanguageVersion.of(17)
50+
languageVersion = JavaLanguageVersion.of(25)
5151
}
5252
}
5353

@@ -59,12 +59,18 @@ tasks.named("bootJar") {
5959
}
6060

6161
dependencies {
62-
implementation 'net.dv8tion:JDA:6.1.1'
63-
//implementation 'com.github.walkyst:lavaplayer-fork:1.4.0'
64-
implementation 'com.sedmelluq:lavaplayer:1.3.78'
65-
implementation 'com.github.aikaterna:lavaplayer-natives:original-SNAPSHOT'
62+
implementation 'net.dv8tion:JDA:6.3.0'
63+
// Using Lavalink's actively maintained lavaplayer fork for JDK 25 compatibility
64+
implementation 'dev.arbjerg:lavaplayer:2.2.6'
6665
implementation 'pw.chew:jda-chewtils:1.24.1'
6766

67+
// JDAVE for Discord Audio Video Encryption (DAVE) protocol - required for JDA 6.3.0+
68+
implementation 'club.minnced:jdave-api:0.1.5'
69+
runtimeOnly 'club.minnced:jdave-native-linux-x86-64:0.1.5'
70+
runtimeOnly 'club.minnced:jdave-native-linux-aarch64:0.1.5'
71+
runtimeOnly 'club.minnced:jdave-native-win-x86-64:0.1.5'
72+
runtimeOnly 'club.minnced:jdave-native-darwin:0.1.5'
73+
6874
implementation 'commons-io:commons-io:2.14.0'
6975
compileOnly 'org.projectlombok:lombok'
7076
annotationProcessor 'org.projectlombok:lombok'
@@ -87,8 +93,8 @@ dependencies {
8793
testImplementation 'org.springframework.boot:spring-boot-starter-test'
8894
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
8995
testImplementation "org.mockito:mockito-core:4.4.0"
90-
testCompileOnly 'org.projectlombok:lombok:1.18.22'
91-
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
96+
testCompileOnly 'org.projectlombok:lombok'
97+
testAnnotationProcessor 'org.projectlombok:lombok'
9298
}
9399

94100
node {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
projectVersion=4.1.37
1+
projectVersion=4.1.54
22
org.gradle.configuration-cache=false

src/frontend/src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ export default function App() {
239239
<div className="relative">
240240
<Search className={`absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 ${theme === 'dark' ? 'text-gray-500' : 'text-gray-400'}`} />
241241
<input
242+
id="soundSearch"
242243
type="text"
243244
placeholder="Search sounds..."
244245
value={searchQuery}
@@ -263,8 +264,9 @@ export default function App() {
263264

264265
{/* Category Filter and Playback Info */}
265266
<div className="mb-4 flex items-center gap-3 flex-wrap">
266-
<label className={theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}>Category</label>
267+
<label for="categorySelect" className={theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}>Category</label>
267268
<select
269+
id="categorySelect"
268270
value={selectedCategory}
269271
onChange={(e) => {
270272
setSelectedCategory(e.target.value);

src/frontend/src/components/ContextMenu.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,17 @@ export function ContextMenu({
7878

7979
// Block if we just sent a request within the last 300ms
8080
if (now - lastUpdateTimeRef.current < 300) {
81-
console.log('Blocked duplicate API call (too soon)');
8281
return;
8382
}
8483

8584
// Block if this exact value was already sent
8685
if (lastSentValueRef.current === newValue) {
87-
console.log('Blocked duplicate API call (same value)');
8886
return;
8987
}
9088

9189
lastUpdateTimeRef.current = now;
9290
setIsUpdating(true);
9391

94-
console.log(`Calling API to update volume offset to ${newValue}%`);
95-
9692
try {
9793
const url = new URL(`${API_BASE_URL}/api/soundFiles/${soundId}`, window.location.origin);
9894
url.searchParams.append('volumeOffsetPercentage', newValue.toString());
@@ -107,17 +103,13 @@ export function ContextMenu({
107103
});
108104

109105
if (!response.ok) {
110-
console.error('Failed to update volume offset:', response.status, response.statusText);
111-
// Revert to original value on error
112106
setLocalVolumeOffset(volumeOffset ?? 0);
113107
toast.error('Failed to update volume offset');
114108
} else {
115109
lastSentValueRef.current = newValue;
116110
toast.success('Volume offset updated');
117111
}
118-
} catch (error) {
119-
console.error('Error updating volume offset:', error);
120-
// Revert to original value on error
112+
} catch {
121113
setLocalVolumeOffset(volumeOffset ?? 0);
122114
toast.error('Failed to update volume offset');
123115
} finally {
@@ -130,20 +122,14 @@ export function ContextMenu({
130122
};
131123

132124
const handleVolumeRelease = () => {
133-
console.log('handleVolumeRelease called');
134-
135-
// Only update if the value has changed from what we last sent
136125
if (localVolumeOffset !== lastSentValueRef.current) {
137126
updateVolumeOffset(localVolumeOffset);
138-
} else {
139-
console.log('No change in volume, skipping API call');
140127
}
141128
};
142129

143130
// Update display name on the backend
144131
const updateDisplayName = async (newName: string) => {
145132
setIsUpdatingName(true);
146-
console.log(`Calling API to update display name to: ${newName}`);
147133

148134
try {
149135
const url = new URL(`${API_BASE_URL}/api/soundFiles/${soundId}`, window.location.origin);
@@ -159,18 +145,13 @@ export function ContextMenu({
159145
});
160146

161147
if (!response.ok) {
162-
console.error('Failed to update display name:', response.status, response.statusText);
163-
// Revert to original value on error
164148
setEditedDisplayName(displayName || '');
165149
toast.error('Failed to update display name');
166150
} else {
167-
console.log('Display name updated successfully');
168151
setSavedDisplayName(newName);
169152
toast.success('Display name updated');
170153
}
171-
} catch (error) {
172-
console.error('Error updating display name:', error);
173-
// Revert to original value on error
154+
} catch {
174155
setEditedDisplayName(displayName || '');
175156
toast.error('Failed to update display name');
176157
} finally {

0 commit comments

Comments
 (0)