Skip to content

Commit

Permalink
adds docker support for whatwaf
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekultek committed Dec 15, 2019
1 parent b4ddbaf commit db6882b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 80 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
@@ -0,0 +1,7 @@
FROM debian:sid
LABEL version="1.1"
LABEL description="WhatWaf Dockerized"
LABEL author="Ekultek"
COPY bootstrap.sh /tmp/bootstrap.sh
RUN chmod +x /tmp/bootstrap.sh
RUN bash -c /tmp/bootstrap.sh
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
<!--[![alt text][1.1]][1] [![alt text][6.1]][6]-->

[1]: https://twitter.com/stay__salty
[1]: https://twitter.com/unethicalsalt
[1.1]: http://i.imgur.com/tXSoThF.png

[6]: http://www.github.com/ekultek
Expand Down
16 changes: 16 additions & 0 deletions bootstrap.sh
@@ -0,0 +1,16 @@
#!/bin/bash

########
#
# script that will be ran by docker
#
########

apt-get update && apt-get install -y python python-pip git rsync
if [[ ! -d /tmp/ww ]]; then
mkdir -p /tmp/ww
fi;
cd /tmp/ww && git clone https://github.com/ekultek/whatwaf && cd whatwaf
pip install pyyaml pysocks
pip install -r requirements.txt
echo "root" | python setup.py install
2 changes: 1 addition & 1 deletion lib/settings.py
Expand Up @@ -28,7 +28,7 @@
pass

# version number <major>.<minor>.<commit>
VERSION = "1.9.3"
VERSION = "1.9.4"

# version string
VERSION_TYPE = "($dev)" if VERSION.count(".") > 1 else "($stable)"
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Expand Up @@ -35,8 +35,12 @@
install_requires=open("requirements.txt").read().split("\n")
)
if needs_username_fix:
subprocess.call(["chown", "-R", "{u}:{u}".format(u=username),
"/home/{}/.whatwaf".format(os.path.expanduser(username))])
if "root" == username:
# fixes weird docker issues
path = "/root/.whatwaf"
else:
path = "/home/{}/.whatwaf".format(os.path.expanduser(username))
subprocess.call(["chown", "-R", "{u}:{u}".format(u=username), path])
except Exception as e:
import sys, traceback

Expand Down
76 changes: 0 additions & 76 deletions setup.sh

This file was deleted.

0 comments on commit db6882b

Please sign in to comment.