Merge branch '14-move-to-java-25-and-use-jdave' into 'main'
move to jdk 25 Closes #14 See merge request anthorob/netneutrality!115
This commit is contained in:
commit
8101a02807
9 files changed
+53
-23
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
image: docker.io/library/eclipse-temurin:21.0.7_6-jdk-alpine@sha256:8e26f8064f2b89bc8543faf43ded3f223f47dd0a7afca042fdc892f1f6a4a8c3
|
image: docker.io/library/eclipse-temurin:25-jdk-alpine
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
MAVEN_OPTS: >-
|
MAVEN_OPTS: >-
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
wrapperVersion=3.3.4
|
wrapperVersion=3.3.4
|
||||||
distributionType=only-script
|
distributionType=only-script
|
||||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM docker.io/library/eclipse-temurin:21.0.6_7-jdk-alpine@sha256:cafcfad1d9d3b6e7dd983fa367f085ca1c846ce792da59bcb420ac4424296d56 AS build
|
FROM docker.io/library/eclipse-temurin:25-jdk-alpine AS build
|
||||||
|
|
||||||
COPY .mvn/ .mvn
|
COPY .mvn/ .mvn
|
||||||
COPY mvnw pom.xml ./
|
COPY mvnw pom.xml ./
|
||||||
@@ -9,7 +9,7 @@ RUN ["chmod", "+x", "./mvnw"]
|
|||||||
RUN ./mvnw install
|
RUN ./mvnw install
|
||||||
|
|
||||||
|
|
||||||
FROM docker.io/library/eclipse-temurin:21.0.6_7-jre-alpine@sha256:4e9ab608d97796571b1d5bbcd1c9f430a89a5f03fe5aa6c093888ceb6756c502
|
FROM docker.io/library/eclipse-temurin:25-jre-alpine
|
||||||
|
|
||||||
RUN apk add netcat-openbsd
|
RUN apk add netcat-openbsd
|
||||||
RUN apk add curl
|
RUN apk add curl
|
||||||
|
|||||||
+5
-5
@@ -8,11 +8,11 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- netneutrality-db:/var/lib/mysql
|
- netneutrality-db:/var/lib/mysql
|
||||||
environment:
|
environment:
|
||||||
MYSQL_USER: java
|
- MYSQL_USER=${MYSQL_USER:-java}
|
||||||
MYSQL_PASSWORD: password
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-password}
|
||||||
MYSQL_DATABASE: netneutrality
|
- MYSQL_DATABASE=${MYSQL_DATABASE:-netneutrality}
|
||||||
MYSQL_ROOT_PASSWORD: password
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-password}
|
||||||
MARIADB_AUTO_UPGRADE: 1
|
- MARIADB_AUTO_UPGRADE=1
|
||||||
|
|
||||||
netneutrality-bot:
|
netneutrality-bot:
|
||||||
image: registry.bobert.me/anthorob/netneutrality:${NETNEUTRALITY_TAG:-latest}
|
image: registry.bobert.me/anthorob/netneutrality:${NETNEUTRALITY_TAG:-latest}
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<main.class>me.bobert.netneutrality.NetNeutrality</main.class>
|
<main.class>me.bobert.netneutrality.NetNeutrality</main.class>
|
||||||
<java.version>21</java.version>
|
<java.version>25</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>25</maven.compiler.source>
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.target>25</maven.compiler.target>
|
||||||
<mockito.version>5.20.0</mockito.version>
|
<mockito.version>5.20.0</mockito.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.5.4</version>
|
<version>3.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>
|
<argLine>
|
||||||
-javaagent:"${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar"
|
-javaagent:"${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar"
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<version>3.3.1</version>
|
<version>3.4.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<propertiesEncoding>UTF-8</propertiesEncoding>
|
<propertiesEncoding>UTF-8</propertiesEncoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -158,17 +158,37 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.dv8tion</groupId>
|
<groupId>net.dv8tion</groupId>
|
||||||
<artifactId>JDA</artifactId>
|
<artifactId>JDA</artifactId>
|
||||||
<version>6.1.1</version>
|
<version>6.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dev.arbjerg</groupId>
|
<groupId>dev.arbjerg</groupId>
|
||||||
<artifactId>lavaplayer</artifactId>
|
<artifactId>lavaplayer</artifactId>
|
||||||
<version>2.2.4</version>
|
<version>2.2.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dev.lavalink.youtube</groupId>
|
<groupId>dev.lavalink.youtube</groupId>
|
||||||
<artifactId>v2</artifactId>
|
<artifactId>v2</artifactId>
|
||||||
<version>1.16.0</version>
|
<version>1.18.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>club.minnced</groupId>
|
||||||
|
<artifactId>jdave-api</artifactId>
|
||||||
|
<version>0.1.7</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>club.minnced</groupId>
|
||||||
|
<artifactId>jdave-native-linux-x86-64</artifactId>
|
||||||
|
<version>0.1.7</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>club.minnced</groupId>
|
||||||
|
<artifactId>jdave-native-win-x86-64</artifactId>
|
||||||
|
<version>0.1.7</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>club.minnced</groupId>
|
||||||
|
<artifactId>jdave-native-darwin</artifactId>
|
||||||
|
<version>0.1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package me.bobert.netneutrality;
|
|||||||
* https://discord.gg/qUa6zNFZsd
|
* https://discord.gg/qUa6zNFZsd
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import club.minnced.discord.jdave.interop.JDaveSessionFactory;
|
||||||
import io.sentry.Sentry;
|
import io.sentry.Sentry;
|
||||||
import me.bobert.netneutrality.core.LogHandler;
|
import me.bobert.netneutrality.core.LogHandler;
|
||||||
import me.bobert.netneutrality.core.command.CommandManager;
|
import me.bobert.netneutrality.core.command.CommandManager;
|
||||||
@@ -20,6 +21,7 @@ import me.bobert.netneutrality.music.MusicManager;
|
|||||||
import me.bobert.netneutrality.utils.Settings;
|
import me.bobert.netneutrality.utils.Settings;
|
||||||
import net.dv8tion.jda.api.JDA;
|
import net.dv8tion.jda.api.JDA;
|
||||||
import net.dv8tion.jda.api.JDABuilder;
|
import net.dv8tion.jda.api.JDABuilder;
|
||||||
|
import net.dv8tion.jda.api.audio.AudioModuleConfig;
|
||||||
import net.dv8tion.jda.api.entities.Activity;
|
import net.dv8tion.jda.api.entities.Activity;
|
||||||
import net.dv8tion.jda.api.exceptions.InvalidTokenException;
|
import net.dv8tion.jda.api.exceptions.InvalidTokenException;
|
||||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||||
@@ -34,7 +36,7 @@ public class NetNeutrality {
|
|||||||
private static NetNeutrality instance;
|
private static NetNeutrality instance;
|
||||||
private static JDA jda;
|
private static JDA jda;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
static void main() {
|
||||||
System.out.println("Starting NetNeutrality v" + VERSION);
|
System.out.println("Starting NetNeutrality v" + VERSION);
|
||||||
|
|
||||||
String env = Settings.getInstance().get("NETNEUTRALITY_BOT_ENV", "dev");
|
String env = Settings.getInstance().get("NETNEUTRALITY_BOT_ENV", "dev");
|
||||||
@@ -98,7 +100,13 @@ public class NetNeutrality {
|
|||||||
try {
|
try {
|
||||||
jda = JDABuilder
|
jda = JDABuilder
|
||||||
.createDefault(token)
|
.createDefault(token)
|
||||||
.enableIntents(GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_MESSAGE_REACTIONS, GatewayIntent.GUILD_VOICE_STATES, GatewayIntent.MESSAGE_CONTENT)
|
.enableIntents(
|
||||||
|
GatewayIntent.GUILD_MEMBERS,
|
||||||
|
GatewayIntent.GUILD_MESSAGE_REACTIONS,
|
||||||
|
GatewayIntent.GUILD_VOICE_STATES,
|
||||||
|
GatewayIntent.MESSAGE_CONTENT)
|
||||||
|
.setAudioModuleConfig(
|
||||||
|
new AudioModuleConfig().withDaveSessionFactory(new JDaveSessionFactory()))
|
||||||
.setActivity(Activity.watching("me load..."))
|
.setActivity(Activity.watching("me load..."))
|
||||||
.build();
|
.build();
|
||||||
jda.awaitReady();
|
jda.awaitReady();
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ public class DatabaseMigration {
|
|||||||
String dbUser = Settings.getInstance().get("MYSQL_USER", "root");
|
String dbUser = Settings.getInstance().get("MYSQL_USER", "root");
|
||||||
String dbPass = Settings.getInstance().get("MYSQL_PASSWORD", "");
|
String dbPass = Settings.getInstance().get("MYSQL_PASSWORD", "");
|
||||||
String dbHost = Settings.getInstance().get("MYSQL_HOST", "localhost");
|
String dbHost = Settings.getInstance().get("MYSQL_HOST", "localhost");
|
||||||
String dbUrl = String.format("jdbc:mysql://%s:3306/%s", dbHost, dbName);
|
String dbPort = Settings.getInstance().get("MYSQL_PORT", "3306");
|
||||||
|
String dbUrl = String.format("jdbc:mysql://%s:%s/%s", dbHost, dbPort, dbName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info("Running database migrations..");
|
logger.info("Running database migrations..");
|
||||||
|
|||||||
@@ -33,9 +33,10 @@ public class SessionManager {
|
|||||||
String dbUser = Settings.getInstance().get("MYSQL_USER", "root");
|
String dbUser = Settings.getInstance().get("MYSQL_USER", "root");
|
||||||
String dbPass = Settings.getInstance().get("MYSQL_PASSWORD", "");
|
String dbPass = Settings.getInstance().get("MYSQL_PASSWORD", "");
|
||||||
String dbHost = Settings.getInstance().get("MYSQL_HOST", "localhost");
|
String dbHost = Settings.getInstance().get("MYSQL_HOST", "localhost");
|
||||||
logger.info("Connecting to database '{}' at {}:3306 with user '{}'", dbName, dbHost, dbUser);
|
String dbPort = Settings.getInstance().get("MYSQL_PORT", "3306");
|
||||||
|
logger.info("Connecting to database '{}' at {}:{} with user '{}'", dbName, dbHost, dbPort, dbUser);
|
||||||
|
|
||||||
settings.put(Environment.JAKARTA_JDBC_URL, String.format("jdbc:mysql://%s:3306/%s", dbHost, dbName));
|
settings.put(Environment.JAKARTA_JDBC_URL, String.format("jdbc:mysql://%s:%s/%s", dbHost, dbPort, dbName));
|
||||||
settings.put(Environment.JAKARTA_JDBC_USER, dbUser);
|
settings.put(Environment.JAKARTA_JDBC_USER, dbUser);
|
||||||
settings.put(Environment.JAKARTA_JDBC_PASSWORD, dbPass);
|
settings.put(Environment.JAKARTA_JDBC_PASSWORD, dbPass);
|
||||||
registryBuilder.applySettings(settings);
|
registryBuilder.applySettings(settings);
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class UdioAudioSourceManager implements AudioSourceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected JsonBrowser loadTrackInfoFromPageContent(String content) throws IOException {
|
protected JsonBrowser loadTrackInfoFromPageContent(String content) throws IOException {
|
||||||
String startTag = "self.__next_f.push([1,\"9:";
|
String startTag = "self.__next_f.push([1,\"2f:";
|
||||||
String endTag = "\\n\"])";
|
String endTag = "\\n\"])";
|
||||||
|
|
||||||
String json = DataFormatTools.extractBetween(content, startTag, endTag);
|
String json = DataFormatTools.extractBetween(content, startTag, endTag);
|
||||||
|
|||||||
Reference in new issue
Block a user