This commit is contained in:
Braydon 2023-05-31 19:10:56 -04:00
parent b60d965dec
commit dcb5e222e7
2 changed files with 14 additions and 6 deletions

View File

@ -2,9 +2,11 @@ package me.braydon.license;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import jakarta.annotation.PostConstruct;
import lombok.NonNull; import lombok.NonNull;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.mindrot.jbcrypt.BCrypt;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -36,4 +38,10 @@ public class LicenseServer {
log.info("Found configuration at '{}'", config.getAbsolutePath()); // Log the found config log.info("Found configuration at '{}'", config.getAbsolutePath()); // Log the found config
SpringApplication.run(LicenseServer.class, args); // Load the application 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());
}
} }

View File

@ -51,7 +51,7 @@ public final class LicenseService {
public void onInitialize() { public void onInitialize() {
// TODO: remove this and make it either // TODO: remove this and make it either
// a test, or a route to gen a license // a test, or a route to gen a license
System.out.println("SALT - " + BCrypt.gensalt());
// String key = RandomUtils.generateLicenseKey(); // String key = RandomUtils.generateLicenseKey();
// log.info(create(key, // log.info(create(key,
// "CloudSpigot", // "CloudSpigot",