mirror of https://github.com/jumpserver/jumpserver
ÐÞ¸´bug
parent
8f7e1bfc38
commit
311b65da00
|
@ -27,8 +27,8 @@ web_socket_host = 192.168.20.209:3000
|
|||
|
||||
|
||||
[mail]
|
||||
email_host = smtp.exmail.qq.com
|
||||
email_host = smtp.qq.com
|
||||
email_port = 25
|
||||
email_host_user = noreply@jumpserver.org
|
||||
email_host_password = jumpserver123
|
||||
email_host_user = xxxx@qq.com
|
||||
email_host_password = qqpasswd
|
||||
email_use_tls = False
|
||||
|
|
|
@ -69,7 +69,6 @@ def db_add_user(**kwargs):
|
|||
|
||||
|
||||
def db_update_user(**kwargs):
|
||||
print kwargs
|
||||
groups_post = kwargs.pop('groups')
|
||||
user_id = kwargs.pop('user_id')
|
||||
user = User.objects.filter(id=user_id)
|
||||
|
@ -640,7 +639,7 @@ def user_add(request):
|
|||
您的部门: %s
|
||||
您的角色: %s
|
||||
您的web登录密ç : %s
|
||||
您的ssh登录密ç : %s
|
||||
您的ssh密钥文件密ç : %s
|
||||
密钥下载地å€ï¼š http://%s:%s/juser/down_key/?id=%s
|
||||
说明: 请登陆åŽå†ä¸‹è½½å¯†é’¥ï¼
|
||||
""" % (name, username, dept.name, user_role.get(role_post, ''),
|
||||
|
@ -722,12 +721,11 @@ def user_add_adm(request):
|
|||
您的部门: %s
|
||||
您的角色: %s
|
||||
您的web登录密ç : %s
|
||||
您的ssh登录密ç : %s
|
||||
您的ssh密钥文件密ç : %s
|
||||
密钥下载地å€ï¼š http://%s:%s/juser/down_key/?id=%s
|
||||
说明: 请登陆åŽå†ä¸‹è½½å¯†é’¥ï¼
|
||||
""" % (name, username, dept.name, '普通用户',
|
||||
password, ssh_key_pwd, SEND_IP, SEND_PORT, user.id)
|
||||
print MAIL_FROM
|
||||
send_mail(mail_title, mail_msg, MAIL_FROM, [email], fail_silently=False)
|
||||
msg = u'æ·»åŠ ç”¨æˆ· %s æˆåŠŸï¼ 用户密ç å·²å‘é€åˆ° %s 邮箱ï¼' % (username, email)
|
||||
|
||||
|
|
112
service.sh
112
service.sh
|
@ -1,24 +1,112 @@
|
|||
#!/bin/bash
|
||||
# jumpserver Startup script for the jumpserver Server
|
||||
#
|
||||
# chkconfig: - 85 12
|
||||
# description: Open source detecting system
|
||||
# processname: jumpserver
|
||||
# Date: 2015-04-12
|
||||
# Version: 2.0.0
|
||||
# Site: http://www.jumpserver.org
|
||||
# Author: jumpserver group
|
||||
|
||||
. /etc/init.d/functions
|
||||
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin
|
||||
|
||||
base_dir=$(dirname $0)
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
python $base_dir/manage.py runserver 0.0.0.0:80 &
|
||||
python $base_dir/log_handler.py &
|
||||
cd $base_dir/websocket/; node index.js &
|
||||
;;
|
||||
PROC_NAME="jumpsever"
|
||||
lockfile=/var/lock/subsys/${PROC_NAME}
|
||||
|
||||
|
||||
start() {
|
||||
jump_start=$"Starting ${PROC_NAME} service:"
|
||||
|
||||
if [ -f $lockfile ];then
|
||||
echo "jumpserver is running..."
|
||||
success "$jump_start"
|
||||
else
|
||||
daemon python $base_dir/manage.py runserver 0.0.0.0:80 &>> /tmp/jumpserver.log 2>&1 &
|
||||
daemon python $base_dir/log_handler.py &> /dev/null 2>&1 &
|
||||
cd $base_dir/websocket/;daemon node index.js &> /dev/null 2>&1 &
|
||||
sleep 1
|
||||
|
||||
echo "$jump_start"
|
||||
nums=0
|
||||
for i in manage.py log_handler.py index.js;do
|
||||
ps aux | grep "$i" | grep -v 'grep' && let nums+=1 &> /dev/null
|
||||
done
|
||||
|
||||
if [ "x$nums" = "x4" ];then
|
||||
success "$jump_start"
|
||||
touch "$lockfile"
|
||||
echo
|
||||
else
|
||||
failure "$jump_start"
|
||||
echo
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
stop() {
|
||||
|
||||
echo -n $"Stopping ${PROC_NAME} service:"
|
||||
|
||||
if [ -e $lockfile ];then
|
||||
ps aux | grep -E 'manage.py|log_handler.py|index.js' | grep -v grep | awk '{print $2}' | xargs kill -9 &> /dev/null
|
||||
ret=$?
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
echo_success
|
||||
echo
|
||||
rm -f "$lockfile"
|
||||
else
|
||||
echo_failure
|
||||
echo
|
||||
fi
|
||||
else
|
||||
echo_success
|
||||
echo
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
restart(){
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
stop)
|
||||
pkill -15 runserver
|
||||
pkill -15 log_handler.py
|
||||
pkill -15 node
|
||||
;;
|
||||
|
||||
esac
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<div class="col-sm-8">
|
||||
<select id="j_dept" name="j_dept" class="form-control m-b" onchange="change_dept(this.value)">
|
||||
{% for d in edept %}
|
||||
<option type="checkbox" value="{{ d.id }}">{{ d.name }}</option>
|
||||
<option value="{{ d.id }}">{{ d.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
@ -151,12 +151,12 @@
|
|||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#submit_button").click(function(){
|
||||
$('#assetForm option').each(function(){
|
||||
$('#asset_select option').each(function(){
|
||||
$(this).prop('selected', true)
|
||||
})
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
$('#assetForm').validator({
|
||||
timely: 2,
|
||||
|
|
Loading…
Reference in New Issue