update to netty 4.2.15
CI / build (push) Successful in 3m52s

This commit is contained in:
woggioni committed 2026-06-12 09:43:39 +08:00
1 parent 77cc044d0e
commit 4b2f2da35f
13 files changed
+1101 -30

No files matched your search

-2
View File
@@ -4,8 +4,6 @@
# Ignore Gradle build output directory
build
rbcs-cli/native-image/*.json
# Ignore JDTLS files
.classpath
.project
+1
View File
@@ -50,6 +50,7 @@ COPY --from=base-native /etc/rbcs /etc/rbcs
COPY --from=base-native /var/lib/rbcs /var/lib/rbcs
COPY --from=base-native /var/tmp/rbcs /var/tmp/rbcs
ADD rbcs-cli.upx /usr/bin/rbcs-cli
ADD logback.xml /etc/rbcs/logback.xml
USER rbcs
WORKDIR /var/lib/rbcs
ENV RBCS_CONFIGURATION_DIR="/etc/rbcs"
+2 -2
View File
@@ -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
+5 -5
View File
@@ -90,7 +90,7 @@ Provider<EnvelopeJarTask> 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
@@ -119,6 +119,7 @@ nativeImage {
compressExecutable = true
compressionLevel = 6
useLZMA = false
//verbose = true
}
Provider<UpxTask> upxTaskProvider = tasks.named(NativeImagePlugin.UPX_TASK_NAME, UpxTask) {
@@ -127,7 +128,7 @@ Provider<UpxTask> upxTaskProvider = tasks.named(NativeImagePlugin.UPX_TASK_NAME,
Provider<JlinkTask> jlinkTaskProvider = tasks.named(JlinkPlugin.JLINK_TASK_NAME, JlinkTask) {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
vendor = JvmVendorSpec.GRAAL_VM
vendor = JvmVendorSpec.ORACLE
}
mainClass = mainClassName
@@ -152,7 +153,6 @@ Provider<JlinkTask> jlinkTaskProvider = tasks.named(JlinkPlugin.JLINK_TASK_NAME,
}
Provider<Tar> jlinkDistTarTaskProvider = tasks.named(JlinkPlugin.JLINK_DIST_TAR_TASK_NAME, Tar) {
exclude 'lib/libjvmcicompiler.so'
}
tasks.named(JavaPlugin.PROCESS_RESOURCES_TASK_NAME, ProcessResources) {
+1
View File
@@ -0,0 +1 @@
{"version":"1.0.0","types":[{"id":0,"name":"boolean"},{"id":1,"name":"byte"},{"id":2,"name":"short"},{"id":3,"name":"char"},{"id":4,"name":"int"},{"id":5,"name":"float"},{"id":6,"name":"long"},{"id":7,"name":"double"},{"id":8,"name":"void"},{"id":9,"name":"java.lang.Object"},{"id":10,"name":"ch.qos.logback.classic.ClassicConstants"},{"id":11,"name":"ch.qos.logback.classic.model.processor.LogbackClassicDefaultNestedComponentRules"},{"id":12,"name":"ch.qos.logback.classic.pattern.NamedConverter$CacheMissCalculator"},{"id":13,"name":"ch.qos.logback.classic.spi.CallerData"},{"id":14,"name":"ch.qos.logback.classic.spi.EventArgUtil"},{"id":15,"name":"ch.qos.logback.classic.spi.PackagingDataCalculator"},{"id":16,"name":"ch.qos.logback.classic.spi.STEUtil"},{"id":17,"name":"ch.qos.logback.classic.spi.ThrowableProxyUtil"},{"id":18,"name":"ch.qos.logback.classic.util.ClassicEnvUtil"},{"id":19,"name":"ch.qos.logback.classic.util.ClassicVersionUtil"},{"id":20,"name":"ch.qos.logback.classic.util.ContextInitializer"},{"id":21,"name":"ch.qos.logback.classic.util.LoggerNameUtil"},{"id":22,"name":"ch.qos.logback.core.CoreConstants"},{"id":23,"name":"ch.qos.logback.core.LifeCycleManager"},{"id":24,"name":"ch.qos.logback.core.helpers.CyclicBuffer"},{"id":25,"name":"ch.qos.logback.core.helpers.ThrowableToStringArray"},{"id":26,"name":"ch.qos.logback.core.joran.JoranConstants"},{"id":27,"name":"ch.qos.logback.core.joran.ModelClassToModelHandlerLinkerBase"},{"id":28,"name":"ch.qos.logback.core.joran.action.ActionUtil"},{"id":29,"name":"ch.qos.logback.core.joran.action.ImplicitModelData"},{"id":30,"name":"ch.qos.logback.core.joran.event.SaxEvent"},{"id":31,"name":"ch.qos.logback.core.joran.sanity.Pair"},{"id":32,"name":"ch.qos.logback.core.joran.spi.DefaultNestedComponentRegistry"},{"id":33,"name":"ch.qos.logback.core.joran.spi.ElementPath"},{"id":34,"name":"ch.qos.logback.core.joran.spi.EventPlayer"},{"id":35,"name":"ch.qos.logback.core.joran.spi.HostClassAndPropertyDouble"},{"id":36,"name":"ch.qos.logback.core.joran.spi.HttpUtil"},{"id":37,"name":"ch.qos.logback.core.joran.spi.NoAutoStartUtil"},{"id":38,"name":"ch.qos.logback.core.joran.spi.SaxEventInterpreter"},{"id":39,"name":"ch.qos.logback.core.joran.util.AggregationAssessor$1"},{"id":40,"name":"ch.qos.logback.core.joran.util.ConfigurationWatchListUtil"},{"id":41,"name":"ch.qos.logback.core.joran.util.ParentTag_Tag_Class_Tuple"},{"id":42,"name":"ch.qos.logback.core.joran.util.PropertySetter$1"},{"id":43,"name":"ch.qos.logback.core.joran.util.StringToObjectConverter"},{"id":44,"name":"ch.qos.logback.core.joran.util.beans.BeanDescription"},{"id":45,"name":"ch.qos.logback.core.joran.util.beans.BeanUtil"},{"id":46,"name":"ch.qos.logback.core.model.ModelUtil"},{"id":47,"name":"ch.qos.logback.core.model.processor.ChainedModelFilter$1"},{"id":48,"name":"ch.qos.logback.core.model.processor.DefaultProcessor$1"},{"id":49,"name":"ch.qos.logback.core.model.processor.DependencyDefinition"},{"id":50,"name":"ch.qos.logback.core.model.processor.ImplicitModelHandler$1"},{"id":51,"name":"ch.qos.logback.core.model.util.PropertyModelHandlerHelper$1"},{"id":52,"name":"ch.qos.logback.core.net.ObjectWriterFactory"},{"id":53,"name":"ch.qos.logback.core.net.QueueFactory"},{"id":54,"name":"ch.qos.logback.core.net.ssl.KeyManagerFactoryFactoryBean"},{"id":55,"name":"ch.qos.logback.core.net.ssl.KeyStoreFactoryBean"},{"id":56,"name":"ch.qos.logback.core.net.ssl.SSLContextFactoryBean"},{"id":57,"name":"ch.qos.logback.core.net.ssl.SSLNestedComponentRegistryRules"},{"id":58,"name":"ch.qos.logback.core.net.ssl.SecureRandomFactoryBean"},{"id":59,"name":"ch.qos.logback.core.net.ssl.TrustManagerFactoryFactoryBean"},{"id":60,"name":"ch.qos.logback.core.pattern.Converter"},{"id":61,"name":"ch.qos.logback.core.pattern.ConverterUtil"},{"id":62,"name":"ch.qos.logback.core.pattern.FormatInfo"},{"id":63,"name":"ch.qos.logback.core.pattern.SpacePadder"},{"id":64,"name":"ch.qos.logback.core.pattern.parser.Node"},{"id":65,"name":"ch.qos.logback.core.pattern.parser.OptionTokenizer"},{"id":66,"name":"ch.qos.logback.core.pattern.parser.Token"},{"id":67,"name":"ch.qos.logback.core.pattern.parser.TokenStream"},{"id":68,"name":"ch.qos.logback.core.spi.ConfigurationEvent"},{"id":69,"name":"ch.qos.logback.core.spi.LogbackLock"},{"id":70,"name":"ch.qos.logback.core.status.StatusUtil"},{"id":71,"name":"ch.qos.logback.core.subst.Node"},{"id":72,"name":"ch.qos.logback.core.subst.NodeToStringTransformer$1"},{"id":73,"name":"ch.qos.logback.core.subst.NodeToStringTransformer"},{"id":74,"name":"ch.qos.logback.core.subst.Parser$1"},{"id":75,"name":"ch.qos.logback.core.subst.Parser"},{"id":76,"name":"ch.qos.logback.core.subst.Token"},{"id":77,"name":"ch.qos.logback.core.subst.Tokenizer"},{"id":78,"name":"ch.qos.logback.core.util.CachingDateFormatter$CacheTuple"},{"id":79,"name":"ch.qos.logback.core.util.CachingDateFormatter"},{"id":80,"name":"ch.qos.logback.core.util.CloseUtil"},{"id":81,"name":"ch.qos.logback.core.util.CoreVersionUtil"Line truncated
+10 -1
View File
@@ -1,2 +1,11 @@
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-v3 \
--gc=serial \
--enable-url-protocols=jpms \
--pgo=conf/default.iprof \
--initialize-at-run-time=io.netty \
--initialize-at-build-time=net.woggioni.rbcs.common.RbcsUrlStreamHandlerFactory,net.woggioni.rbcs.common.RbcsUrlStreamHandlerFactory$JpmsHandler \
--trace-object-instantiation=ch.qos.logback.classic.Logger \
-H:+UnlockExperimentalVMOptions \
-H:+SharedArenaSupport
#-H:TraceClassInitialization=io.netty.handler.ssl.BouncyCastleAlpnSslUtils
File diff suppressed because it is too large. Load diff
@@ -10,6 +10,7 @@ import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
import java.util.concurrent.atomic.AtomicInteger
import javax.net.ssl.TrustManagerFactory
import javax.net.ssl.X509ExtendedTrustManager
import javax.net.ssl.X509TrustManager
import kotlin.random.Random
import io.netty.util.concurrent.Future as NettyFuture
@@ -74,13 +75,25 @@ class RemoteBuildCacheClient(private val profile: Configuration.Profile) : AutoC
)
profile.tlsTruststore?.let { trustStore ->
if (!trustStore.verifyServerCertificate) {
trustManager(object : X509TrustManager {
trustManager(object : X509ExtendedTrustManager() {
override fun checkClientTrusted(certChain: Array<out X509Certificate>, p1: String?) {
}
override fun checkClientTrusted(certChain: Array<out X509Certificate>, p1: String?, socket: java.net.Socket) {
}
override fun checkClientTrusted(certChain: Array<out X509Certificate>, p1: String?, engine: javax.net.ssl.SSLEngine) {
}
override fun checkServerTrusted(certChain: Array<out X509Certificate>, p1: String?) {
}
override fun checkServerTrusted(certChain: Array<out X509Certificate>, p1: String?, socket: java.net.Socket) {
}
override fun checkServerTrusted(certChain: Array<out X509Certificate>, p1: String?, engine: javax.net.ssl.SSLEngine) {
}
override fun getAcceptedIssuers() = null
})
} else {
@@ -19,6 +19,7 @@ import java.security.cert.X509Certificate
import java.util.EnumSet
import java.util.ServiceLoader
import javax.net.ssl.TrustManagerFactory
import javax.net.ssl.X509ExtendedTrustManager
import javax.net.ssl.X509TrustManager
import net.woggioni.jwo.JWO
import net.woggioni.jwo.Tuple2
@@ -124,7 +125,7 @@ object RBCS {
return keystore
}
fun getTrustManager(trustStore: KeyStore?, certificateRevocationEnabled: Boolean): X509TrustManager {
fun getTrustManager(trustStore: KeyStore?, certificateRevocationEnabled: Boolean): X509ExtendedTrustManager {
return if (trustStore != null) {
val certificateFactory = CertificateFactory.getInstance("X.509")
val validator = CertPathValidator.getInstance("PKIX").apply {
@@ -136,7 +137,7 @@ object RBCS {
val params = PKIXParameters(trustStore).apply {
isRevocationEnabled = certificateRevocationEnabled
}
object : X509TrustManager {
object : X509ExtendedTrustManager() {
override fun checkClientTrusted(chain: Array<out X509Certificate>, authType: String) {
val clientCertificateChain = certificateFactory.generateCertPath(chain.toList())
try {
@@ -146,10 +147,26 @@ object RBCS {
}
}
override fun checkClientTrusted(chain: Array<out X509Certificate>, authType: String, socket: java.net.Socket) {
checkClientTrusted(chain, authType)
}
override fun checkClientTrusted(chain: Array<out X509Certificate>, authType: String, engine: javax.net.ssl.SSLEngine) {
checkClientTrusted(chain, authType)
}
override fun checkServerTrusted(chain: Array<out X509Certificate>, authType: String) {
throw NotImplementedError()
}
override fun checkServerTrusted(chain: Array<out X509Certificate>, authType: String, socket: java.net.Socket) {
checkServerTrusted(chain, authType)
}
override fun checkServerTrusted(chain: Array<out X509Certificate>, authType: String, engine: javax.net.ssl.SSLEngine) {
checkServerTrusted(chain, authType)
}
private val acceptedIssuers = trustStore.aliases().asSequence()
.filter(trustStore::isCertificateEntry)
.map(trustStore::getCertificate)
@@ -161,8 +178,8 @@ object RBCS {
}
} else {
val trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm())
trustManagerFactory.trustManagers.asSequence().filter { it is X509TrustManager }
.single() as X509TrustManager
trustManagerFactory.trustManagers.asSequence().filter { it is X509ExtendedTrustManager }
.single() as X509ExtendedTrustManager
}
}
@@ -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")
}
}
@@ -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)
@@ -23,23 +23,21 @@ class ProxyProtocolHandler(private val trustedProxyIPs : List<Cidr>) : 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)
}
@@ -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) {