link to remote host hsqldb
This commit is contained in:
parent
f1f5c352df
commit
833e09fced
@ -65,13 +65,24 @@ public class DataSourceResolver {
|
|||||||
@Value("${webgoat.actuator.configprops.path:/configprops}")
|
@Value("${webgoat.actuator.configprops.path:/configprops}")
|
||||||
private String configPropsPath;
|
private String configPropsPath;
|
||||||
|
|
||||||
|
@Value("${hsqldb.address}")
|
||||||
|
private String hsqlHost;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ApplicationContext ctx;
|
ApplicationContext ctx;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@DependsOn("dsConfigDiscovery")
|
@DependsOn("dsConfigDiscovery")
|
||||||
public DataSource dataSource(DataSourceProperties dataSourceProperties) {
|
public DataSource dataSource(DataSourceProperties dataSourceProperties) {
|
||||||
DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource(dataSourceProperties.getUrl());
|
String connectString = dataSourceProperties.getUrl();
|
||||||
|
/**
|
||||||
|
* Replace the server address as reported by webgoat by the one that is given
|
||||||
|
* to WebWolf as the address of WebGoat. In case it doesn't run locally.
|
||||||
|
*/
|
||||||
|
if (connectString!=null) {
|
||||||
|
connectString = connectString.replace("0.0.0.0", hsqlHost);
|
||||||
|
}
|
||||||
|
DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource(connectString);
|
||||||
driverManagerDataSource.setDriverClassName(dataSourceProperties.getDriverClassName());
|
driverManagerDataSource.setDriverClassName(dataSourceProperties.getDriverClassName());
|
||||||
return driverManagerDataSource;
|
return driverManagerDataSource;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ server.port=${WEBWOLF_PORT:9090}
|
|||||||
server.address=${WEBWOLF_HOST:127.0.0.1}
|
server.address=${WEBWOLF_HOST:127.0.0.1}
|
||||||
server.servlet.session.cookie.name=WEBWOLFSESSION
|
server.servlet.session.cookie.name=WEBWOLFSESSION
|
||||||
server.servlet.session.timeout=6000
|
server.servlet.session.timeout=6000
|
||||||
|
hsqldb.address=${WEBGOAT_HOST:127.0.0.1}
|
||||||
|
|
||||||
spring.jpa.properties.hibernate.default_schema=CONTAINER
|
spring.jpa.properties.hibernate.default_schema=CONTAINER
|
||||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.HSQLDialect
|
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.HSQLDialect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user