Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
koko
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
koko
Commits
2b09986a
Commit
2b09986a
authored
Jun 06, 2019
by
Eric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] add ftp log service
parent
bba9f607
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
session.go
pkg/model/session.go
+12
-0
init.go
pkg/service/init.go
+1
-1
terminal.go
pkg/service/terminal.go
+8
-0
urls.go
pkg/service/urls.go
+1
-0
No files found.
pkg/model/session.go
View file @
2b09986a
...
@@ -10,3 +10,15 @@ type Command struct {
...
@@ -10,3 +10,15 @@ type Command struct {
SystemUser
string
`json:"system_user"`
SystemUser
string
`json:"system_user"`
Timestamp
int64
`json:"timestamp"`
Timestamp
int64
`json:"timestamp"`
}
}
type
FTPLog
struct
{
User
string
`json:"user"`
Hostname
string
`json:"asset"`
OrgID
string
`json:"org_id"`
SystemUser
string
`json:"system_user"`
RemoteAddr
string
`json:"remote_addr"`
Operate
string
`json:"operate"`
Path
string
`json:"filename"`
DataStart
string
`json:"data_start"`
IsSuccess
bool
`json:"is_success"`
}
pkg/service/init.go
View file @
2b09986a
...
@@ -74,7 +74,7 @@ func MustLoadServerConfigOnce() {
...
@@ -74,7 +74,7 @@ func MustLoadServerConfigOnce() {
data
[
"TERMINAL_HOST_KEY"
]
=
"Hidden"
data
[
"TERMINAL_HOST_KEY"
]
=
"Hidden"
msg
,
err
:=
json
.
Marshal
(
data
)
msg
,
err
:=
json
.
Marshal
(
data
)
if
err
!=
nil
{
if
err
!=
nil
{
logger
.
Error
(
"Marsha server config error: %s"
,
err
)
logger
.
Error
f
(
"Marsha server config error: %s"
,
err
)
return
return
}
}
logger
.
Debug
(
"Load config from server: "
+
string
(
msg
))
logger
.
Debug
(
"Load config from server: "
+
string
(
msg
))
...
...
pkg/service/terminal.go
View file @
2b09986a
...
@@ -100,3 +100,11 @@ func PushSessionCommand(commands []*model.Command) (err error) {
...
@@ -100,3 +100,11 @@ func PushSessionCommand(commands []*model.Command) (err error) {
}
}
return
return
}
}
func
PushFTPLog
(
data
*
model
.
FTPLog
)
(
err
error
)
{
err
=
authClient
.
Post
(
FTPLogList
,
data
,
nil
)
if
err
!=
nil
{
logger
.
Error
(
err
)
}
return
}
pkg/service/urls.go
View file @
2b09986a
...
@@ -22,6 +22,7 @@ const (
...
@@ -22,6 +22,7 @@ const (
SessionDetailURL
=
"/api/terminal/v1/sessions/%s/"
// finish session的时候发送
SessionDetailURL
=
"/api/terminal/v1/sessions/%s/"
// finish session的时候发送
SessionReplayURL
=
"/api/terminal/v1/sessions/%s/replay/"
//上传录像
SessionReplayURL
=
"/api/terminal/v1/sessions/%s/replay/"
//上传录像
SessionCommandURL
=
"/api/terminal/v1/command/"
//上传批量命令
SessionCommandURL
=
"/api/terminal/v1/command/"
//上传批量命令
FTPLogList
=
"/api/audits/v1/ftp-log/"
// 上传 ftp日志
FinishTaskURL
=
"/api/terminal/v1/tasks/%s/"
FinishTaskURL
=
"/api/terminal/v1/tasks/%s/"
...
...
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