Skip to content

Commit 30675f0

Browse files
committed
Merge branch 'release/2.5.0'
2 parents 18041ed + 4512946 commit 30675f0

21 files changed

+128
-54
lines changed

.github/workflows/workflows.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
java: [ 8, 11 ]
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up JDK
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: ${{ matrix.java }}
18+
- name: Cache Maven packages
19+
uses: actions/cache@v2
20+
with:
21+
path: ~/.m2
22+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
23+
restore-keys: ${{ runner.os }}-m2
24+
- name: Build with Maven
25+
run: mvn -U clean install -DskipTests
26+
- name: Run Tests
27+
run: mvn test
28+
29+
dependency:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
- name: Run Dependency Check
35+
run: mvn -Powasp-dependency-check verify -DskipTests
36+
- name: Archive code coverage results
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: dependency-check-report
40+
path: target/dependency-check-report.html
41+

.travis.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

LICENSE_HEADER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ShinyProxy
22

3-
Copyright (C) 2016-2020 Open Analytics
3+
Copyright (C) 2016-2021 Open Analytics
44

55
===========================================================================
66

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<pre>
2-
_____ _ _ _____
3-
/ ____| | (_) | __ \
4-
| (___ | |__ _ _ __ _ _| |__) | __ _____ ___ _
2+
_____ _ _ _____
3+
/ ____| | (_) | __ \
4+
| (___ | |__ _ _ __ _ _| |__) | __ _____ ___ _
55
\___ \| '_ \| | '_ \| | | | ___/ '__/ _ \ \/ / | | |
66
____) | | | | | | | | |_| | | | | | (_) > <| |_| |
77
|_____/|_| |_|_|_| |_|\__, |_| |_| \___/_/\_\\__, |
88
__/ | __/ |
9-
|___/ |___/
9+
|___/ |___/
1010

1111
</pre>
1212

@@ -18,7 +18,7 @@ Open Source Enterprise Deployment for Shiny Apps
1818

1919
Learn more at https://shinyproxy.io
2020

21-
#### (c) Copyright Open Analytics NV, 2016-2020 - Apache License 2.0
21+
#### (c) Copyright Open Analytics NV, 2016-2021 - Apache License 2.0
2222

2323
## Building from source
2424

