mirror of https://github.com/jumpserver/jumpserver
58875d9a95
* [Update] 修改小问题 * [Update] 添加重传guacamole的脚本 * [Update] 添加debug * [Update] 优化可连接性 * [Update] 修改connectivity * [Update] 更改查看认证需要的MFA时间间隔 * [Update] 修改表结构 * [Update] 修改users public_key等字段 * [Update] 修改用户表结构 * [Update] 修改assets users api * [Update] 修改org mixin * [Update] 解决连接windows资产出现幽灵会话的问题 * [Update] 优化树结构 * [Update] 修改Permission * Stash * [Update] 修改serializer * [Update] 修改用户有权限的资产 * [Update] 修改upgrouped_node key的获取(解决操作日志中出现coco/gua的问题) * [Update] 修改一些bug * [Update] Debug cache * [Bugfix] 修复用户页面不走cache的bug * ipython * [Update] 修改action * [Bugfix] 修改校验系统用户资产动作权限的API逻辑 * [Update] 去掉原来批量的view * [Bugfix] 会话/命令列表中获取用户列表排除app用户 * [Update] 修改用户授权资产API返回的queryset * [Update] 修正migrations * [Bugfix] 解决进入授权详情页的资产管理页面bug * [Update] 修改Minxs * [Update] 修改migrations * [Update] 资产授权Model模块添加导入 * [Update] 优化命令记录列表 * [Update] 修改command列表 * [Update] 解决用户授权资产/节点为空时,前端构建资产授权树的bug (#2874) * [Update] 解决用户授权资产/节点为空时,前端构建资产授权树的bug * [Update] 如果用户授权节点为空,返回时添加空节点 * [Update] 修改command导出和搜索 * [Update] 修改session * [Update] 修改Permission响应层缓存key * [Update] 准备优化 asset user * [Update] 修改去掉一些print * [Bugfix] 修复initDataTable表格搜索栏位置错乱的问题,显示不友好问题 (#2880) * [Bugfix] 修复创建用户的View,使用密码创建用户时没有校验密码规则 (#2877) * [Bugfix] 修复创建用户的View,使用密码创建用户时没有校验密码规则 * [Bugfix]修复小问题 * [Update] 优化创建用户和更新用户密码的校验 * [Update] 优化用户表单校验password逻辑 * [Update] 小问题 * [Update] 修改command搜索 * [Update] 修改user group serialzier * [Update] 优化资产 * [Update] 优化节点 * [Update] 优化用户组列表用户显示问题 (#2882) * [Update] 解决select_for_update的错误 * [update] 修改Node无法被删除的bug * [Update] 添加翻译 * [update] 修改资产导出的permssions * [Bugfix] 修复删除节点bug (#2883) * [update] 修改一些性能问题 |
||
---|---|---|
.. | ||
fields | ||
migrations | ||
mixins | ||
parsers | ||
renders | ||
templatetags | ||
urls | ||
utils | ||
README.md | ||
__init__.py | ||
api.py | ||
apps.py | ||
compat.py | ||
const.py | ||
decorator.py | ||
drfmetadata.py | ||
exceptions.py | ||
filters.py | ||
local.py | ||
permissions.py | ||
serializers.py | ||
signals.py | ||
signals_handlers.py | ||
struct.py | ||
tasks.py | ||
tests.py | ||
tree.py | ||
validators.py |
README.md
Common app
Common app provide common view, function or others.
Common app shouldn't rely on other apps, because It may lead to cycle import.
If your want to implement some function or class, you should think whether other app use or not. If yes, You should make in common.
If the ability more relate to your app tightness, It's mean your app provide this ability, not common, You should write it on your app utils.
Celery usage
Jumpserver use celery to run task async. Using redis as the broker, so you should run a redis instance
Run redis
$ yum -y install redis
or
$ docker run -name jumpserver-redis -d -p 6379:6379 redis redis-server
Write tasks in app_name/tasks.py
ops/tasks.py
from __future__ import absolute_import
import time
from celery import shared_task
from common import celery_app
@shared_task
def longtime_add(x, y):
print 'long time task begins'
# sleep 5 seconds
time.sleep(5)
print 'long time task finished'
return x + y
@celery_app.task(name='hello-world')
def hello():
print 'hello world!'
Run celery in development
$ cd apps
$ celery -A common worker -l info
Test using task
$ ./manage.py shell
>>> from ops.tasks import longtime_add
>>> res = longtime_add.delay(1, 2)
>>> res.get()