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.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());
}
}

View File

@ -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);
}
/**