fix acces password server behaviour and default password auth

This commit is contained in:
Sen 2025-05-29 12:57:35 +02:00
parent 902c795ecc
commit 18f37874fa
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
2 changed files with 4 additions and 4 deletions

View file

@ -262,7 +262,7 @@ public final class Server implements IThreadListener {
}, "port");
Config.setCallback(new Runnable() {
public void run() {
if(Config.password.length() < 8 || Config.password.length() > IPlayer.MAX_PASS_LENGTH) {
if((!Config.password.isEmpty() && Config.password.length() < 8) || Config.password.length() > IPlayer.MAX_PASS_LENGTH) {
Log.IO.error("Passwort muss aus 8-" + IPlayer.MAX_PASS_LENGTH + " Zeichen bestehen");
Config.set("password", "", false);
}
@ -523,7 +523,7 @@ public final class Server implements IThreadListener {
this.bind(Config.port);
else
Log.SYSTEM.warn("Kein Port definiert, verwende 'port <1024-32767>' um einen Hosting-Port festzulegen");
if(Config.password.length() < 8)
if(Config.accessRequired && Config.password.length() < 8)
Log.SYSTEM.warn("Kein Passwort definiert, verwende 'password <8-" + IPlayer.MAX_PASS_LENGTH + " Zeichen>' um ein Zugangspasswort festzulegen");
Thread con = new Thread(new Runnable() {
private final BufferedReader reader = new BufferedReader(new InputStreamReader(new BufferedInputStream(System.in)));