-
-
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.
Reimplement caching to use a per-year scope
- Add forgiveness if a year fails, continue to the next one - add continue feature - Let the continue process run every 2 hourse, not every 30 min - Add continue support to docker image mirror.sh - off by default - Add lockfile
- Loading branch information
1 parent
7d4264d
commit 7a42496
Showing
10 changed files
with
298 additions
and
139 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 |
---|---|---|
|
@@ -32,3 +32,6 @@ nb-configuration.xml | |
**/nbproject/ | ||
local.properties | ||
data-source/data/ | ||
|
||
# IntellIJ run configs | ||
.run |
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
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 @@ | ||
0 */2 * * * /continue.sh 2>&1 | tee -a /var/log/docker_out.log | tee -a /var/log/cron_continue.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
LOCKFILE=/tmp/vulzn.lock | ||
if [ -f $LOCKFILE ]; then | ||
echo "Lockfile found - another mirror-sync process already running" | ||
else | ||
touch $LOCKFILE | ||
fi | ||
|
||
if [ -z "${CONTINUE}" ]; then | ||
# continue disabled, do not retry failed years | ||
exit 0 | ||
fi | ||
|
||
echo "Continuing feature detected - ensuring all years mirrored..." | ||
|
||
DELAY_ARG="" | ||
if [ -z $NVD_API_KEY ]; then | ||
DELAY_ARG="--delay=10000" | ||
else | ||
echo "Using NVD API KEY: ${NVD_API_KEY:0:5}****" | ||
fi | ||
|
||
if [ -n "${DELAY}" ]; then | ||
echo "Overriding delay with ${DELAY}ms" | ||
DELAY_ARG="--delay=$DELAY" | ||
fi | ||
|
||
MAX_RETRY_ARG="" | ||
if [ -n "${MAX_RETRY}" ]; then | ||
echo "Using max retry attempts: $MAX_RETRY" | ||
MAX_RETRY_ARG="--maxRetry=$MAX_RETRY" | ||
fi | ||
|
||
MAX_RECORDS_PER_PAGE_ARG="" | ||
if [ -n "${MAX_RECORDS_PER_PAGE}" ]; then | ||
echo "Using max records per page: $MAX_RECORDS_PER_PAGE" | ||
MAX_RECORDS_PER_PAGE_ARG="--recordsPerPage=$MAX_RECORDS_PER_PAGE" | ||
fi | ||
|
||
function remove_lockfile() { | ||
rm -f $LOCKFILE | ||
exit 0 | ||
} | ||
trap remove_lockfile SIGHUP SIGINT SIGQUIT SIGABRT SIGALRM SIGTERM SIGTSTP | ||
|
||
java $JAVA_OPT -jar /usr/local/bin/vulnz cve $DELAY_ARG $DEBUG_ARG $MAX_RETRY_ARG $MAX_RECORDS_PER_PAGE_ARG --continue --cache --directory /usr/local/apache2/htdocs | ||
|
||
rm -f $LOCKFILE |
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 |
---|---|---|
|
@@ -59,3 +59,4 @@ stdout_logfile=/dev/fd/1 | |
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
user=mirror | ||
stopsecs=29 |
Oops, something went wrong.