Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
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
jumpserver
Commits
a55dc31c
Unverified
Commit
a55dc31c
authored
Sep 10, 2018
by
wojiushixiaobai
Committed by
GitHub
Sep 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1800 from wojiushixiaobai/docs
[Update]增加优化文档
parents
9a3d97f1
50e4bb58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
installation.rst
docs/installation.rst
+1
-0
setup_by_optimization.rst
docs/setup_by_optimization.rst
+63
-0
user_api.rst
docs/user_api.rst
+2
-1
No files found.
docs/installation.rst
View file @
a55dc31c
...
...
@@ -7,4 +7,5 @@
quickinstall
step_by_step
setup_by_ubuntu
setup_by_optimization
upgrade
docs/setup_by_optimization.rst
0 → 100644
View file @
a55dc31c
安装后优化文档
--------------------------------
- 能解决部分CPU和内存高占用问题
配置文件调整
~~~~~~~~~~~~~~
::
$ cd /opt/jumpserver
$ vim config.py
# 调整 debug 模式和 log_level
...
DEBUG = os.environ.get("DEBUG") or False
...
LOG_LEVEL = os.environ.get("LOG_LEVEL") or 'ERROR'
...
HTTP_BIND_HOST = '127.0.0.1'
...
$ cd /opt/coco
$ vim conf.py
# 调整 log_level
...
LOG_LEVEL = 'ERROR'
...
# 设置好后重启 jumpserver 和 coco
静态资源 OSS 加速访问
~~~~~~~~~~~~~~~~~~~~~
::
# 先把静态资源上传或同步到 OSS,如果使用其他工具上传,注意设置文件 HTTP 头
# 静态文件夹包括 jumpserver/data/static 和 luna
# Bucket ACL 设置为 公共读
# 防盗链需要添加 Jumpserver域名 和 ossEndPoint域名
# 跨域设置需要添加 Jumpserver域名 和 ossEndPoint域名
# 在最前端的 nginx 代理服务器上进行设置
$ cd /etc/nginx
$ vim conf.d/jumpserver.conf
...
# 根据自己的 OSS 所在地域和 域名,自行替换 yourBucket 和 yourEndPoint
location /static/ {
rewrite ^/static/(.*)$ https://yourBucket.oss-cn-yourEndPoint.aliyuncs.com/static/$1 permanent;
add_header Access-Control-Allow-Origin 'https://yourBucket.oss-cn-yourEndPoint.aliyuncs.com';
access_log off;
}
location ~ /luna/.*\.(svg|eot|ico|woff|woff2|ttf|js|css|png|json|txt)$ {
rewrite ^/luna/(.*)$ https://yourBucket.oss-cn-yourEndPoint.aliyuncs.com/luna/$1 permanent;
add_header Access-Control-Allow-Origin 'https://yourBucket.oss-cn-yourEndPoint.aliyuncs.com';
access_log off;
}
# 设置完成后重启 nginx
docs/user_api.rst
View file @
a55dc31c
...
...
@@ -9,6 +9,7 @@ API 文档
- 手动调用 api 的方法
::
$ curl -X POST -H 'Content-Type: application/json' -d '{"username": "admin", "password": "admin"}' http://localhost/api/users/v1/token/ # 获取token
...
...
@@ -17,8 +18,8 @@ API 文档
$ curl -H 'Authorization: Bearer 937b38011acf499eb474e2fecb424ab3' -H "Content-Type:application/json" http://localhost/api/users/v1/users/
# 使用token访问,token有效期 1小时
- python代码示例
::
import requests
...
...
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