Skip to content

Commit fdab820

Browse files
committed
Merge branch 'release/3.0.1'
2 parents 7d86138 + b837074 commit fdab820

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+110
-87
lines changed

Jenkinsfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pipeline {
33
agent {
44
kubernetes {
55
yamlFile 'kubernetesPod.yaml'
6+
workspaceVolume dynamicPVC(accessModes: 'ReadWriteOnce', requestsSize: '40Gi')
67
}
78
}
89

@@ -20,7 +21,7 @@ pipeline {
2021

2122
configFileProvider([configFile(fileId: 'maven-settings-rsb', variable: 'MAVEN_SETTINGS_RSB')]) {
2223

23-
sh 'mvn -B -s $MAVEN_SETTINGS_RSB -U clean deploy'
24+
sh 'mvn -B -s $MAVEN_SETTINGS_RSB -Dmaven.repo.local=/home/jenkins/agent/m2 -U clean deploy'
2425

2526
}
2627
}

kubernetesPod.yaml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
apiVersion: v1
22
kind: Pod
33
metadata:
4+
name: shinyproxy
45
labels:
56
ci: shinyproxy-build
67
spec:
8+
securityContext:
9+
fsGroup: 65534
710
containers:
8-
- name: containerproxy-build
9-
image: 196229073436.dkr.ecr.eu-west-1.amazonaws.com/openanalytics/containerproxy-build
10-
command:
11-
- cat
12-
tty: true
13-
resources:
14-
requests:
15-
memory: "2Gi"
16-
cpu: "1.0"
17-
limits:
18-
memory: "4Gi"
19-
cpu: "1.5"
20-
11+
- name: containerproxy-build
12+
image: 196229073436.dkr.ecr.eu-west-1.amazonaws.com/openanalytics/containerproxy-build
13+
securityContext:
14+
privileged: true
15+
command: [ "sh" ]
16+
args: [ "/usr/src/app/docker-entrypoint.sh" ]
17+
tty: true
18+
volumeMounts:
19+
- name: workspace-volume
20+
subPath: docker
21+
mountPath: /var/lib/docker
22+
resources:
23+
requests:
24+
ephemeral-storage: "20Gi"
25+
memory: "2Gi"
26+
cpu: "1.0"
27+
limits:
28+
memory: "4Gi"
29+
cpu: "1.5"
30+
ephemeral-storage: "20Gi"

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>eu.openanalytics</groupId>
77
<artifactId>shinyproxy</artifactId>
8-
<version>3.0.0</version>
8+
<version>3.0.1</version>
99
<packaging>jar</packaging>
1010

1111
<name>ShinyProxy</name>
@@ -28,7 +28,7 @@
2828
<java.version>1.8</java.version>
2929
<maven.compiler.source>8</maven.compiler.source>
3030
<maven.compiler.target>8</maven.compiler.target>
31-
<containerproxy.version>1.0.0</containerproxy.version>
31+
<containerproxy.version>1.0.1</containerproxy.version>
3232
<resource.delimiter>&amp;</resource.delimiter>
3333
</properties>
3434

src/main/java/eu/openanalytics/shinyproxy/AppRequestInfo.java

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2021 Open Analytics
4+
* Copyright (C) 2016-2023 Open Analytics
55
*
66
* ===========================================================================
77
*
@@ -20,9 +20,6 @@
2020
*/
2121
package eu.openanalytics.shinyproxy;
2222

23-
import eu.openanalytics.containerproxy.model.runtime.ParameterValues;
24-
import eu.openanalytics.containerproxy.util.BadRequestException;
25-
2623
import javax.servlet.http.HttpServletRequest;
2724
import java.util.regex.Matcher;
2825
import java.util.regex.Pattern;
@@ -37,7 +34,6 @@ public class AppRequestInfo {
3734
private final String appInstance;
3835
private final String subPath;
3936
private final String appPath;
40-
private ParameterValues providedParameters = null;
4137

4238
public AppRequestInfo(String appName, String appInstance, String appPath, String subPath) {
4339
this.appName = appName;
@@ -46,37 +42,26 @@ public AppRequestInfo(String appName, String appInstance, String appPath, String
4642
this.subPath = subPath;
4743
}
4844

49-
public static AppRequestInfo fromRequestOrException(HttpServletRequest request) {
50-
AppRequestInfo result = fromURI(request.getRequestURI());
51-
if (result == null) {
52-
throw new BadRequestException("Error parsing URL.");
53-
}
54-
return result;
45+
public static AppRequestInfo fromRequestOrNull(HttpServletRequest request) {
46+
return fromURI(request.getRequestURI());
5547
}
5648

57-
public static AppRequestInfo fromRequestOrException(HttpServletRequest request, ParameterValues providedParameters) {
58-
AppRequestInfo result = fromRequestOrException(request);
59-
result.setProvidedParameters(providedParameters);
60-
return result;
61-
}
62-
63-
6449
public static AppRequestInfo fromURI(String uri) {
6550
Matcher appMatcher = APP_PATTERN.matcher(uri);
6651
Matcher appInstanceMatcher = APP_INSTANCE_PATTERN.matcher(uri);
6752
if (appInstanceMatcher.matches()) {
6853
String appName = appInstanceMatcher.group(2);
6954
if (appName == null || appName.trim().equals("")) {
70-
throw new BadRequestException("Error parsing URL: name of app not found in URL.");
55+
return null;
7156
}
7257

7358
String appInstance = appInstanceMatcher.group(3);
7459
if (appInstance == null || appInstance.trim().equals("")) {
75-
throw new BadRequestException("Error parsing URL: name of instance not found in URL.");
60+
return null;
7661
}
7762

7863
if (appInstance.length() > 64 || !INSTANCE_NAME_PATTERN.matcher(appInstance).matches()) {
79-
throw new BadRequestException("Error parsing URL: name of instance contains invalid characters or is too long.");
64+
return null;
8065
}
8166

8267
String subPath = appInstanceMatcher.group(4);
@@ -93,7 +78,7 @@ public static AppRequestInfo fromURI(String uri) {
9378
} else if (appMatcher.matches()) {
9479
String appName = appMatcher.group(2);
9580
if (appName == null || appName.trim().equals("")) {
96-
throw new BadRequestException("Error parsing URL: name of app not found in URL.");
81+
return null;
9782
}
9883

9984
String appInstance = "_";
@@ -138,12 +123,4 @@ public String getAppPath() {
138123
return appPath;
139124
}
140125

141-
public ParameterValues getProvidedParameters() {
142-
return providedParameters;
143-
}
144-
145-
private void setProvidedParameters(ParameterValues providedParameters) {
146-
this.providedParameters = providedParameters;
147-
}
148-
149126
}

src/main/java/eu/openanalytics/shinyproxy/AuthenticationRequiredFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2021 Open Analytics
4+
* Copyright (C) 2016-2023 Open Analytics
55
*
66
* ===========================================================================
77
*

src/main/java/eu/openanalytics/shinyproxy/ShinyProxyConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2021 Open Analytics
4+
* Copyright (C) 2016-2023 Open Analytics
55
*
66
* ===========================================================================
77
*

src/main/java/eu/openanalytics/shinyproxy/ShinyProxyIframeScriptInjector.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2021 Open Analytics
4+
* Copyright (C) 2016-2023 Open Analytics
55
*
66
* ===========================================================================
77
*
@@ -137,7 +137,10 @@ public void terminateWrites() throws IOException {
137137
private void updateContentLength(HttpServerExchange exchange, ByteBuffer output) {
138138
long length = output.limit();
139139

140-
exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, length);
140+
// check works case-insensitive
141+
if (!exchange.getResponseHeaders().contains("Transfer-Encoding")) {
142+
exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, length);
143+
}
141144

142145
// also update length of ServerFixedLengthStreamSinkConduit
143146
if (next instanceof ServerFixedLengthStreamSinkConduit) {

src/main/java/eu/openanalytics/shinyproxy/ShinyProxySpecExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2021 Open Analytics
4+
* Copyright (C) 2016-2023 Open Analytics
55
*
66
* ===========================================================================
77
*

src/main/java/eu/openanalytics/shinyproxy/ShinyProxySpecExtensionProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2021 Open Analytics
4+
* Copyright (C) 2016-2023 Open Analytics
55
*
66
* ===========================================================================
77
*

src/main/java/eu/openanalytics/shinyproxy/ShinyProxySpecProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2021 Open Analytics
4+
* Copyright (C) 2016-2023 Open Analytics
55
*
66
* ===========================================================================
77
*

0 commit comments

Comments
 (0)