🐛 fix: restore plugin auth and proxy connection info

This commit is contained in:
2026-08-13 02:32:39 +07:00
parent 3df22125dd
commit 5567ac6594
20 changed files with 141 additions and 65 deletions
@@ -42,7 +42,7 @@ class Main @Inject constructor(private val logger: Logger, private val server: P
private val client = OkHttpClient()
private val apiKey: String = System.getenv("MINIKURA_API_KEY") ?: ""
private val apiUrl: String = System.getenv("MINIKURA_API_URL") ?: "http://localhost:3000/api"
private val websocketUrl: String = System.getenv("MINIKURA_WEBSOCKET_URL") ?: "ws://localhost:3000/ws?apiKey=$apiKey"
private val websocketUrl: String = System.getenv("MINIKURA_WEBSOCKET_URL") ?: "ws://localhost:3000/api/servers/ws?apiKey=$apiKey"
private var acceptingTransfers = AtomicBoolean(false)
private val redisBungeeApi = RedisBungeeAPI.getRedisBungeeApi()
@@ -158,7 +158,7 @@ class Main @Inject constructor(private val logger: Logger, private val server: P
private fun fetchReverseProxyServers() {
val request = Request.Builder()
.url("$apiUrl/reverse_proxy_servers")
.url("$apiUrl/plugin/reverse-proxy")
.header("Authorization", "Bearer $apiKey")
.build()
@@ -185,7 +185,7 @@ class Main @Inject constructor(private val logger: Logger, private val server: P
private fun fetchServers() {
server.allServers.forEach { server.unregisterServer(it.serverInfo) }
val request = Request.Builder()
.url("$apiUrl/servers")
.url("$apiUrl/plugin/servers")
.header("Authorization", "Bearer $apiKey")
.build()
@@ -30,14 +30,7 @@ class MinikuraWebSocketClient(private val plugin: Main, private val logger: Logg
"test" -> {
logger.info("API Call detected: endpoint=$endpoint, timestamp=$timestamp")
when (endpoint) {
"/servers" -> {
logger.info("dawdawdawdawd")
}
else -> {
logger.info("API endpoint $endpoint was accessed")
}
}
logger.info("API endpoint $endpoint was accessed")
}
"SERVER_CHANGE" -> {
val action = jsonObject.get("action")?.asString
@@ -46,7 +39,7 @@ class MinikuraWebSocketClient(private val plugin: Main, private val logger: Logg
logger.info("Server change detected: action=$action, serverType=$serverType, serverId=$serverId")
when (action) {
when (action?.uppercase()) {
"CREATE" -> {
logger.info("Server '$serverId' was created")
executeRefreshCommand()