Unverified Commit 427fd2c0 authored by wojiushixiaobai's avatar wojiushixiaobai Committed by GitHub

Merge pull request #1446 from wojiushixiaobai/docs

[Update]更新文档
parents 2517c85e 43247e43
This diff is collapsed.
...@@ -69,8 +69,10 @@ ...@@ -69,8 +69,10 @@
... ...
class Config: class Config:
# Use it to encrypt or decrypt data # Use it to encrypt or decrypt data
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get('SECRET_KEY') or '2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=%s_qj$1%x' # Jumpserver 使用 SECRET_KEY 进行加密
# SECRET_KEY = os.environ.get('SECRET_KEY') or '2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=%s_qj$1%x'
SECRET_KEY = os.environ.get('SECRET_KEY') or '请随意输入随机字符串(推荐字符大于等于 50位)'
# Django security setting, if your disable debug model, you should setting that # Django security setting, if your disable debug model, you should setting that
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
......
...@@ -113,8 +113,9 @@ CentOS 7 安装文档 ...@@ -113,8 +113,9 @@ CentOS 7 安装文档
... ...
class Config: class Config:
# Use it to encrypt or decrypt data # Use it to encrypt or decrypt data
# SECURITY WARNING: keep the secret key used in production secret! # Jumpserver 使用 SECRET_KEY 进行加密
SECRET_KEY = os.environ.get('SECRET_KEY') or '2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=%s_qj$1%x' # SECRET_KEY = os.environ.get('SECRET_KEY') or '2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=%s_qj$1%x'
SECRET_KEY = os.environ.get('SECRET_KEY') or '请随意输入随机字符串(推荐字符大于等于 50位)'
# Django security setting, if your disable debug model, you should setting that # Django security setting, if your disable debug model, you should setting that
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
...@@ -248,9 +249,9 @@ CentOS 7 安装文档 ...@@ -248,9 +249,9 @@ CentOS 7 安装文档
$ chown -R root:root luna $ chown -R root:root luna
# 安装 Windows 支持组件(如果不需要管理 windows 资产,可以直接跳过这一步) # 安装 Windows 支持组件(如果不需要管理 windows 资产,可以直接跳过这一步)
$ yum remove docker-latest-logrotate docker-logrotate docker-selinux dockdocker-engine $ yum remove docker-latest-logrotate docker-logrotate docker-selinux dockdocker-engine
$ yum install -y yum-utils device-mapper-persistent-data lvm2 $ yum install -y yum-utils device-mapper-persistent-data lvm2
$ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo $ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
$ yum makecache fast $ yum makecache fast
$ yum install docker-ce $ yum install docker-ce
$ systemctl start docker $ systemctl start docker
...@@ -333,7 +334,8 @@ CentOS 7 安装文档 ...@@ -333,7 +334,8 @@ CentOS 7 安装文档
$ nginx -t # 确保配置没有问题, 有问题请先解决 $ nginx -t # 确保配置没有问题, 有问题请先解决
$ systemctl start nginx $ systemctl start nginx
# 访问 http://192.168.244.144 默认账号: admin 密码: admin 到会话管理-终端管理 接受 Coco Guacamole 等应用的注册 # 访问 http://192.168.244.144 (注意,没有 :8080,通过 nginx 代理端口进行访问)
# 默认账号: admin 密码: admin 到会话管理-终端管理 接受 Coco Guacamole 等应用的注册
# 测试连接 # 测试连接
$ ssh -p2222 admin@192.168.244.144 $ ssh -p2222 admin@192.168.244.144
$ sftp -P2222 admin@192.168.244.144 $ sftp -P2222 admin@192.168.244.144
......
...@@ -124,13 +124,33 @@ ...@@ -124,13 +124,33 @@
:: ::
class Config: class Config:
# Use it to encrypt or decrypt data
# Jumpserver 使用 SECRET_KEY 进行加密
# SECRET_KEY = os.environ.get('SECRET_KEY') or '2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=%s_qj$1%x'
SECRET_KEY = os.environ.get('SECRET_KEY') or '请随意输入随机字符串(推荐字符大于等于 50位)'
... # Django security setting, if your disable debug model, you should setting that
ALLOWED_HOSTS = ['*']
# Development env open this, when error occur display the full process track, Production disable it
# DEBUG 模式 True为开启 False为关闭,默认开启,生产环境推荐关闭
DEBUG = False
# DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/
# 日志级别,默认为DEBUG,可调整为INFO, WARNING, ERROR, CRITICAL,默认INFO
LOG_LEVEL = 'WARNING'
LOG_DIR = os.path.join(BASE_DIR, 'logs')
# 找到如下所示,修改 sqlite3 为 mysql, 请勿直接复制粘贴 # Database setting, Support sqlite3, mysql, postgres ....
# See https://docs.djangoproject.com/en/1.10/ref/settings/#databases
# 使用的数据库配置,支持sqlite3, mysql, postgres等,默认使用sqlite3
# SQLite setting:
# 默认使用SQLite,如果使用其他数据库请注释下面两行
# DB_ENGINE = 'sqlite3' # DB_ENGINE = 'sqlite3'
# DB_NAME = os.path.join(BASE_DIR, 'data', 'db.sqlite3') # DB_NAME = os.path.join(BASE_DIR, 'data', 'db.sqlite3')
# MySQL or postgres setting like:
# 如果需要使用mysql或postgres,请取消下面的注释并输入正确的信息,本例使用mysql做演示
DB_ENGINE = 'mysql' DB_ENGINE = 'mysql'
DB_HOST = '127.0.0.1' DB_HOST = '127.0.0.1'
DB_PORT = 3306 DB_PORT = 3306
...@@ -138,7 +158,22 @@ ...@@ -138,7 +158,22 @@
DB_PASSWORD = 'somepassword' DB_PASSWORD = 'somepassword'
DB_NAME = 'jumpserver' DB_NAME = 'jumpserver'
# 到此结束,其他内容如果你不知道用途请勿更改 # When Django start it will bind this host and port
# Django 监听的ip和端口,生产环境推荐把0.0.0.0修改成127.0.0.1,这里的意思是允许x.x.x.x访问,127.0.0.1表示仅允许自身访问。
# ./manage.py runserver 127.0.0.1:8080
HTTP_BIND_HOST = '127.0.0.1'
HTTP_LISTEN_PORT = 8080
# Use Redis as broker for celery and web socket
# Redis 相关设置
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
REDIS_PASSWORD = ''
BROKER_URL = 'redis://%(password)s%(host)s:%(port)s/3' % {
'password': REDIS_PASSWORD,
'host': REDIS_HOST,
'port': REDIS_PORT,
}
... ...
config = DevelopmentConfig() config = DevelopmentConfig()
......
...@@ -155,8 +155,35 @@ Pip 加速设置请参考 <https://segmentfault.com/a/1190000011875306> ...@@ -155,8 +155,35 @@ Pip 加速设置请参考 <https://segmentfault.com/a/1190000011875306>
:: ::
class DevelopmentConfig(Config): ...
DEBUG = True class Config:
# Use it to encrypt or decrypt data
# Jumpserver 使用 SECRET_KEY 进行加密
# SECRET_KEY = os.environ.get('SECRET_KEY') or '2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=%s_qj$1%x'
SECRET_KEY = os.environ.get('SECRET_KEY') or '请随意输入随机字符串(推荐字符大于等于 50位)'
# Django security setting, if your disable debug model, you should setting that
ALLOWED_HOSTS = ['*']
# Development env open this, when error occur display the full process track, Production disable it
# DEBUG 模式 True为开启 False为关闭,默认开启,生产环境推荐关闭
DEBUG = False
# DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/
# 日志级别,默认为DEBUG,可调整为INFO, WARNING, ERROR, CRITICAL,默认INFO
LOG_LEVEL = 'WARNING'
LOG_DIR = os.path.join(BASE_DIR, 'logs')
# Database setting, Support sqlite3, mysql, postgres ....
# See https://docs.djangoproject.com/en/1.10/ref/settings/#databases
# 使用的数据库配置,支持sqlite3, mysql, postgres等,默认使用sqlite3
# SQLite setting:
# 默认使用SQLite,如果使用其他数据库请注释下面两行
# DB_ENGINE = 'sqlite3'
# DB_NAME = os.path.join(BASE_DIR, 'data', 'db.sqlite3')
# MySQL or postgres setting like:
# 如果需要使用mysql或postgres,请取消下面的注释并输入正确的信息,本例使用mysql做演示
DB_ENGINE = 'mysql' DB_ENGINE = 'mysql'
DB_HOST = '127.0.0.1' DB_HOST = '127.0.0.1'
DB_PORT = 3306 DB_PORT = 3306
...@@ -164,9 +191,25 @@ Pip 加速设置请参考 <https://segmentfault.com/a/1190000011875306> ...@@ -164,9 +191,25 @@ Pip 加速设置请参考 <https://segmentfault.com/a/1190000011875306>
DB_PASSWORD = 'somepassword' DB_PASSWORD = 'somepassword'
DB_NAME = 'jumpserver' DB_NAME = 'jumpserver'
# When Django start it will bind this host and port
# Django 监听的ip和端口,生产环境推荐把0.0.0.0修改成127.0.0.1,这里的意思是允许x.x.x.x访问,127.0.0.1表示仅允许自身访问。
# ./manage.py runserver 127.0.0.1:8080
HTTP_BIND_HOST = '127.0.0.1'
HTTP_LISTEN_PORT = 8080
# Use Redis as broker for celery and web socket
# Redis 相关设置
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
REDIS_PASSWORD = ''
BROKER_URL = 'redis://%(password)s%(host)s:%(port)s/3' % {
'password': REDIS_PASSWORD,
'host': REDIS_HOST,
'port': REDIS_PORT,
}
... ...
config = DevelopmentConfig() # 确保使用的是刚才设置的配置文件 config = DevelopmentConfig()
**2.8 生成数据库表结构和初始化数据** **2.8 生成数据库表结构和初始化数据**
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
:: ::
# 新版本更新了自动升级脚本,升级只需要到 utils 目录下执行 sh upgrade.sh 即可,请做好备份 # 升级前请做好 jumpserver 与 数据库 备份,谨防意外,具体的备份命令可以参考离线升级
$ cd /opt/jumpserver $ cd /opt/jumpserver
$ git pull $ git pull
$ pip install -r requirements/requirements.txt # 如果使用其他源下载失败可以使用 -i 参数指定源 $ pip install -r requirements/requirements.txt # 如果使用其他源下载失败可以使用 -i 参数指定源
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
:: ::
# 新版本更新了自动升级脚本,升级只需要到 utils 目录下执行 sh upgrade.sh 即可 # 如果 coco 目录非默认位置请手动修改
$ cd /opt/coco $ cd /opt/coco
$ git pull && pip install -r requirements/requirements.txt $ git pull && pip install -r requirements/requirements.txt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment