From 225ef47a0126ad5373b27db199f38d7fec88b198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Le=C3=9Fmann=20=28MarkL4YG=29?= Date: Thu, 6 Feb 2020 18:58:45 +0100 Subject: [PATCH] Update CHANGELOG & fix Address formatting in sysInfo command --- CHANGELOG | 18 ++++++++++++++++++ src/main/java/de/fearnixx/jeak/Main.java | 8 +++++--- .../fearnixx/jeak/commandline/CLIService.java | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index cd5fafd7..4b84261d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,21 @@ +## 1.1.0 (Typed commands, Language selection) ++ Added a new command service that allows for declarative commands and typed parameters ++ Added the ability to create custom matchers for plugin specific types in command parameters ++ Added a ``!help`` command that lists commands registered to the new implementation ++ Added a ``!help `` command that shows another commands signature ++ Added a ``!locale`` command that shows the current custom locale ++ Added a ``!locale `` command that allows users to select another locale as their default ++ Added a new ``CLIService`` available to framework components to register cli-commands to ++ Added a ``sysInfo`` cli-command that prints system information +~ Changed: Sanctions on plugin IDs are less strict now. (Regex: ``"^[a-zA-Z.][a-zA-Z0-9.&+#]+$"``) +~ Downgraded dependencies: + * antlr 4.8-1 -> 4.7.1: Antlr gradle plugin is not updated yet and produces incompatible parsers. +~ Changed: REST-service now deals correctly with ``OPTIONS`` requests +~ Changed: REST-service now supports ``CORS`` +~ Changed: REST-service now supports custom headers +~ Changed: TS3PermProvider now holds internal cache of all permission IDs (when retrievable) +~ Changed: Properly set log levels in the default Log4J2 configuration + ## 1.0.4 ~ Changed: user-service performance improved by caching results for 30 seconds ~ Changed: Non-string dataSourceOptions now cause an exception diff --git a/src/main/java/de/fearnixx/jeak/Main.java b/src/main/java/de/fearnixx/jeak/Main.java index 4bbc832e..34c2524a 100644 --- a/src/main/java/de/fearnixx/jeak/Main.java +++ b/src/main/java/de/fearnixx/jeak/Main.java @@ -15,6 +15,7 @@ import java.io.File; import java.lang.management.ManagementFactory; +import java.net.InetAddress; import java.net.InterfaceAddress; import java.net.NetworkInterface; import java.util.*; @@ -112,7 +113,6 @@ public void run() { ExecutorService execSvc = Executors.newSingleThreadExecutor(); - try (Scanner sysInScanner = new Scanner(System.in)) { Supplier> next = () -> execSvc.submit(sysInScanner::nextLine); Future futConsoleLine = next.get(); @@ -225,10 +225,12 @@ public void dumpSysInfo(Consumer acceptor) { NetworkInterface netIf = netIfIterator.next(); dump.accept(String.format("[IF] Name=%s MAC=%s", netIf.getDisplayName(), Arrays.toString(netIf.getHardwareAddress()))); for (InterfaceAddress ifAddr : netIf.getInterfaceAddresses()) { - String addrStr = Arrays.toString(ifAddr.getAddress().getAddress()); + String addrStr = ifAddr.getAddress().getHostAddress(); String prefix = Integer.toString(ifAddr.getNetworkPrefixLength()); String hostname = ifAddr.getAddress().getHostName(); - String broadcast = Arrays.toString(ifAddr.getBroadcast().getAddress()); + String broadcast = Optional.ofNullable(ifAddr.getBroadcast()) + .map(InetAddress::getHostAddress) + .orElse("-"); dump.accept(String.format("IP: %s/%s [%s] BR: %s", addrStr, prefix, hostname, broadcast)); } } diff --git a/src/main/java/de/fearnixx/jeak/commandline/CLIService.java b/src/main/java/de/fearnixx/jeak/commandline/CLIService.java index c2efe000..b37d28b7 100644 --- a/src/main/java/de/fearnixx/jeak/commandline/CLIService.java +++ b/src/main/java/de/fearnixx/jeak/commandline/CLIService.java @@ -68,7 +68,7 @@ public void receiveLine(String input) { Consumer cliConsumer = cliCommands.getOrDefault(command, null); if (cliConsumer != null) { - CommandInfo commandInfo = parseCommandLine(contextPart, logger); + CommandInfo commandInfo = parseCommandLine(contextPart != null ? contextPart : "", logger); CLICommandContext cliContext = new CLICommandContext(commandInfo, getMessageConsumer()); cliConsumer.accept(cliContext);