Skip to content

Commit e212a46

Browse files
committed
Added DVJA code base with Docker build
1 parent 2bb5236 commit e212a46

File tree

173 files changed

+12975
-0
lines changed

Some content is hidden

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

173 files changed

+12975
-0
lines changed

.dockerignore

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
2+
# Created by https://www.gitignore.io/api/intellij+iml
3+
4+
target/
5+
6+
### Intellij+iml ###
7+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
8+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
9+
10+
# User-specific stuff:
11+
.idea/**/workspace.xml
12+
.idea/**/tasks.xml
13+
.idea/dictionaries
14+
15+
# Sensitive or high-churn files:
16+
.idea/**/dataSources/
17+
.idea/**/dataSources.ids
18+
.idea/**/dataSources.xml
19+
.idea/**/dataSources.local.xml
20+
.idea/**/sqlDataSources.xml
21+
.idea/**/dynamic.xml
22+
.idea/**/uiDesigner.xml
23+
24+
# Gradle:
25+
.idea/**/gradle.xml
26+
.idea/**/libraries
27+
28+
# CMake
29+
cmake-build-debug/
30+
31+
# Mongo Explorer plugin:
32+
.idea/**/mongoSettings.xml
33+
34+
## File-based project format:
35+
*.iws
36+
37+
## Plugin-specific files:
38+
39+
# IntelliJ
40+
/out/
41+
42+
# mpeltonen/sbt-idea plugin
43+
.idea_modules/
44+
45+
# JIRA plugin
46+
atlassian-ide-plugin.xml
47+
48+
# Cursive Clojure plugin
49+
.idea/replstate.xml
50+
51+
# Crashlytics plugin (for Android Studio and IntelliJ)
52+
com_crashlytics_export_strings.xml
53+
crashlytics.properties
54+
crashlytics-build.properties
55+
fabric.properties
56+
57+
### Intellij+iml Patch ###
58+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
59+
60+
*.iml
61+
modules.xml
62+
.idea/misc.xml
63+
*.ipr
64+
65+
# End of https://www.gitignore.io/api/intellij+iml
66+

.gitignore

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
2+
# Created by https://www.gitignore.io/api/intellij+iml
3+
4+
target/
5+
6+
### Intellij+iml ###
7+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
8+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
9+
10+
# User-specific stuff:
11+
.idea/**/workspace.xml
12+
.idea/**/tasks.xml
13+
.idea/dictionaries
14+
15+
# Sensitive or high-churn files:
16+
.idea/**/dataSources/
17+
.idea/**/dataSources.ids
18+
.idea/**/dataSources.xml
19+
.idea/**/dataSources.local.xml
20+
.idea/**/sqlDataSources.xml
21+
.idea/**/dynamic.xml
22+
.idea/**/uiDesigner.xml
23+
24+
# Gradle:
25+
.idea/**/gradle.xml
26+
.idea/**/libraries
27+
28+
# CMake
29+
cmake-build-debug/
30+
31+
# Mongo Explorer plugin:
32+
.idea/**/mongoSettings.xml
33+
34+
## File-based project format:
35+
*.iws
36+
37+
## Plugin-specific files:
38+
39+
# IntelliJ
40+
/out/
41+
42+
# mpeltonen/sbt-idea plugin
43+
.idea_modules/
44+
45+
# JIRA plugin
46+
atlassian-ide-plugin.xml
47+
48+
# Cursive Clojure plugin
49+
.idea/replstate.xml
50+
51+
# Crashlytics plugin (for Android Studio and IntelliJ)
52+
com_crashlytics_export_strings.xml
53+
crashlytics.properties
54+
crashlytics-build.properties
55+
fabric.properties
56+
57+
### Intellij+iml Patch ###
58+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
59+
60+
*.iml
61+
modules.xml
62+
.idea/misc.xml
63+
*.ipr
64+
65+
# End of https://www.gitignore.io/api/intellij+iml
66+

.idea/artifacts/dvja_war.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/dvja_war_exploded.xml

+75
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sqldialects.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM java:openjdk-8
2+
MAINTAINER Abhisek Datta <[email protected]>
3+
4+
RUN apt-get update
5+
RUN apt-get install -y mysql-client
6+
RUN apt-get install -y maven
7+
8+
WORKDIR /app
9+
COPY pom.xml pom.xml
10+
RUN mvn dependency:resolve
11+
12+
COPY . .
13+
RUN mvn clean package
14+
RUN chmod 755 /app/scripts/start.sh
15+
16+
EXPOSE 8080
17+
CMD ["sh", "-c", "/app/scripts/start.sh"]

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Damn Vulnerable Java Application
2+
3+
## Quick Start
4+
5+
Install Docker and Docker Compose.
6+
7+
```
8+
docker-compose up
9+
```
10+
11+
Navigate to `http://localhost:8080`
12+
13+
## Requirements
14+
15+
* Java 1.7+
16+
* Maven 3.x
17+
* MySQL Server
18+
19+
## Configuration
20+
21+
### Database
22+
23+
Create MySQL database and credentials and configure the same in:
24+
25+
```
26+
./src/main/webapp/WEB-INF/config.properties
27+
```
28+
29+
### Schema Import
30+
31+
Import the schema into MySQL database:
32+
33+
```
34+
$ mysql -u USER -pPASSWORD dvja < ./db/schema.sql
35+
```
36+
37+
## Build
38+
39+
```
40+
$ mvn clean package
41+
```
42+
43+
The deployable `war` file is generated in targets directory.
44+
45+
## Run with Jetty
46+
47+
```
48+
$ mvn jetty:run
49+
```
50+
51+
This will start the `Jetty` server on port 8080.
52+
53+
## Deploy in Tomcat Server
54+
55+
* Build app
56+
* Copy targets/dvja.war to Tomcat webapps directory
57+
* To serve as root application, copy as `ROOT.war` to Tomcat webapps directory.
58+

0 commit comments

Comments
 (0)