Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 10ad4b2

Browse files
author
yufeizhao
committed
init
1 parent 97fbaa6 commit 10ad4b2

29 files changed

+14825
-159
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ __pycache__
55
node_modules
66
dist
77
app/config/config.local.yaml
8+
*.sqlite

Pipfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ orjson = "*"
2424
aiohttp = "*"
2525
# aioredis = "*"
2626
# asyncpg = "*"
27+
sslyze = "*"
28+
dnspython = "*"
29+
tldextract = "*"
30+
wafw00f = "*"
31+
requests-cache = "*"
32+
requests = "*"
33+
lxml = "*"
34+
beautifulsoup4 = "*"
35+
ipwhois = "*"
36+
python-whois = "*"
2737

2838
[requires]
2939
python_version = "3.7"

Pipfile.lock

Lines changed: 251 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
PROJECT_NAME="template-tornado"
2+
PROJECT_NAME="website-scanner"
33
LOG_DIR=/app/log/${PROJECT_NAME}
44

55
NOTICE_ENV="Can not load ${ENV} from system, only (dev, test, pre, prod) is available"

app/config/config.dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ server:
55
port: 8000
66
allow_origin: "*"
77
thread_worker: 60
8+
requests_cache: 60
89

910
http:
1011
timeout: 3

app/config/config.pre.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ server:
55
port: 8000
66
allow_origin: "*"
77
thread_worker: 60
8+
requests_cache: 60
89

910
http:
1011
timeout: 3

app/config/config.prod.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ server:
55
port: 8000
66
allow_origin: "*"
77
thread_worker: 60
8+
requests_cache: 60
89

910
http:
1011
timeout: 3

app/config/config.test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ server:
55
port: 8000
66
allow_origin: "*"
77
thread_worker: 60
8+
requests_cache: 60
89

910
http:
1011
timeout: 3

app/config/const_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class HTTPCode(IntEnum):
1818

1919

2020
class PluginType(StrEnum):
21-
SCANNER = "scanner_plugin"
22-
WAF = "waf_plugin"
21+
ASYNC_SCANNER = "async_scanner"
22+
SYNC_SCANNER = "sync_scanner"

app/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from tornado.platform.asyncio import AsyncIOMainLoop
88
from tornado.process import fork_processes
99
from tornado.netutil import bind_sockets
10+
import requests_cache
1011

1112
from app import application, router
1213
from app.hook import before_hook, after_hook
@@ -41,6 +42,7 @@
4142

4243

4344
def main():
45+
requests_cache.install_cache("requests_cache", expire_after=config.server["requests_cache"])
4446
settings = config.server
4547
settings["static_path"] = config.static_path
4648
settings["template_path"] = config.template_path

0 commit comments

Comments
 (0)