Removed Mongodb, so we do not have issues with downloading the embedded Mongodb. Moved back to JPA and use HSQLDB for storing user information.
This commit is contained in:
@ -10,7 +10,5 @@ COPY start.sh /home/webgoat/start.sh
|
||||
RUN chmod +x /home/webgoat/start.sh
|
||||
|
||||
USER webgoat
|
||||
RUN mkdir -p /home/webgoat/.embedmongo/linux
|
||||
RUN curl -o /home/webgoat/.embedmongo/linux/mongodb-linux-x86_64-3.2.2.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.2.tgz
|
||||
RUN cd /home/webgoat/; mkdir -p .webgoat
|
||||
COPY target/webgoat-server-${webgoat_version}.jar /home/webgoat/webgoat.jar
|
||||
|
@ -90,11 +90,6 @@
|
||||
<scope>test</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.flapdoodle.embed</groupId>
|
||||
<artifactId>de.flapdoodle.embed.mongo</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.owasp.webgoat</groupId>
|
||||
<artifactId>webgoat-container</artifactId>
|
||||
|
@ -1,40 +0,0 @@
|
||||
package org.owasp.webgoat;
|
||||
|
||||
import com.mongodb.MongoClient;
|
||||
import com.mongodb.MongoClientOptions;
|
||||
import de.flapdoodle.embed.mongo.MongodExecutable;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.mongo.MongoProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.data.mongodb.MongoDbFactory;
|
||||
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* If we run
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "webgoat.embedded.mongo", havingValue = "false")
|
||||
public class ExternalMongoConfiguration {
|
||||
|
||||
@Autowired
|
||||
private MongoProperties properties;
|
||||
|
||||
@Autowired(required = false)
|
||||
private MongoClientOptions options;
|
||||
|
||||
@Bean
|
||||
public MongodExecutable mongodExecutable() throws IOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MongoDbFactory mongoDbFactory(Environment env) throws Exception {
|
||||
MongoClient client = properties.createMongoClient(this.options, env);
|
||||
return new SimpleMongoDbFactory(client, properties.getDatabase());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user