Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
170783c2
Commit
170783c2
authored
Feb 07, 2019
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make hourly cleanup the default behavior
parent
3555997f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
18 deletions
+8
-18
conf/defaults.ini
+0
-3
conf/sample.ini
+0
-3
pkg/services/auth/auth_token_test.go
+3
-4
pkg/services/auth/token_cleanup.go
+1
-2
pkg/setting/setting.go
+4
-6
No files found.
conf/defaults.ini
View file @
170783c2
...
...
@@ -256,9 +256,6 @@ login_maximum_lifetime_days = 30
# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
token_rotation_interval_minutes
=
10
# How often should expired auth tokens be deleted from the database. The default is each hour.
expired_tokens_cleanup_interval_hours
=
1
# Set to true to disable (hide) the login form, useful if you use OAuth
disable_login_form
=
false
...
...
conf/sample.ini
View file @
170783c2
...
...
@@ -236,9 +236,6 @@ log_queries =
# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
;token_rotation_interval_minutes = 10
# How often should expired auth tokens be deleted from the database. The default is each hour.
;expired_tokens_cleanup_interval_hours = 1
# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
;disable_login_form = false
...
...
pkg/services/auth/auth_token_test.go
View file @
170783c2
...
...
@@ -423,10 +423,9 @@ func createTestContext(t *testing.T) *testContext {
tokenService
:=
&
UserAuthTokenService
{
SQLStore
:
sqlstore
,
Cfg
:
&
setting
.
Cfg
{
LoginMaxInactiveLifetimeDays
:
7
,
LoginMaxLifetimeDays
:
30
,
TokenRotationIntervalMinutes
:
10
,
ExpiredTokensCleanupIntervalHours
:
1
,
LoginMaxInactiveLifetimeDays
:
7
,
LoginMaxLifetimeDays
:
30
,
TokenRotationIntervalMinutes
:
10
,
},
log
:
log
.
New
(
"test-logger"
),
}
...
...
pkg/services/auth/token_cleanup.go
View file @
170783c2
...
...
@@ -6,8 +6,7 @@ import (
)
func
(
srv
*
UserAuthTokenService
)
Run
(
ctx
context
.
Context
)
error
{
jobInterval
:=
time
.
Duration
(
srv
.
Cfg
.
ExpiredTokensCleanupIntervalHours
)
*
time
.
Hour
ticker
:=
time
.
NewTicker
(
jobInterval
)
ticker
:=
time
.
NewTicker
(
time
.
Hour
)
maxInactiveLifetime
:=
time
.
Duration
(
srv
.
Cfg
.
LoginMaxInactiveLifetimeDays
)
*
24
*
time
.
Hour
maxLifetime
:=
time
.
Duration
(
srv
.
Cfg
.
LoginMaxLifetimeDays
)
*
24
*
time
.
Hour
...
...
pkg/setting/setting.go
View file @
170783c2
...
...
@@ -233,11 +233,10 @@ type Cfg struct {
EnterpriseLicensePath
string
// Auth
LoginCookieName
string
LoginMaxInactiveLifetimeDays
int
LoginMaxLifetimeDays
int
TokenRotationIntervalMinutes
int
ExpiredTokensCleanupIntervalHours
int
LoginCookieName
string
LoginMaxInactiveLifetimeDays
int
LoginMaxLifetimeDays
int
TokenRotationIntervalMinutes
int
}
type
CommandLineArgs
struct
{
...
...
@@ -673,7 +672,6 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
if
cfg
.
TokenRotationIntervalMinutes
<
2
{
cfg
.
TokenRotationIntervalMinutes
=
2
}
cfg
.
ExpiredTokensCleanupIntervalHours
=
auth
.
Key
(
"expired_tokens_cleanup_interval_hours"
)
.
MustInt
(
1
)
DisableLoginForm
=
auth
.
Key
(
"disable_login_form"
)
.
MustBool
(
false
)
DisableSignoutMenu
=
auth
.
Key
(
"disable_signout_menu"
)
.
MustBool
(
false
)
...
...
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