Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM amazoncorretto:25-al2023
RUN yum install -y procps-ng shadow-utils which
RUN yum install -y procps-ng shadow-utils which util-linux

ENV NXF_HOME=/.nextflow
ARG TARGETPLATFORM=linux/amd64
Expand Down
16 changes: 5 additions & 11 deletions docker/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
# with such ID and adds it to the `docker` group, then assigns the docker
# socket file ownership to that user.
#
# Finally it switches the `nextflow` user using the `su` command and
# executes the original target command line.
# Finally it switches to the `nextflow` user and executes the original
# target command line.
#
# authors:
# Paolo Di Tommaso
Expand All @@ -36,9 +36,6 @@
# enable debugging
[[ "$NXF_DEBUG_ENTRY" ]] && set -x

# wrap cli args with single quote to avoid wildcard expansion
cli=''; for x in "$@"; do cli+="'$x' "; done

# the NXF_USRMAP hold the user ID in the host environment
if [[ "$NXF_USRMAP" ]]; then
# create a `nextflow` user with the provided ID
Expand All @@ -50,13 +47,10 @@ useradd -u "$NXF_USRMAP" -G docker -s /bin/bash nextflow
chown nextflow /var/run/docker.sock
chown -R nextflow /.nextflow

# finally run the target command with `nextflow` user
su nextflow << EOF
[[ "$NXF_DEBUG_ENTRY" ]] && set -x
exec bash -c "$cli"
EOF
# run the target command as `nextflow`, passing argv through (no shell)
exec runuser -u nextflow -- "$@"

# otherwise just execute the command
else
exec bash -c "$cli"
exec "$@"
fi
1 change: 1 addition & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=9c0f7faeeb306cb14e4279a3e084ca6b596894089a0638e68a07c945a32c9e14
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
retries=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ class RemoteSession implements Serializable, Closeable {
while( (entry=zip.getNextEntry()) != null ) {

def file = target.resolve(entry.getName());
if( !file.normalize().startsWith(target.normalize()) )
throw new IllegalArgumentException("Unsafe zip entry path: ${entry.getName()}")
if(entry.isDirectory()) {
continue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import groovy.util.logging.Slf4j
import io.seqera.http.HxProxyConfig
import nextflow.file.http.XAuthProvider
import nextflow.util.ProxyConfig
import nextflow.util.StringUtils

/**
* Implements Tower authentication strategy for resources accessed
Expand Down Expand Up @@ -96,16 +97,18 @@ class TowerXAuth implements XAuthProvider {
.build()

final resp = httpClient.send(req, HttpResponse.BodyHandlers.ofString())
log.debug "Refresh cookie response: [${resp.statusCode()}] ${resp.body()}"
if( resp.statusCode() != 200 )
if( resp.statusCode() != 200 ) {
log.debug "Refresh cookie response: [${resp.statusCode()}] ${resp.body()}"
return false
}
log.debug "Refresh cookie response: [${resp.statusCode()}]"

final authCookie = getCookie('JWT')
final refreshCookie = getCookie('JWT_REFRESH_TOKEN')

// set the new bearer token in the current client session
if( authCookie?.value ) {
log.trace "Updating http client bearer token=$authCookie.value"
log.trace "Updating http client bearer token=${StringUtils.redact(authCookie.value)}"
accessToken = authCookie.value
}
else {
Expand All @@ -114,7 +117,7 @@ class TowerXAuth implements XAuthProvider {

// set the new refresh token
if( refreshCookie?.value ) {
log.trace "Updating http client refresh token=$refreshCookie.value"
log.trace "Updating http client refresh token=${StringUtils.redact(refreshCookie.value)}"
refreshToken = refreshCookie.value
}
else {
Expand Down
Loading