Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
Details
Activity
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
ops
coco
Commits
5ceacd47
Commit
5ceacd47
authored
Sep 03, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改key获取
parent
4c48e7a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
config.py
coco/config.py
+12
-13
No files found.
coco/config.py
View file @
5ceacd47
...
...
@@ -270,29 +270,33 @@ class Config(dict):
return
'<
%
s
%
s>'
%
(
self
.
__class__
.
__name__
,
dict
.
__repr__
(
self
))
root_path
=
os
.
environ
.
get
(
"COCO_PATH"
)
if
not
root_path
:
root_path
=
BASE_DIR
access_key_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
root_path
,
'keys'
,
'.access_key'
))
default_config
=
{
'NAME'
:
socket
.
gethostname
(),
'CORE_HOST'
:
'http://127.0.0.1:8080'
,
'ROOT_PATH'
:
root_path
,
'DEBUG'
:
True
,
'BIND_HOST'
:
'0.0.0.0'
,
'SSHD_PORT'
:
2222
,
'HTTPD_PORT'
:
5000
,
'ACCESS_KEY'
:
''
,
'DB_FILE'
:
os
.
path
.
join
(
BASE_DIR
,
'sqlite3.db'
),
'ACCESS_KEY_ENV'
:
'COCO_ACCESS_KEY'
,
'ACCESS_KEY_FILE'
:
os
.
path
.
join
(
BASE_DIR
,
'keys'
,
'.access_key'
),
'COCO_ACCESS_KEY'
:
''
,
'ACCESS_KEY_FILE'
:
access_key_path
,
'SECRET_KEY'
:
'SDK29K03
%
MM0ksf'
,
'LOG_LEVEL'
:
'DEBUG'
,
'LOG_DIR'
:
os
.
path
.
join
(
BASE_DIR
,
'logs'
),
'SESSION_DIR'
:
os
.
path
.
join
(
BASE_DIR
,
'sessions'
),
'LOG_DIR'
:
os
.
path
.
join
(
root_path
,
'logs'
),
'SESSION_DIR'
:
os
.
path
.
join
(
root_path
,
'sessions'
),
'ASSET_LIST_SORT_BY'
:
'hostname'
,
# hostname, ip
'PASSWORD_AUTH'
:
True
,
'PUBLIC_KEY_AUTH'
:
True
,
'SSH_TIMEOUT'
:
10
,
'ALLOW_SSH_USER'
:
[
'admin'
],
'ALLOW_SSH_USER'
:
[],
'BLOCK_SSH_USER'
:
[],
'HEARTBEAT_INTERVAL'
:
5
,
'MAX_CONNECTIONS'
:
500
,
'MAX_CONNECTIONS'
:
500
,
# Not use now
'ADMINS'
:
''
,
'COMMAND_STORAGE'
:
{
'TYPE'
:
'server'
},
# server
'REPLAY_STORAGE'
:
{
'TYPE'
:
'server'
},
...
...
@@ -300,10 +304,5 @@ default_config = {
'SECURITY_MAX_IDLE_TIME'
:
60
,
}
root_path
=
os
.
environ
.
get
(
"COCO_PATH"
)
if
not
root_path
:
root_path
=
BASE_DIR
config
=
Config
(
root_path
,
default_config
)
config
[
'ROOT_PATH'
]
=
root_path
config
.
from_pyfile
(
'conf.py'
)
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