Skip to content

Commit

Permalink
Merge pull request #36 from FritzHeiden/feature-eula-agreement
Browse files Browse the repository at this point in the history
Add EULA agreement to start of container
  • Loading branch information
FritzHeiden committed May 31, 2023
2 parents a603406 + fa562b9 commit 2e69289
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ ARG testsbranch

RUN ./import-tests.sh "$testsbranch"

COPY check-eula.sh .

EXPOSE 8000

ENV TEST_RUNNER_IP 127.0.0.1

CMD ln -s ../tests/* . ;\
./check-eula.sh &&\
./check-permissions.sh /home/ubuntu/DPCTF/results &&\
./check-host.sh /home/ubuntu/DPCTF/config.json &&\
dnsmasq \
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ container. In this example, we use the version string of the example from the
section "Create Image". The file contains further configurations, but for now
this should suffice.

### Agree to EULA

In order to run the container you need to agree to the [EULA](https://github.com/cta-wave/dpctf-deploy/blob/master/End-User-License-Agreement.md). To do so, set the environment variable `AGREE_EULA` to `true`.

`docker-compose.yml`

```yaml
services:
dpctf:
environment:
AGREE_EULA: true
```

### Import content

Next, import the content:
Expand Down
12 changes: 12 additions & 0 deletions check-eula.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

if [[ ${AGREE_EULA} = true ]]; then
exit 0;
fi;

echo ""
echo "Please agree to the EULA to continue:"
echo "https://github.com/cta-wave/dpctf-deploy/blob/master/End-User-License-Agreement.md"
echo ""

exit 1;
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ services:
- ./tests:/home/ubuntu/tests
- ./content:/home/ubuntu/DPCTF/content
#- ./test-config.json:/home/ubuntu/DPCTF/test-config.json
environment:
AGREE_EULA: false
extra_hosts:
- "www1.xn--n8j6ds53lwwkrqhv28a.web-platform.test:0.0.0.0"
- "op88.web-platform.test:0.0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion import.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

echo "Downloading content ..."
python3 ./download-content.py https://raw.githubusercontent.com/cta-wave/Test-Content/587cef1f7d531bb9326c21ca11cad95454d62621/database.json content
python3 ./download-content.py https://raw.githubusercontent.com/cta-wave/Test-Content/6a363ca9225f41cc3f03d0bb286f99647f89d04b/database.json content

#echo ""
#echo "Importing DPCTF tests ..."
Expand Down

0 comments on commit 2e69289

Please sign in to comment.