From dcb5e222e7477d47ad73c11ea1af71d8bea20112 Mon Sep 17 00:00:00 2001 From: Braydon Date: Wed, 31 May 2023 19:10:56 -0400 Subject: [PATCH] Cleanup --- src/main/java/me/braydon/license/LicenseServer.java | 8 ++++++++ .../me/braydon/license/service/LicenseService.java | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/braydon/license/LicenseServer.java b/src/main/java/me/braydon/license/LicenseServer.java index b475ad6..7dc37dc 100644 --- a/src/main/java/me/braydon/license/LicenseServer.java +++ b/src/main/java/me/braydon/license/LicenseServer.java @@ -2,9 +2,11 @@ package me.braydon.license; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import jakarta.annotation.PostConstruct; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import org.mindrot.jbcrypt.BCrypt; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -36,4 +38,10 @@ public class LicenseServer { log.info("Found configuration at '{}'", config.getAbsolutePath()); // Log the found config SpringApplication.run(LicenseServer.class, args); // Load the application } + + @PostConstruct + public void onInitialize() { + // Log a randomly generated salt + log.info("Generated a random salt: {} (This is only for you to copy and paste for config)", BCrypt.gensalt()); + } } diff --git a/src/main/java/me/braydon/license/service/LicenseService.java b/src/main/java/me/braydon/license/service/LicenseService.java index ed4c172..4f0d9dc 100644 --- a/src/main/java/me/braydon/license/service/LicenseService.java +++ b/src/main/java/me/braydon/license/service/LicenseService.java @@ -51,12 +51,12 @@ public final class LicenseService { public void onInitialize() { // TODO: remove this and make it either // a test, or a route to gen a license - System.out.println("SALT - " + BCrypt.gensalt()); - // String key = RandomUtils.generateLicenseKey(); - // log.info(create(key, - // "CloudSpigot", - // "Testing " + Math.random(), Integer.MAX_VALUE, Integer.MAX_VALUE).toString()); - // System.out.println("key = " + key); + + // String key = RandomUtils.generateLicenseKey(); + // log.info(create(key, + // "CloudSpigot", + // "Testing " + Math.random(), Integer.MAX_VALUE, Integer.MAX_VALUE).toString()); + // System.out.println("key = " + key); } /**