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
4d402617
Unverified
Commit
4d402617
authored
6 years ago
by
老广
Committed by
GitHub
6 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2410 from jumpserver/dev
Dev
parents
00763e98
666ef366
master
auditor_jym
audits
dev
dev_beta
dev_beta_db
gengmei
node_service
password
v52
wph
1.5.2
1.5.1
1.5.0
1.4.10
1.4.9
1.4.8
v1.4.10
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
23 deletions
+9
-23
settings.py
apps/jumpserver/settings.py
+8
-22
tasks.py
apps/terminal/tasks.py
+1
-1
No files found.
apps/jumpserver/settings.py
View file @
4d402617
...
...
@@ -15,7 +15,6 @@ import sys
import
socket
import
ldap
# from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion
from
django.urls
import
reverse_lazy
from
.conf
import
load_user_config
...
...
@@ -81,8 +80,14 @@ INSTALLED_APPS = [
XPACK_DIR
=
os
.
path
.
join
(
BASE_DIR
,
'xpack'
)
XPACK_ENABLED
=
os
.
path
.
isdir
(
XPACK_DIR
)
XPACK_TEMPLATES_DIR
=
[]
XPACK_CONTEXT_PROCESSOR
=
[]
if
XPACK_ENABLED
:
from
xpack.utils
import
get_xpack_templates_dir
,
get_xpack_context_processor
INSTALLED_APPS
.
append
(
'xpack.apps.XpackConfig'
)
XPACK_TEMPLATES_DIR
=
get_xpack_templates_dir
(
BASE_DIR
)
XPACK_CONTEXT_PROCESSOR
=
get_xpack_context_processor
()
MIDDLEWARE
=
[
'django.middleware.security.SecurityMiddleware'
,
...
...
@@ -103,29 +108,10 @@ MIDDLEWARE = [
ROOT_URLCONF
=
'jumpserver.urls'
def
get_xpack_context_processor
():
if
XPACK_ENABLED
:
return
[
'xpack.context_processor.xpack_processor'
]
return
[]
def
get_xpack_templates_dir
():
if
XPACK_ENABLED
:
dirs
=
[]
from
xpack.utils
import
find_enabled_plugins
for
i
in
find_enabled_plugins
():
template_dir
=
os
.
path
.
join
(
BASE_DIR
,
'xpack'
,
'plugins'
,
i
,
'templates'
)
if
os
.
path
.
isdir
(
template_dir
):
dirs
.
append
(
template_dir
)
return
dirs
else
:
return
[]
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
),
*
get_xpack_templates_dir
()
],
'DIRS'
:
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
),
*
XPACK_TEMPLATES_DIR
],
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'context_processors'
:
[
...
...
@@ -139,7 +125,7 @@ TEMPLATES = [
'django.template.context_processors.media'
,
'jumpserver.context_processor.jumpserver_processor'
,
'orgs.context_processor.org_processor'
,
*
get_xpack_context_processor
()
,
*
XPACK_CONTEXT_PROCESSOR
,
],
},
},
...
...
This diff is collapsed.
Click to expand it.
apps/terminal/tasks.py
View file @
4d402617
...
...
@@ -37,7 +37,7 @@ def delete_terminal_status_period():
def
clean_orphan_session
():
active_sessions
=
Session
.
objects
.
filter
(
is_finished
=
False
)
for
session
in
active_sessions
:
if
not
session
.
is_active
():
if
session
.
is_active
():
continue
session
.
is_finished
=
True
session
.
date_end
=
timezone
.
now
()
...
...
This diff is collapsed.
Click to expand it.
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