Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
e4292421
Commit
e4292421
authored
Oct 11, 2018
by
Medicean
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into v2.0.x
parents
17f54383
dec5f0ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
4 deletions
+24
-4
config.js
modules/config.js
+4
-0
database.js
modules/database.js
+8
-2
request.js
modules/request.js
+10
-2
dhtmlx.css
static/libs/dhtmlx/skins/mytheme/dhtmlx.css
+2
-0
No files found.
modules/config.js
View file @
e4292421
...
...
@@ -89,6 +89,10 @@ class Conf {
return
require
(
'../package.json'
);
}
get
urlblacklist
()
{
return
/
(
gov.cn|edu.cn
)
/
}
}
module
.
exports
=
new
Conf
();
modules/database.js
View file @
e4292421
...
...
@@ -114,7 +114,10 @@ class Database {
*/
addShell
(
event
,
opts
)
{
logger
.
info
(
'addShell'
,
opts
);
if
(
opts
.
base
[
'url'
].
match
(
CONF
.
urlblacklist
)){
event
.
returnValue
=
"Blacklist URL"
return
}
this
.
_url2ip
(
opts
.
base
[
'url'
])
.
then
((
ret
)
=>
{
this
.
cursor
.
insert
({
...
...
@@ -151,7 +154,10 @@ class Database {
const
_new
=
opts
.
new
;
const
_old
=
opts
.
old
;
if
(
_new
.
base
[
'url'
].
match
(
CONF
.
urlblacklist
)){
event
.
returnValue
=
"Blacklist URL"
return
}
this
.
_url2ip
(
_new
.
base
[
'url'
])
.
then
((
ret
)
=>
{
this
.
cursor
.
update
({
...
...
modules/request.js
View file @
e4292421
...
...
@@ -8,6 +8,7 @@
const
fs
=
require
(
'fs'
),
iconv
=
require
(
'iconv-lite'
),
through
=
require
(
'through'
),
CONF
=
require
(
'./config'
),
superagent
=
require
(
'superagent'
),
superagentProxy
=
require
(
'superagent-proxy'
);
...
...
@@ -66,6 +67,9 @@ class Request {
*/
onAproxyTest
(
event
,
opts
)
{
logger
.
debug
(
'aProxy::Test Proxy -'
,
opts
[
'aproxyuri'
],
'- Connect to '
,
opts
[
'url'
]);
if
(
opts
[
'url'
].
match
(
CONF
.
urlblacklist
))
{
return
event
.
sender
.
send
(
'request-error-'
+
opts
[
'hash'
],
"Blacklist URL"
);
}
superagentProxy
(
superagent
);
superagent
.
get
(
opts
[
'url'
])
...
...
@@ -92,7 +96,9 @@ class Request {
*/
onRequest
(
event
,
opts
)
{
logger
.
debug
(
'onRequest::opts'
,
opts
);
if
(
opts
[
'url'
].
match
(
CONF
.
urlblacklist
))
{
return
event
.
sender
.
send
(
'request-error-'
+
opts
[
'hash'
],
"Blacklist URL"
);
}
const
_request
=
superagent
.
post
(
opts
[
'url'
]);
// 设置headers
_request
.
set
(
'User-Agent'
,
USER_AGENT
);
...
...
@@ -138,7 +144,9 @@ class Request {
*/
onDownlaod
(
event
,
opts
)
{
logger
.
debug
(
'onDownlaod'
,
opts
);
if
(
opts
[
'url'
].
match
(
CONF
.
urlblacklist
))
{
return
event
.
sender
.
send
(
'request-error-'
+
opts
[
'hash'
],
"Blacklist URL"
);
}
// 创建文件流
const
rs
=
fs
.
createWriteStream
(
opts
[
'path'
]);
...
...
static/libs/dhtmlx/skins/mytheme/dhtmlx.css
View file @
e4292421
...
...
@@ -3430,6 +3430,8 @@ div.gridbox_dhx_skyblue.gridbox table.obj tr td {
div
.gridbox_dhx_skyblue.gridbox
table
.hdr
td
div
.hdrcell
{
padding-left
:
10px
;
width
:
auto
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
div
.gridbox_dhx_skyblue.gridbox
table
.hdr
td
{
border-width
:
1px
1px
1px
1px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment