From b1e0f2be3b24a0156ebeef97267d1548dc73d205 Mon Sep 17 00:00:00 2001 From: muyan Date: Sat, 22 Dec 2018 00:20:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20docker-compose=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/mongodb/init.sh | 14 ++++++++++++++ docker-compose.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 deploy/mongodb/init.sh create mode 100644 docker-compose.yml diff --git a/deploy/mongodb/init.sh b/deploy/mongodb/init.sh new file mode 100644 index 0000000..857cb92 --- /dev/null +++ b/deploy/mongodb/init.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e +echo 'Initializing a fresh instance' +mongo < Date: Sat, 22 Dec 2018 00:36:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=98=B2=E6=AD=A2MongoDB=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=20https://github.com/0xbug/Hawkeye/issues/89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/mongodb/init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/mongodb/init.sh b/deploy/mongodb/init.sh index 857cb92..740e454 100644 --- a/deploy/mongodb/init.sh +++ b/deploy/mongodb/init.sh @@ -2,6 +2,8 @@ set -e echo 'Initializing a fresh instance' mongo < Date: Sat, 22 Dec 2018 14:23:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20WEB=5FUSERNAME=20?= =?UTF-8?q?=E5=92=8C=20WEB=5FPASSWORD=20=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E5=8F=AF=E4=BB=A5=E6=94=BE=E5=BF=83=E7=9A=84?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E5=88=B0=E5=A4=96=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/nginx/Hawkeye.conf | 4 ++++ deploy/supervisor/hawkeye.conf | 3 ++- deploy/supervisor/huey.conf | 3 ++- deploy/supervisor/openresty.conf | 3 ++- deploy/supervisor/redis.conf | 3 ++- deploy/supervisor/startup.conf | 8 ++++++++ docker-compose.yml | 2 ++ 7 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 deploy/supervisor/startup.conf diff --git a/deploy/nginx/Hawkeye.conf b/deploy/nginx/Hawkeye.conf index 7dea461..be7e24b 100644 --- a/deploy/nginx/Hawkeye.conf +++ b/deploy/nginx/Hawkeye.conf @@ -2,6 +2,8 @@ server { listen 80; charset utf-8; location / { + auth_basic "Auth"; + auth_basic_user_file /Hawkeye/server/passwd ; gzip on; gzip_min_length 1k; gzip_buffers 16 64k; @@ -14,6 +16,8 @@ server { index index.html index.htm index.php; } location /api { + auth_basic "Auth"; + auth_basic_user_file /Hawkeye/server/passwd ; gzip_min_length 1k; gzip_buffers 16 64k; gzip_http_version 1.1; diff --git a/deploy/supervisor/hawkeye.conf b/deploy/supervisor/hawkeye.conf index 950d3b0..70a2b3e 100644 --- a/deploy/supervisor/hawkeye.conf +++ b/deploy/supervisor/hawkeye.conf @@ -4,4 +4,5 @@ directory=/Hawkeye/server startsecs=5 stopwaitsecs=0 autostart=true -autorestart=true \ No newline at end of file +autorestart=true +priority=800 \ No newline at end of file diff --git a/deploy/supervisor/huey.conf b/deploy/supervisor/huey.conf index e2537ff..9d60fb0 100644 --- a/deploy/supervisor/huey.conf +++ b/deploy/supervisor/huey.conf @@ -4,4 +4,5 @@ directory=/Hawkeye/server startsecs=5 stopwaitsecs=0 autostart=true -autorestart=true \ No newline at end of file +autorestart=true +priority=800 \ No newline at end of file diff --git a/deploy/supervisor/openresty.conf b/deploy/supervisor/openresty.conf index 7724517..ef7389c 100644 --- a/deploy/supervisor/openresty.conf +++ b/deploy/supervisor/openresty.conf @@ -4,4 +4,5 @@ directory=/tmp startsecs=5 stopwaitsecs=0 autostart=true -autorestart=true \ No newline at end of file +autorestart=true +priority=999 \ No newline at end of file diff --git a/deploy/supervisor/redis.conf b/deploy/supervisor/redis.conf index d3c444a..88094b3 100644 --- a/deploy/supervisor/redis.conf +++ b/deploy/supervisor/redis.conf @@ -4,4 +4,5 @@ directory=/tmp startsecs=10 stopwaitsecs=0 autostart=true -autorestart=true \ No newline at end of file +autorestart=true +priority=800 \ No newline at end of file diff --git a/deploy/supervisor/startup.conf b/deploy/supervisor/startup.conf new file mode 100644 index 0000000..0dddb1a --- /dev/null +++ b/deploy/supervisor/startup.conf @@ -0,0 +1,8 @@ +[program:startup] +command=bash -c 'echo "${WEB_USERNAME}:`openssl passwd ${WEB_PASSWORD}`" > /Hawkeye/server/passwd' +directory=/tmp +startsecs=0 +stopwaitsecs=0 +autostart=true +autorestart=false +priority=100 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4c0adaa..9ec3e15 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,8 @@ services: ports: - 8001:80 environment: + WEB_USERNAME: admin + WEB_PASSWORD: hawkeye MONGODB_URI: mongodb://hawkeye:hawkeye@mongodb:27017/hawkeye MONGODB_USER: hawkeye MONGODB_PASSWORD: hawkeye