more docker work
This commit is contained in:
@@ -17,3 +17,5 @@ data.zip
|
|||||||
DISCLAIMER.txt
|
DISCLAIMER.txt
|
||||||
example.conf.json
|
example.conf.json
|
||||||
bin/
|
bin/
|
||||||
|
Gemfile.lock
|
||||||
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,7 +6,6 @@ coverage
|
|||||||
*.sublime-*
|
*.sublime-*
|
||||||
.idea
|
.idea
|
||||||
.*.swp
|
.*.swp
|
||||||
Gemfile.lock
|
|
||||||
log.txt
|
log.txt
|
||||||
.yardoc
|
.yardoc
|
||||||
debug.log
|
debug.log
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
FROM ruby:2.4-slim
|
FROM ruby:2.4-slim
|
||||||
MAINTAINER WPScan Team <team@wpscan.org>
|
MAINTAINER WPScan Team <team@wpscan.org>
|
||||||
|
|
||||||
|
ARG BUNDLER_ARGS="--system --jobs=8 --without test"
|
||||||
|
|
||||||
RUN DEBIAN_FRONTEND=noninteractive && \
|
RUN DEBIAN_FRONTEND=noninteractive && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
@@ -12,7 +14,7 @@ RUN mkdir /wpscan
|
|||||||
|
|
||||||
COPY Gemfile /wpscan
|
COPY Gemfile /wpscan
|
||||||
WORKDIR /wpscan
|
WORKDIR /wpscan
|
||||||
RUN bundle install --system --without test
|
RUN bundle install $BUNDLER_ARGS
|
||||||
|
|
||||||
COPY . /wpscan
|
COPY . /wpscan
|
||||||
RUN chown -R wpscan:wpscan /wpscan
|
RUN chown -R wpscan:wpscan /wpscan
|
||||||
|
|||||||
20
bin/rspec
Executable file
20
bin/rspec
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
|
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
SOURCE="$(readlink "$SOURCE")"
|
||||||
|
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||||
|
done
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
|
||||||
|
cd $DIR/../
|
||||||
|
# always rebuild and include all GEMs
|
||||||
|
docker build --build-arg "BUNDLER_ARGS=--system --jobs=8" -t wpscan:rspec .
|
||||||
|
# update all gems (this updates Gemfile.lock on the host)
|
||||||
|
docker run --rm -u root -v $DIR/../Gemfile.lock:/wpscan/Gemfile.lock --entrypoint "" wpscan:rspec bundle update
|
||||||
|
# rebuild image with latest GEMs
|
||||||
|
docker build --build-arg "BUNDLER_ARGS=--system --jobs=8" -t wpscan:rspec .
|
||||||
|
# run spec
|
||||||
|
docker run --rm -v $DIR/../:/wpscan --entrypoint "" wpscan:rspec rspec
|
||||||
|
|
||||||
@@ -9,6 +9,6 @@ done
|
|||||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
|
||||||
cd $DIR/../
|
cd $DIR/../
|
||||||
docker build -q -t wpscan:dev .
|
docker build -q -t wpscan:git .
|
||||||
docker run --rm wpscan:dev "$@"
|
docker run --rm wpscan:git "$@"
|
||||||
|
|
||||||
|
|||||||
16
bin/wpscan-dev
Executable file
16
bin/wpscan-dev
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
|
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
SOURCE="$(readlink "$SOURCE")"
|
||||||
|
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||||
|
done
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
|
||||||
|
cd $DIR/../
|
||||||
|
if [[ -n "$WPSCAN_BUILD" ]]; then
|
||||||
|
docker build -q -t wpscan:git .
|
||||||
|
fi
|
||||||
|
docker run --rm -v $DIR/../:/wpscan wpscan:git "$@"
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ class Browser
|
|||||||
elsif auth =~ /\ABasic [a-zA-Z0-9=]+\z/
|
elsif auth =~ /\ABasic [a-zA-Z0-9=]+\z/
|
||||||
@basic_auth = auth
|
@basic_auth = auth
|
||||||
else
|
else
|
||||||
raise 'Invalid basic authentication format, "login:password" or "Basic base_64_encoded" expected'
|
raise "Invalid basic authentication format, \"login:password\" or \"Basic base_64_encoded\" expected. Your input: #{auth}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -152,11 +152,6 @@ class WpscanOptions
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def basic_auth=(basic_auth)
|
|
||||||
raise 'Invalid basic authentication format, login:password expected' if basic_auth.index(':').nil?
|
|
||||||
@basic_auth = "Basic #{Base64.encode64(basic_auth).chomp}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def debug_output=(debug_output)
|
def debug_output=(debug_output)
|
||||||
Typhoeus::Config.verbose = debug_output
|
Typhoeus::Config.verbose = debug_output
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user