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
0d48a80f
Commit
0d48a80f
authored
Dec 25, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Docker] Update docker
parent
53a1a5e1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
36 deletions
+116
-36
Dockerfile
Dockerfile
+17
-0
conf_docker.py
conf_docker.py
+58
-0
conf_example.py
conf_example.py
+38
-33
manage.py
manage.py
+2
-2
requirements.txt
requirements/requirements.txt
+1
-1
No files found.
Dockerfile
0 → 100644
View file @
0d48a80f
FROM
jumpserver/python:v3
MAINTAINER
Jumpserver Team <ibuler@qq.com>
COPY
. /opt/coco
WORKDIR
/opt/coco
RUN
cd
requirements
&&
yum
-y
install
$(
cat
rpm_requirements.txt
)
&&
\
pip
install
-r
requirements.txt
-i
https://pypi.tuna.tsinghua.edu.cn/simple
VOLUME
/opt/coco/logs
VOLUME
/opt/coco/keys
RUN
cp
config_docker.py config.py
EXPOSE
2222
CMD
python run_server.py
\ No newline at end of file
conf_docker.py
0 → 100644
View file @
0d48a80f
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import
os
BASE_DIR
=
os
.
path
.
dirname
(
__file__
)
class
Config
:
# 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复
APP_NAME
=
"coco"
# Jumpserver项目的url, api请求注册会使用
CORE_HOST
=
os
.
environ
.
get
(
"CORE_HOST"
)
or
'http://127.0.0.1:8080'
# 启动时绑定的ip, 默认 0.0.0.0
# BIND_HOST = '0.0.0.0'
# 监听的SSH端口号, 默认2222
# SSHD_PORT = 2222
# 监听的HTTP/WS端口号,默认5000
# HTTPD_PORT = 5000
# 项目使用的ACCESS KEY, 默认会注册,并保存到 ACCESS_KEY_STORE中,
# 如果有需求, 可以写到配置文件中, 格式 access_key_id:access_key_secret
# ACCESS_KEY = None
# ACCESS KEY 保存的地址, 默认注册后会保存到该文件中
# ACCESS_KEY_STORE = os.path.join(BASE_DIR, 'keys', '.access_key')
# 加密密钥
# SECRET_KEY = None
# 设置日志级别 ['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL', 'CRITICAL']
# LOG_LEVEL = 'INFO'
# 日志存放的目录
# LOG_DIR = os.path.join(BASE_DIR, 'logs')
# Session录像存放目录
# SESSION_DIR = os.path.join(BASE_DIR, 'sessions')
# 资产显示排序方式, ['ip', 'hostname']
# ASSET_LIST_SORT_BY = 'ip'
# 登录是否支持密码认证
# SSH_PASSWORD_AUTH = True
# 登录是否支持秘钥认证
# SSH_PUBLIC_KEY_AUTH = True
# 和Jumpserver 保持心跳时间间隔
# HEARTBEAT_INTERVAL = 5
# Admin的名字,出问题会提示给用户
# ADMINS = ''
conf_example.py
View file @
0d48a80f
...
...
@@ -6,51 +6,56 @@ import os
BASE_DIR
=
os
.
path
.
dirname
(
__file__
)
# 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复
# APP_NAME = "localhost"
# Jumpserver项目的url, api请求注册会使用
# CORE_HOST = 'http://127.0.0.1:8080'
class
Config
:
# 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复
APP_NAME
=
"coco"
# 启动时绑定的ip, 默认 0.0.0.0
# BIND_HOST = '0.0.0.
0'
# Jumpserver项目的url, api请求注册会使用
# CORE_HOST = os.environ.get("CORE_HOST") or 'http://127.0.0.1:808
0'
# 监听的SSH端口号, 默认2222
# SSHD_PORT = 2222
# 启动时绑定的ip, 默认 0.0.0.0
# BIND_HOST = '0.0.0.0'
# 监听的HTTP/WS端口号,默认5000
# HTTPD_PORT = 5000
# 监听的SSH端口号, 默认2222
# SSHD_PORT = 2222
# 项目使用的ACCESS KEY, 默认会注册,并保存到 ACCESS_KEY_STORE中,
# 如果有需求, 可以写到配置文件中, 格式 access_key_id:access_key_secret
# ACCESS_KEY = None
# 监听的HTTP/WS端口号,默认5000
# HTTPD_PORT = 5000
# ACCESS KEY 保存的地址, 默认注册后会保存到该文件中
# ACCESS_KEY_STORE = os.path.join(BASE_DIR, 'keys', '.access_key')
# 项目使用的ACCESS KEY, 默认会注册,并保存到 ACCESS_KEY_STORE中,
# 如果有需求, 可以写到配置文件中, 格式 access_key_id:access_key_secret
# ACCESS_KEY = None
# 加密密钥
# SECRET_KEY = None
# ACCESS KEY 保存的地址, 默认注册后会保存到该文件中
# ACCESS_KEY_STORE = os.path.join(BASE_DIR, 'keys', '.access_key')
# 设置日志级别 ['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL', 'CRITICAL']
# LOG_LEVEL = 'INFO'
# 加密密钥
# SECRET_KEY = None
# 日志存放的目录
# LOG_DIR = os.path.join(BASE_DIR, 'logs')
# 设置日志级别 ['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL', 'CRITICAL']
# LOG_LEVEL = 'INFO'
# Session录像存放
目录
# SESSION_DIR = os.path.join(BASE_DIR, 'session
s')
# 日志存放的
目录
# LOG_DIR = os.path.join(BASE_DIR, 'log
s')
# 资产显示排序方式, ['ip', 'hostname']
# ASSET_LIST_SORT_BY = 'ip'
# Session录像存放目录
# SESSION_DIR = os.path.join(BASE_DIR, 'sessions')
# 登录是否支持密码认证
# SSH_PASSWORD_AUTH = True
# 资产显示排序方式, ['ip', 'hostname']
# ASSET_LIST_SORT_BY = 'ip'
# 登录是否支持秘钥
认证
# SSH_PUBLIC_KEY
_AUTH = True
# 登录是否支持密码
认证
# SSH_PASSWORD
_AUTH = True
# 和Jumpserver 保持心跳时间间隔
# HEARTBEAT_INTERVAL = 5
# 登录是否支持秘钥认证
# SSH_PUBLIC_KEY_AUTH = True
# Admin的名字,出问题会提示给用户
# ADMINS = ''
# 和Jumpserver 保持心跳时间间隔
# HEARTBEAT_INTERVAL = 5
# Admin的名字,出问题会提示给用户
# ADMINS = ''
config
=
Config
()
manage.py
View file @
0d48a80f
...
...
@@ -8,7 +8,7 @@ import sys
from
coco
import
Coco
try
:
import
conf
from
conf
import
config
except
ImportError
:
print
(
"Please prepare config file `cp conf_example.py conf.py`"
)
sys
.
exit
(
1
)
...
...
@@ -22,7 +22,7 @@ except:
coco
=
Coco
()
coco
.
config
.
from_object
(
conf
)
coco
.
config
.
from_object
(
conf
ig
)
# Todo:
# 0. argparser
...
...
requirements/requirements.txt
View file @
0d48a80f
...
...
@@ -28,4 +28,4 @@ tornado==4.5.2
urllib3==1.22
wcwidth==0.1.7
werkzeug==0.12.2
jumpserver-python-sdk==0.0.1
7
jumpserver-python-sdk==0.0.1
8
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