@@ -33,7 +33,7 @@ The build will result in a single `.jar` file that is made available in the `tar
3333
## Running the application
3434

3535
```
36-
java -jar shinyproxy-2.3.0.jar
36+
java -jar shinyproxy-2.3.0.jar
3737
```
3838

3939
Navigate to http://localhost:8080 to access the application. If the default configuration is used, authentication will be done against the LDAP server at *ldap.forumsys.com*; to log in one can use the user name "tesla" and password "password".

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>2.4.3</version>
8+
<version>2.5.0</version>
99
<packaging>jar</packaging>
1010

1111
<name>ShinyProxy</name>
@@ -26,7 +26,7 @@
2626
<properties>
2727
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2828
<java.version>1.8</java.version>
29-
<containerproxy.version>0.8.7</containerproxy.version>
29+
<containerproxy.version>0.8.8</containerproxy.version>
3030
<resource.delimiter>&amp;</resource.delimiter>
3131
</properties>
3232

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-2020 Open Analytics
4+
* Copyright (C) 2016-2021 Open Analytics
55
*
66
* ===========================================================================
77
*

src/main/java/eu/openanalytics/shinyproxy/ShinyProxySpecMergeStrategy.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-2020 Open Analytics
4+
* Copyright (C) 2016-2021 Open Analytics
55
*
66
* ===========================================================================
77
*

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2020 Open Analytics
4+
* Copyright (C) 2016-2021 Open Analytics
55
*
66
* ===========================================================================
77
*
@@ -29,9 +29,13 @@
2929
import java.util.stream.Collectors;
3030

3131
import javax.annotation.PostConstruct;
32+
import javax.inject.Inject;
3233

34+
import eu.openanalytics.containerproxy.util.SessionHelper;
35+
import org.springframework.beans.factory.annotation.Autowired;
3336
import org.springframework.boot.context.properties.ConfigurationProperties;
3437
import org.springframework.context.annotation.Primary;
38+
import org.springframework.core.env.Environment;
3539
import org.springframework.stereotype.Component;
3640

3741
import com.fasterxml.jackson.core.JsonParseException;
@@ -56,6 +60,13 @@ public class ShinyProxySpecProvider implements IProxySpecProvider {
5660

5761
private List<ProxySpec> specs = new ArrayList<>();
5862

63+
private static Environment environment;
64+
65+
@Autowired
66+
public void setEnvironment(Environment env){
67+
ShinyProxySpecProvider.environment = env;
68+
}
69+
5970
@PostConstruct
6071
public void afterPropertiesSet() {
6172
this.specs.stream().collect(Collectors.groupingBy(ProxySpec::getId)).forEach((id, duplicateSpecs) -> {
@@ -75,6 +86,11 @@ public ProxySpec getSpec(String id) {
7586
public void setSpecs(List<ShinyProxySpec> specs) {
7687
this.specs = specs.stream().map(ShinyProxySpecProvider::convert).collect(Collectors.toList());
7788
}
89+
90+
private static String getPublicPath(String appName) {
91+
String contextPath = SessionHelper.getContextPath(environment, true);
92+
return contextPath + "app_direct/" + appName + "/";
93+
}
7894

7995
private static ProxySpec convert(ShinyProxySpec from) {
8096
ProxySpec to = new ProxySpec();
@@ -100,7 +116,15 @@ private static ProxySpec convert(ShinyProxySpec from) {
100116
ContainerSpec cSpec = new ContainerSpec();
101117
cSpec.setImage(from.getContainerImage());
102118
cSpec.setCmd(from.getContainerCmd());
103-
cSpec.setEnv(from.getContainerEnv());
119+
120+
Map<String, String> env = from.getContainerEnv();
121+
if (env == null) {
122+
env = new HashMap<>();
123+
}
124+
125+
env.put("SHINYPROXY_PUBLIC_PATH", getPublicPath(from.getId()));
126+
cSpec.setEnv(env);
127+
104128
cSpec.setEnvFile(from.getContainerEnvFile());
105129
cSpec.setNetwork(from.getContainerNetwork());
106130
cSpec.setNetworkConnections(from.getContainerNetworkConnections());

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ShinyProxy
33
*
4-
* Copyright (C) 2016-2020 Open Analytics
4+
* Copyright (C) 2016-2021 Open Analytics
55
*
66
* ===========================================================================
77
*
@@ -23,6 +23,7 @@
2323
import java.net.HttpURLConnection;
2424
import java.net.URI;
2525
import java.net.URL;
26+
import java.util.Arrays;
2627
import java.util.function.IntPredicate;
2728

2829
import javax.inject.Inject;
@@ -65,8 +66,9 @@ public boolean testProxy(Proxy proxy) {
6566
URL testURL = new URL(targetURI.toString());
6667
HttpURLConnection connection = ((HttpURLConnection) testURL.openConnection());
6768
connection.setConnectTimeout(timeoutMs);
69+
connection.setInstanceFollowRedirects(false);
6870
int responseCode = connection.getResponseCode();
69-
if (responseCode == 200) return true;
71+
if (Arrays.asList(200, 301, 302, 303, 307, 308).contains(responseCode)) return true;
7072
} catch (Exception e) {
7173
if (i > 1 && log != null) log.warn(String.format("Container unresponsive, trying again (%d/%d): %s", i, maxTries, targetURI));
7274
}

src/main/java/eu/openanalytics/shinyproxy/UISecurityConfig.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-2020 Open Analytics
4+
* Copyright (C) 2016-2021 Open Analytics
55
*
66
* ===========================================================================
77
*

0 commit comments

Comments
 (0)