fix(rotate-token): 加确认步骤、velocity 热加载免踢人,补齐 registry/forwarding/db 轮换
This commit is contained in:
16 files changed
+1568
-195
No files matched your search
@@ -9,6 +9,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* FelisVelocityConfig extends the shared link config with the inputs only the full
|
||||
@@ -62,8 +63,9 @@ final class FelisVelocityConfig {
|
||||
this.adminHostname = adminHostname;
|
||||
}
|
||||
|
||||
static FelisVelocityConfig load(Path file) throws IOException {
|
||||
LinkConfig link = LinkConfigLoader.load(file); // url + token (required) + template + validate
|
||||
// load reads the file; notice hears of a service token replaced in it later.
|
||||
static FelisVelocityConfig load(Path file, Consumer<String> notice) throws IOException {
|
||||
LinkConfig link = LinkConfigLoader.load(file, notice); // url + token (required) + template + validate
|
||||
Properties props = new Properties();
|
||||
if (Files.exists(file)) {
|
||||
try (InputStream in = Files.newInputStream(file)) {
|
||||
|
||||
@@ -131,7 +131,8 @@ public final class FelisVelocityPlugin {
|
||||
@Subscribe
|
||||
public void onProxyInitialize(ProxyInitializeEvent event) {
|
||||
try {
|
||||
this.config = FelisVelocityConfig.load(dataDirectory.resolve("felis-link.properties"));
|
||||
this.config = FelisVelocityConfig.load(dataDirectory.resolve("felis-link.properties"),
|
||||
msg -> logger.info("Felis: {}", msg));
|
||||
} catch (Exception e) {
|
||||
logger.error("Felis disabled: {}", e.getMessage());
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user