mirror of https://github.com/jumpserver/jumpserver
修改邮件settings
parent
5692e9dc86
commit
91b5d039cc
|
@ -32,4 +32,4 @@ email_host = smtp.exmail.qq.com
|
||||||
email_port = 25
|
email_port = 25
|
||||||
email_host_user = noreply@jumpserver.org
|
email_host_user = noreply@jumpserver.org
|
||||||
email_host_password = jumpserver1234
|
email_host_password = jumpserver1234
|
||||||
email_use_tls = False
|
email_use_tls = True
|
||||||
|
|
|
@ -25,11 +25,13 @@ DB_PASSWORD = config.get('db', 'password')
|
||||||
DB_DATABASE = config.get('db', 'database')
|
DB_DATABASE = config.get('db', 'database')
|
||||||
AUTH_USER_MODEL = 'juser.User'
|
AUTH_USER_MODEL = 'juser.User'
|
||||||
# mail config
|
# mail config
|
||||||
|
MAIL_ENABLE = config.get('mail', 'mail_enable')
|
||||||
EMAIL_HOST = config.get('mail', 'email_host')
|
EMAIL_HOST = config.get('mail', 'email_host')
|
||||||
EMAIL_PORT = config.get('mail', 'email_port')
|
EMAIL_PORT = config.get('mail', 'email_port')
|
||||||
EMAIL_HOST_USER = config.get('mail', 'email_host_user')
|
EMAIL_HOST_USER = config.get('mail', 'email_host_user')
|
||||||
EMAIL_HOST_PASSWORD = config.get('mail', 'email_host_password')
|
EMAIL_HOST_PASSWORD = config.get('mail', 'email_host_password')
|
||||||
EMAIL_USE_TLS = config.getboolean('mail', 'email_use_tls')
|
EMAIL_USE_TLS = config.getboolean('mail', 'email_use_tls')
|
||||||
|
EMAIL_TIMEOUT = 5
|
||||||
|
|
||||||
# ======== Log ==========
|
# ======== Log ==========
|
||||||
LOG = False
|
LOG = False
|
||||||
|
@ -41,8 +43,6 @@ KEY = config.get('base', 'key')
|
||||||
LOGIN_NAME = getpass.getuser()
|
LOGIN_NAME = getpass.getuser()
|
||||||
# LDAP_ENABLE = CONF.getint('ldap', 'ldap_enable')
|
# LDAP_ENABLE = CONF.getint('ldap', 'ldap_enable')
|
||||||
URL = config.get('base', 'url')
|
URL = config.get('base', 'url')
|
||||||
MAIL_ENABLE = config.get('mail', 'mail_enable')
|
|
||||||
MAIL_FROM = config.get('mail', 'email_host_user')
|
|
||||||
log_dir = os.path.join(BASE_DIR, 'logs')
|
log_dir = os.path.join(BASE_DIR, 'logs')
|
||||||
log_level = config.get('base', 'log')
|
log_level = config.get('base', 'log')
|
||||||
web_socket_host = config.get('websocket', 'web_socket_host')
|
web_socket_host = config.get('websocket', 'web_socket_host')
|
||||||
|
|
|
@ -5,7 +5,7 @@ from subprocess import call
|
||||||
|
|
||||||
from juser.models import AdminGroup
|
from juser.models import AdminGroup
|
||||||
from jumpserver.api import *
|
from jumpserver.api import *
|
||||||
from jumpserver.settings import BASE_DIR
|
from jumpserver.settings import BASE_DIR, EMAIL_HOST_USER as MAIL_FROM
|
||||||
|
|
||||||
|
|
||||||
def group_add_user(group, user_id=None, username=None):
|
def group_add_user(group, user_id=None, username=None):
|
||||||
|
|
|
@ -9,10 +9,11 @@ import uuid as uuid_r
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from django.db.models import ObjectDoesNotExist
|
from django.db.models import ObjectDoesNotExist
|
||||||
from jumpserver.settings import MAIL_FROM, MAIL_ENABLE
|
from jumpserver.settings import EMAIL_HOST_USER
|
||||||
from juser.user_api import *
|
from juser.user_api import *
|
||||||
from jperm.perm_api import _public_perm_api, perm_user_api, user_permed
|
from jperm.perm_api import _public_perm_api, perm_user_api, user_permed
|
||||||
|
|
||||||
|
MAIL_FROM = EMAIL_HOST_USER
|
||||||
|
|
||||||
def chg_role(request):
|
def chg_role(request):
|
||||||
role = {'SU': 2, 'GA': 1, 'CU': 0}
|
role = {'SU': 2, 'GA': 1, 'CU': 0}
|
||||||
|
|
Loading…
Reference in New Issue