diff --git a/gradle.properties b/gradle.properties index e4ea54a..cafe916 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ org.gradle.configuration-cache=false org.gradle.parallel=true org.gradle.caching=true -rbcs.version = 0.5.0 +rbcs.version = 0.5.1 -lys.version = 2026.05.27 +lys.version = 2026.06.08 gitea.maven.url = https://gitea.woggioni.net/api/packages/woggioni/maven docker.registry.url=gitea.woggioni.net diff --git a/rbcs-cli/build.gradle b/rbcs-cli/build.gradle index 700efd4..e1b3136 100644 --- a/rbcs-cli/build.gradle +++ b/rbcs-cli/build.gradle @@ -90,7 +90,7 @@ Provider envelopeJarTaskProvider = tasks.named(EnvelopePlugin.E tasks.named(NativeImagePlugin.CONFIGURE_NATIVE_IMAGE_TASK_NAME, NativeImageConfigurationTask) { toolchain { languageVersion = JavaLanguageVersion.of(25) - vendor = JvmVendorSpec.GRAAL_VM + vendor = JvmVendorSpec.ORACLE } mainClass = "net.woggioni.rbcs.cli.graal.GraalNativeImageConfiguration" classpath = project.files( @@ -108,10 +108,10 @@ tasks.named(NativeImagePlugin.CONFIGURE_NATIVE_IMAGE_TASK_NAME, NativeImageConfi nativeImage { toolchain { languageVersion = JavaLanguageVersion.of(25) - vendor = JvmVendorSpec.GRAAL_VM + vendor = JvmVendorSpec.ORACLE } mainClass = mainClassName -// mainModule = mainModuleName + mainModule = mainModuleName useMusl = true buildStaticImage = true linkAtBuildTime = false @@ -127,7 +127,7 @@ Provider upxTaskProvider = tasks.named(NativeImagePlugin.UPX_TASK_NAME, Provider jlinkTaskProvider = tasks.named(JlinkPlugin.JLINK_TASK_NAME, JlinkTask) { toolchain { languageVersion = JavaLanguageVersion.of(25) - vendor = JvmVendorSpec.GRAAL_VM + vendor = JvmVendorSpec.ORACLE } mainClass = mainClassName diff --git a/rbcs-cli/native-image/native-image.properties b/rbcs-cli/native-image/native-image.properties index 68a9888..cd69521 100644 --- a/rbcs-cli/native-image/native-image.properties +++ b/rbcs-cli/native-image/native-image.properties @@ -1,2 +1,2 @@ -Args=-O3 -march=x86-64-v2 --gc=serial --initialize-at-run-time=io.netty --enable-url-protocols=jpms -H:+UnlockExperimentalVMOptions -H:+SharedArenaSupport --initialize-at-build-time=net.woggioni.rbcs.common.RbcsUrlStreamHandlerFactory,net.woggioni.rbcs.common.RbcsUrlStreamHandlerFactory$JpmsHandler +Args=-O3 -march=x86-64-v2 --gc=serial --initialize-at-run-time=io.netty --enable-url-protocols=jpms --emit build-report -H:+UnlockExperimentalVMOptions -H:+SharedArenaSupport --initialize-at-build-time=net.woggioni.rbcs.common.RbcsUrlStreamHandlerFactory,net.woggioni.rbcs.common.RbcsUrlStreamHandlerFactory$JpmsHandler --add-opens=io.netty.common/io.netty.util=org.graalvm.nativeimage.builder --add-opens=io.netty.common/io.netty.util.internal.svm=org.graalvm.nativeimage.builder #-H:TraceClassInitialization=io.netty.handler.ssl.BouncyCastleAlpnSslUtils \ No newline at end of file diff --git a/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/RemoteBuildCacheServer.kt b/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/RemoteBuildCacheServer.kt index 4484d82..e6aae20 100644 --- a/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/RemoteBuildCacheServer.kt +++ b/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/RemoteBuildCacheServer.kt @@ -188,7 +188,7 @@ class RemoteBuildCacheServer(private val cfg: Configuration) { ?: return anonymousUserGroups?.let { AuthenticationResult(null, it) } val ldapName = try { LdapName(subjectDn) - } catch (e: Exception) { + } catch (_: Exception) { log.debug(ctx) { "Invalid subject DN in header $headerName: $subjectDn" } @@ -354,7 +354,7 @@ class RemoteBuildCacheServer(private val cfg: Configuration) { }?.let { pattern.matcher(it.value.toString()) }?.takeIf(Matcher::matches)?.group(1) - cfg.users[userName] ?: throw java.lang.RuntimeException("Failed to extract user") + cfg.users[userName] ?: throw RuntimeException("Failed to extract user") } } @@ -368,7 +368,7 @@ class RemoteBuildCacheServer(private val cfg: Configuration) { }?.let { pattern.matcher(it.value.toString()) }?.takeIf(Matcher::matches)?.group(1) - cfg.groups[groupName] ?: throw java.lang.RuntimeException("Failed to extract group") + cfg.groups[groupName] ?: throw RuntimeException("Failed to extract group") } } diff --git a/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/configuration/Parser.kt b/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/configuration/Parser.kt index f1ac5c6..7969fab 100644 --- a/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/configuration/Parser.kt +++ b/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/configuration/Parser.kt @@ -344,14 +344,14 @@ object Parser { roles = parseRoles(child) } "group-quota" -> { - userQuota = parseQuota(child) + groupQuota = parseQuota(child) } "user-quota" -> { - groupQuota = parseQuota(child) + userQuota = parseQuota(child) } } } - groupName to Group(groupName, roles, userQuota, groupQuota) + groupName to Group(groupName, roles, groupQuota, userQuota) }.toMap() val users = knownUsersMap.map { (name, user) -> name to User(name, user.password, userGroups[name]?.mapNotNull { groups[it] }?.toSet() ?: emptySet(), user.quota) diff --git a/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/handler/ProxyProtocolHandler.kt b/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/handler/ProxyProtocolHandler.kt index 6a733c0..cb14e67 100644 --- a/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/handler/ProxyProtocolHandler.kt +++ b/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/handler/ProxyProtocolHandler.kt @@ -23,23 +23,21 @@ class ProxyProtocolHandler(private val trustedProxyIPs : List) : SimpleCha ) { val sourceAddress = ctx.channel().remoteAddress() if (sourceAddress is InetSocketAddress && - trustedProxyIPs.isEmpty() || - trustedProxyIPs.any { it.contains((sourceAddress as InetSocketAddress).address) }.also { - if(!it && log.isTraceEnabled) { + (trustedProxyIPs.isEmpty() || + trustedProxyIPs.any { it.contains(sourceAddress.address) }.also { + if(!it) { log.trace { "Received a proxied connection request from $sourceAddress which is not a trusted proxy address, " + "the proxy server address will be used instead" } } - }) { + })) { val proxiedClientAddress = InetSocketAddress( InetAddress.ofLiteral(msg.sourceAddress()), msg.sourcePort() ) - if(log.isTraceEnabled) { - log.trace { - "Received proxied connection request from $sourceAddress forwarded for $proxiedClientAddress" - } + log.trace { + "Received proxied connection request from $sourceAddress forwarded for $proxiedClientAddress" } ctx.channel().attr(RemoteBuildCacheServer.clientIp).set(proxiedClientAddress) } diff --git a/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/handler/ServerHandler.kt b/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/handler/ServerHandler.kt index 90e8485..d16493d 100644 --- a/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/handler/ServerHandler.kt +++ b/rbcs-server/src/main/kotlin/net/woggioni/rbcs/server/handler/ServerHandler.kt @@ -171,7 +171,6 @@ class ServerHandler(private val serverPrefix: Path, private val cacheHandlerSupp ctx.pipeline().addBefore(ExceptionHandler.NAME, null, cacheHandler) key.let(::CacheGetRequest) .let(ctx::fireChannelRead) - ?: ctx.channel().write(CacheValueNotFoundResponse(key)) } else { cacheRequestInProgress = false log.warn(ctx) { diff --git a/settings.gradle b/settings.gradle index 48c9c24..07e5324 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,12 @@ pluginManagement { repositories { +// mavenLocal { +// content { +// includeGroup 'net.woggioni.gradle' +// includeGroup 'net.woggioni.gradle.lombok' +// includeGroup 'net.woggioni.gradle.finalguard' +// } +// } maven { url = getProperty('gitea.maven.url') }