-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use exec so kill signals are working, use dedicated validate
- Loading branch information
1 parent
aa0b4ef
commit 97e417b
Showing
4 changed files
with
21 additions
and
21 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 |
---|---|---|
|
@@ -7,7 +7,7 @@ ARG http_proxy | |
ARG https_proxy | ||
ARG no_proxy | ||
|
||
LABEL authors="derhecht,stevespringett,jeremylong" | ||
LABEL authors="derhecht,stevespringett,jeremylong,eugenmayer" | ||
LABEL maintainer="[email protected]" | ||
LABEL name="jeremylong/vulnz" | ||
LABEL version=$BUILD_VERSION | ||
|
@@ -37,13 +37,15 @@ RUN apk update && \ | |
|
||
COPY ["/src/docker/supervisor/supervisord.conf", "/etc/supervisord.conf"] | ||
COPY ["/src/docker/scripts/mirror.sh", "/mirror.sh"] | ||
COPY ["/src/docker/scripts/validate.sh", "/validate.sh"] | ||
COPY ["/src/docker/crontab/mirror", "/etc/crontabs/mirror"] | ||
COPY ["/src/docker/crontab/validate", "/etc/crontabs/validate"] | ||
COPY ["/src/docker/apache/mirror.conf", "/usr/local/apache2/conf"] | ||
COPY ["/build/libs/vulnz-$BUILD_VERSION.jar", "/usr/local/bin/vulnz"] | ||
|
||
RUN chmod +x /mirror.sh && \ | ||
chown root:root /etc/crontabs/mirror && \ | ||
chown mirror:mirror /mirror.sh && \ | ||
RUN chmod +x /mirror.sh /validate.sh && \ | ||
chown root:root /etc/crontabs/mirror /etc/crontabs/validate && \ | ||
chown mirror:mirror /mirror.sh /validate.sh && \ | ||
chown mirror:mirror /usr/local/bin/vulnz | ||
|
||
# ensures we can log cron task is into stdout of docker | ||
|
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 @@ | ||
0 4 * * * /validate.sh 2>&1 | tee -a /var/log/docker_out.log | tee -a /var/log/cron_validate.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
echo "Validating the cache..." | ||
for file in /usr/local/apache2/htdocs/*.gz; do | ||
if ! gzip -t "$file"; then | ||
echo "Corrupt gz file detected: $file, clearing cache and re-running mirror" | ||
rm -rf /usr/local/apache2/htdocs/* | ||
supervisorctl start init_nvd_cache | ||
break | ||
fi | ||
done | ||
|