forked from WebGoat/WebGoat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Some initial refactoring * Make it one application * Got it working * Fix problem on Windows * Move WebWolf * Move first lesson * Moved all lessons * Fix pom.xml * Fix tests * Add option to initialize a lesson This way we can create content for each user inside a lesson. The initialize method will be called when a new user is created or when a lesson reset happens * Clean up pom.xml files * Remove fetching labels based on language. We only support English at the moment, all the lesson explanations are written in English which makes it very difficult to translate. If we only had labels it would make sense to support multiple languages * Fix SonarLint issues * And move it all to the main project * Fix for documentation paths * Fix pom warnings * Remove PMD as it does not work * Update release notes about refactoring Update release notes about refactoring Update release notes about refactoring * Fix lesson template * Update release notes * Keep it in the same repo in Dockerhub * Update documentation to show how the connection is obtained. Resolves: WebGoat#1180 * Rename all integration tests * Remove command from Dockerfile * Simplify GitHub actions Currently, we use a separate actions for pull-requests and branch build. This is now consolidated in one action. The PR action triggers always, it now only trigger when the PR is opened and not in draft. Running all platforms on a branch build is a bit too much, it is better to only run all platforms when someone opens a PR. * Remove duplicate entry from release notes * Add explicit registry for base image * Lesson scanner not working when fat jar When running the fat jar we have to take into account we are reading from the jar file and not the filesystem. In this case you cannot use `getFile` for example. * added info in README and fixed release docker * changed base image and added ignore file Co-authored-by: Zubcevic.com <[email protected]>
- Loading branch information
Showing
1,130 changed files
with
3,491 additions
and
7,594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
** | ||
|
||
!/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: "Build" | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '.txt' | ||
- '*.MD' | ||
- '*.md' | ||
- 'LICENSE' | ||
- 'docs/**' | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- release/* | ||
tags-ignore: | ||
- '*' | ||
paths-ignore: | ||
- '.txt' | ||
- '*.MD' | ||
- '*.md' | ||
- 'LICENSE' | ||
- 'docs/**' | ||
|
||
jobs: | ||
pr-build: | ||
if: > | ||
github.event_name == 'pull_request' && !github.event.pull_request.draft && ( | ||
github.event.action == 'opened' || | ||
github.event.action == 'reopened' || | ||
github.event.action == 'synchronize' | ||
) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
architecture: x64 | ||
- name: Cache Maven packages | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2- | ||
- name: Build with Maven | ||
run: mvn --no-transfer-progress package | ||
|
||
build: | ||
if: github.repository == 'WebGoat/WebGoat' && github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
name: "Branch build" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
architecture: x64 | ||
- name: Cache Maven packages | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.m2 | ||
key: ubuntu-latest-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ubuntu-latest-m2- | ||
- name: Test with Maven | ||
run: mvn --no-transfer-progress verify |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,7 @@ jobs: | |
with: | ||
draft: false | ||
files: | | ||
webgoat-server/target/webgoat-server-${{ env.WEBGOAT_MAVEN_VERSION }}.jar | ||
webwolf/target/webwolf-${{ env.WEBGOAT_MAVEN_VERSION }}.jar | ||
webgoat/target/webgoat-${{ env.WEBGOAT_MAVEN_VERSION }}.jar | ||
body: | | ||
## Version ${{ steps.tag.outputs.tag }} | ||
|
@@ -91,13 +90,13 @@ jobs: | |
- name: "Build and push" | ||
uses: docker/[email protected] | ||
with: | ||
context: ./docker | ||
file: docker/Dockerfile | ||
context: ./ | ||
file: ./Dockerfile | ||
push: true | ||
platforms: linux/amd64, linux/arm64, linux/arm/v7 | ||
tags: | | ||
webgoat/goatandwolf:${{ env.WEBGOAT_TAG_VERSION }} | ||
webgoat/goatandwolf:latest | ||
webgoat/webgoat:${{ env.WEBGOAT_TAG_VERSION }} | ||
webgoat/webgoat:latest | ||
build-args: | | ||
webgoat_version=${{ env.WEBGOAT_MAVEN_VERSION }} | ||
|
@@ -118,10 +117,10 @@ jobs: | |
ref: develop | ||
token: ${{ secrets.WEBGOAT_DEPLOYER_TOKEN }} | ||
|
||
- name: Set up JDK 15 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 15 | ||
java-version: 17 | ||
architecture: x64 | ||
|
||
- name: Set version to next snapshot | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM docker.io/eclipse-temurin:17-jdk-focal | ||
|
||
RUN useradd -ms /bin/bash webgoat | ||
RUN chgrp -R 0 /home/webgoat | ||
RUN chmod -R g=u /home/webgoat | ||
|
||
USER webgoat | ||
|
||
COPY --chown=webgoat target/webgoat-*.jar /home/webgoat/webgoat.jar | ||
|
||
EXPOSE 8080 | ||
EXPOSE 9090 | ||
|
||
WORKDIR /home/webgoat | ||
ENTRYPOINT [ "java", \ | ||
"-Duser.home=/home/webgoat", \ | ||
"-Dfile.encoding=UTF-8", \ | ||
"--add-opens", "java.base/java.lang=ALL-UNNAMED", \ | ||
"--add-opens", "java.base/java.util=ALL-UNNAMED", \ | ||
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", \ | ||
"--add-opens", "java.base/java.text=ALL-UNNAMED", \ | ||
"--add-opens", "java.desktop/java.beans=ALL-UNNAMED", \ | ||
"--add-opens", "java.desktop/java.awt.font=ALL-UNNAMED", \ | ||
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", \ | ||
"--add-opens", "java.base/java.io=ALL-UNNAMED", \ | ||
"--add-opens", "java.base/java.util=ALL-UNNAMED", \ | ||
"-Drunning.in.docker=true", \ | ||
"-Dwebgoat.host=0.0.0.0", \ | ||
"-Dwebwolf.host=0.0.0.0", \ | ||
"-Dwebgoat.port=8080", \ | ||
"-Dwebwolf.port=9090", \ | ||
"-jar", "webgoat.jar" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.