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
e76392a1
Commit
e76392a1
authored
Mar 04, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'stable' into dev
parents
1a247d60
53f0b2e9
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
17 deletions
+34
-17
conf.py
apps/jumpserver/conf.py
+1
-0
settings.py
apps/jumpserver/settings.py
+2
-1
task_list.html
apps/ops/templates/ops/task_list.html
+0
-8
adhoc.py
apps/ops/views/adhoc.py
+0
-5
tasks.py
apps/users/tasks.py
+17
-2
login.py
apps/users/views/login.py
+1
-1
config_example.yml
config_example.yml
+8
-0
README.md
docs/README.md
+5
-0
No files found.
apps/jumpserver/conf.py
View file @
e76392a1
...
...
@@ -347,6 +347,7 @@ defaults = {
'RADIUS_SECRET'
:
''
,
'HTTP_BIND_HOST'
:
'0.0.0.0'
,
'HTTP_LISTEN_PORT'
:
8080
,
'LOGIN_LOG_KEEP_DAYS'
:
90
,
}
...
...
apps/jumpserver/settings.py
View file @
e76392a1
...
...
@@ -527,6 +527,7 @@ TERMINAL_ASSET_LIST_PAGE_SIZE = CONFIG.TERMINAL_ASSET_LIST_PAGE_SIZE
TERMINAL_SESSION_KEEP_DURATION
=
CONFIG
.
TERMINAL_SESSION_KEEP_DURATION
TERMINAL_HOST_KEY
=
CONFIG
.
TERMINAL_HOST_KEY
TERMINAL_HEADER_TITLE
=
CONFIG
.
TERMINAL_HEADER_TITLE
TERMINAL_TELNET_REGEX
=
CONFIG
.
TERMINAL_TELNET_REGEX
# Django bootstrap3 setting, more see http://django-bootstrap3.readthedocs.io/en/latest/settings.html
BOOTSTRAP3
=
{
...
...
@@ -556,4 +557,4 @@ SWAGGER_SETTINGS = {
# Default email suffix
EMAIL_SUFFIX
=
CONFIG
.
EMAIL_SUFFIX
TERMINAL_TELNET_REGEX
=
CONFIG
.
TERMINAL_TELNET_REGEX
LOGIN_LOG_KEEP_DAYS
=
CONFIG
.
LOGIN_LOG_KEEP_DAYS
apps/ops/templates/ops/task_list.html
View file @
e76392a1
...
...
@@ -9,14 +9,6 @@
{% block table_search %}
<form
id=
"search_form"
method=
"get"
action=
""
class=
"pull-right form-inline"
>
<div
class=
"form-group"
id=
"date"
>
<div
class=
"input-daterange input-group"
id=
"datepicker"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-calendar"
></i></span>
<input
type=
"text"
class=
"input-sm form-control"
style=
"width: 100px;"
name=
"date_from"
value=
"{{ date_from|date:'Y-m-d' }}"
>
<span
class=
"input-group-addon"
>
to
</span>
<input
type=
"text"
class=
"input-sm form-control"
style=
"width: 100px;"
name=
"date_to"
value=
"{{ date_to|date:'Y-m-d' }}"
>
</div>
</div>
<div
class=
"input-group"
>
<input
type=
"text"
class=
"form-control input-sm"
name=
"keyword"
placeholder=
"{% trans 'Search' %}"
value=
"{{ keyword }}"
>
</div>
...
...
apps/ops/views/adhoc.py
View file @
e76392a1
...
...
@@ -33,11 +33,6 @@ class TaskListView(AdminUserRequiredMixin, DatetimeSearchMixin, ListView):
queryset
=
queryset
.
filter
(
created_by
=
''
)
self
.
keyword
=
self
.
request
.
GET
.
get
(
'keyword'
,
''
)
queryset
=
queryset
.
filter
(
date_created__gt
=
self
.
date_from
,
date_created__lt
=
self
.
date_to
)
if
self
.
keyword
:
queryset
=
queryset
.
filter
(
name__icontains
=
self
.
keyword
,
...
...
apps/users/tasks.py
View file @
e76392a1
# -*- coding: utf-8 -*-
#
import
datetime
from
django.utils
import
timezone
from
django.conf
import
settings
from
celery
import
shared_task
from
ops.celery.utils
import
create_or_update_celery_periodic_tasks
from
ops.celery.decorator
import
after_app_ready_start
from
.models
import
User
from
ops.celery.decorator
import
after_app_ready_start
,
register_as_period_task
from
common.utils
import
get_logger
from
.models
import
User
,
LoginLog
from
.utils
import
write_login_log
,
send_password_expiration_reminder_mail
...
...
@@ -43,3 +46,15 @@ def check_password_expired_periodic():
}
}
create_or_update_celery_periodic_tasks
(
tasks
)
@register_as_period_task
(
interval
=
3600
*
24
)
@shared_task
def
clean_login_log_period
():
now
=
timezone
.
now
()
try
:
days
=
int
(
settings
.
LOGIN_LOG_KEEP_DAYS
)
except
ValueError
:
days
=
90
expired_day
=
now
-
datetime
.
timedelta
(
days
=
days
)
LoginLog
.
objects
.
filter
(
datetime__lt
=
expired_day
)
.
delete
()
apps/users/views/login.py
View file @
e76392a1
...
...
@@ -291,7 +291,7 @@ class UserResetPasswordView(TemplateView):
template_name
=
'users/reset_password.html'
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
token
=
request
.
GET
.
get
(
'token'
)
token
=
request
.
GET
.
get
(
'token'
,
''
)
user
=
User
.
validate_reset_token
(
token
)
if
not
user
:
kwargs
.
update
({
'errors'
:
_
(
'Token invalid or expired'
)})
...
...
config_example.yml
View file @
e76392a1
...
...
@@ -61,6 +61,14 @@ REDIS_PORT: 6379
# AUTH_OPENID_REALM_NAME: realm-name
# AUTH_OPENID_CLIENT_ID: client-id
# AUTH_OPENID_CLIENT_SECRET: client-secret
#
# Use Radius authorization
# 使用Radius来认证
# AUTH_RADIUS: false
# RADIUS_SERVER: localhost
# RADIUS_PORT: 1812
# RADIUS_SECRET:
# OTP settings
# OTP/MFA 配置
...
...
docs/README.md
0 → 100644
View file @
e76392a1
## 说明
文档已移动到docs分支,该目录中不是最新文档, 请提交到docs分支
## 访问在线文档
[
访问
](
https://docs.jumpserver.org
)
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