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
84f24370
Commit
84f24370
authored
Jun 11, 2019
by
Eric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename path
parent
e1b0e42c
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
144 additions
and
145 deletions
+144
-145
Gopkg.lock
Gopkg.lock
+0
-1
Makefile
cmd/Makefile
+5
-5
config_example.yml
cmd/config_example.yml
+2
-2
koko.go
cmd/koko.go
+2
-2
server.go
pkg/auth/server.go
+6
-6
context.go
pkg/cctx/context.go
+1
-1
client.go
pkg/common/client.go
+1
-1
banner.go
pkg/handler/banner.go
+4
-4
pagination.go
pkg/handler/pagination.go
+5
-5
session.go
pkg/handler/session.go
+8
-8
sftp.go
pkg/handler/sftp.go
+6
-6
client.go
pkg/httpd/client.go
+1
-1
connection.go
pkg/httpd/connection.go
+1
-1
context.go
pkg/httpd/context.go
+1
-1
elfhandler.go
pkg/httpd/elfhandler.go
+4
-4
handler.go
pkg/httpd/handler.go
+3
-3
server.go
pkg/httpd/server.go
+5
-5
sftpvolume.go
pkg/httpd/sftpvolume.go
+6
-6
i18n.go
pkg/i18n/i18n.go
+3
-3
i18n_test.go
pkg/i18n/i18n_test.go
+1
-1
koko.go
pkg/koko/koko.go
+6
-6
task.go
pkg/koko/task.go
+6
-6
logger.go
pkg/logger/logger.go
+3
-3
parser.go
pkg/proxy/parser.go
+4
-4
parsercmd.go
pkg/proxy/parsercmd.go
+1
-1
proxy.go
pkg/proxy/proxy.go
+7
-7
recorder.go
pkg/proxy/recorder.go
+4
-4
azure.go
pkg/proxy/recorderstorage/azure.go
+1
-1
es.go
pkg/proxy/recorderstorage/es.go
+2
-2
file.go
pkg/proxy/recorderstorage/file.go
+1
-1
oss.go
pkg/proxy/recorderstorage/oss.go
+1
-1
s3.go
pkg/proxy/recorderstorage/s3.go
+1
-1
server.go
pkg/proxy/recorderstorage/server.go
+2
-2
sessmanager.go
pkg/proxy/sessmanager.go
+5
-5
switch.go
pkg/proxy/switch.go
+6
-6
transport.go
pkg/proxy/transport.go
+1
-1
util.go
pkg/proxy/util.go
+3
-3
accesskey.go
pkg/service/accesskey.go
+3
-3
assets.go
pkg/service/assets.go
+2
-2
init.go
pkg/service/init.go
+3
-3
perms.go
pkg/service/perms.go
+2
-2
terminal.go
pkg/service/terminal.go
+2
-2
users.go
pkg/service/users.go
+2
-2
connmanager.go
pkg/srvconn/connmanager.go
+3
-3
sshconn.go
pkg/srvconn/sshconn.go
+1
-1
telnetconn.go
pkg/srvconn/telnetconn.go
+2
-2
hostkey.go
pkg/sshd/hostkey.go
+1
-1
server.go
pkg/sshd/server.go
+4
-4
No files found.
Gopkg.lock
View file @
84f24370
...
...
@@ -329,7 +329,6 @@
"github.com/aws/aws-sdk-go/aws",
"github.com/aws/aws-sdk-go/aws/credentials",
"github.com/aws/aws-sdk-go/aws/session",
"github.com/aws/aws-sdk-go/service/s3",
"github.com/aws/aws-sdk-go/service/s3/s3manager",
"github.com/elastic/go-elasticsearch",
"github.com/gliderlabs/ssh",
...
...
cmd/Makefile
View file @
84f24370
...
...
@@ -3,15 +3,15 @@ BRANCH := $(shell git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3)
BUILD
:=
$(
shell
git rev-parse
--short
HEAD
)
VERSION
=
$(BRANCH)
-
$(BUILD)
NAME
:=
coc
o
DIRNAME
:=
cocogo
NAME
:=
kok
o
DIRNAME
:=
kokodir
BASEPATH
:=
$(
shell
pwd
)
CGO_ENABLED
=
0
GOCMD
=
go
GOBUILD
=
$(GOCMD)
build
SOFTWARENAME
=
$(NAME)
-
$(VERSION)
COCOSRCFILE
=
coc
o.go
KOKOSRCFILE
=
kok
o.go
BUILDDIR
:=
$(BASEPATH)
/../build
ASSETS
=
locale static templates config_example.yml
...
...
@@ -30,14 +30,14 @@ Asset:
.PHONY
:
$(PLATFORMS)
$(PLATFORMS)
:
Asset
@
echo
"编译"
$@
GOOS
=
$@
GOARCH
=
amd64 go build
-o
$(NAME)
$(
COC
OSRCFILE)
GOOS
=
$@
GOARCH
=
amd64 go build
-o
$(NAME)
$(
KOK
OSRCFILE)
cp
-f
$(NAME)
$(DIRNAME)
tar
czvf
$(BUILDDIR)
/
$(SOFTWARENAME)
-
$@
-amd64
.tar.gz
$(DIRNAME)
.PHONY
:
docker
docker
:
@
echo
"build docker images"
docker build
-t
cocog
o
--build-arg
http_proxy
=
$(http_proxy)
--build-arg
https_proxy
=
$(https_proxy)
$(BASEPATH)
/../
docker build
-t
kok
o
--build-arg
http_proxy
=
$(http_proxy)
--build-arg
https_proxy
=
$(https_proxy)
$(BASEPATH)
/../
.PHONY
:
clean
clean
:
...
...
cmd/config_example.yml
View file @
84f24370
NAME
:
coco
2
BOOTSTRAP_TOKEN
:
PleaseChangeMe
NAME
:
coco
3
BOOTSTRAP_TOKEN
:
uuvdKUxvhW3v
CORE_HOST
:
http://127.0.0.1:8080
LOG_LEVEL
:
INFO
cmd/
coc
o.go
→
cmd/
kok
o.go
View file @
84f24370
package
main
import
(
"
koko/pkg/coc
o"
"
github.com/jumpserver/koko/pkg/kok
o"
)
func
main
()
{
coc
o
.
RunForever
()
kok
o
.
RunForever
()
}
pkg/auth/server.go
View file @
84f24370
...
...
@@ -6,12 +6,12 @@ import (
"github.com/gliderlabs/ssh"
gossh
"golang.org/x/crypto/ssh"
"koko/pkg/cctx"
"koko/pkg/common"
"koko/pkg/config"
"koko/pkg/i18n"
"koko/pkg/logger"
"koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/cctx"
"
github.com/jumpserver/
koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/i18n"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/service"
)
var
mfaInstruction
=
i18n
.
T
(
"Please enter 6 digits."
)
...
...
pkg/cctx/context.go
View file @
84f24370
...
...
@@ -5,7 +5,7 @@ import (
"github.com/gliderlabs/ssh"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/model"
)
type
contextKey
struct
{
...
...
pkg/common/client.go
View file @
84f24370
...
...
@@ -128,7 +128,7 @@ func (c *Client) SetReqHeaders(req *http.Request) {
if
req
.
Header
.
Get
(
"Content-Type"
)
==
""
{
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
}
req
.
Header
.
Set
(
"user-Agent"
,
"
coc
o-client"
)
req
.
Header
.
Set
(
"user-Agent"
,
"
kok
o-client"
)
c
.
setAuthHeader
(
req
)
}
...
...
pkg/handler/banner.go
View file @
84f24370
...
...
@@ -8,10 +8,10 @@ import (
"github.com/gliderlabs/ssh"
"koko/pkg/config"
"koko/pkg/i18n"
"koko/pkg/logger"
"koko/pkg/utils"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/i18n"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/utils"
)
var
defaultTitle
string
...
...
pkg/handler/pagination.go
View file @
84f24370
...
...
@@ -5,11 +5,11 @@ import (
"strconv"
"strings"
"koko/pkg/common"
"koko/pkg/config"
"koko/pkg/i18n"
"koko/pkg/model"
"koko/pkg/utils"
"
github.com/jumpserver/
koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/i18n"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/utils"
)
func
NewAssetPagination
(
term
*
utils
.
Terminal
,
assets
[]
model
.
Asset
)
*
AssetPagination
{
...
...
pkg/handler/session.go
View file @
84f24370
...
...
@@ -12,14 +12,14 @@ import (
"github.com/olekukonko/tablewriter"
"github.com/xlab/treeprint"
"koko/pkg/cctx"
"koko/pkg/config"
"koko/pkg/i18n"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/proxy"
"koko/pkg/service"
"koko/pkg/utils"
"
github.com/jumpserver/
koko/pkg/cctx"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/i18n"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/proxy"
"
github.com/jumpserver/
koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/utils"
)
type
assetsCacheContainer
struct
{
...
...
pkg/handler/sftp.go
View file @
84f24370
...
...
@@ -14,12 +14,12 @@ import (
"github.com/pkg/sftp"
gossh
"golang.org/x/crypto/ssh"
"koko/pkg/cctx"
"koko/pkg/config"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/service"
"koko/pkg/srvconn"
"
github.com/jumpserver/
koko/pkg/cctx"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/srvconn"
)
func
SftpHandler
(
sess
ssh
.
Session
)
{
...
...
pkg/httpd/client.go
View file @
84f24370
...
...
@@ -6,7 +6,7 @@ import (
"github.com/gliderlabs/ssh"
socketio
"github.com/googollee/go-socket.io"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/model"
)
type
Client
struct
{
...
...
pkg/httpd/connection.go
View file @
84f24370
...
...
@@ -6,7 +6,7 @@ import (
"github.com/gliderlabs/ssh"
socketio
"github.com/googollee/go-socket.io"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/model"
)
var
conns
=
&
connections
{
container
:
make
(
map
[
string
]
*
WebConn
),
mu
:
new
(
sync
.
RWMutex
)}
...
...
pkg/httpd/context.go
View file @
84f24370
package
httpd
import
"koko/pkg/model"
import
"
github.com/jumpserver/
koko/pkg/model"
type
WebContext
struct
{
User
*
model
.
User
...
...
pkg/httpd/elfhandler.go
View file @
84f24370
...
...
@@ -11,10 +11,10 @@ import (
socketio
"github.com/googollee/go-socket.io"
"github.com/gorilla/mux"
"koko/pkg/cctx"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/cctx"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/service"
)
func
AuthDecorator
(
handler
http
.
HandlerFunc
)
http
.
HandlerFunc
{
...
...
pkg/httpd/handler.go
View file @
84f24370
...
...
@@ -10,9 +10,9 @@ import (
socketio
"github.com/googollee/go-socket.io"
uuid
"github.com/satori/go.uuid"
"koko/pkg/logger"
"koko/pkg/proxy"
"koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/proxy"
"
github.com/jumpserver/
koko/pkg/service"
)
// OnConnectHandler 当websocket连接后触发
...
...
pkg/httpd/server.go
View file @
84f24370
...
...
@@ -8,8 +8,8 @@ import (
socketio
"github.com/googollee/go-socket.io"
"github.com/gorilla/mux"
"koko/pkg/config"
"koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/logger"
)
var
(
...
...
@@ -43,9 +43,9 @@ func StartHTTPServer() {
router
.
PathPrefix
(
"/static/"
)
.
Handler
(
http
.
StripPrefix
(
"/static/"
,
fs
))
router
.
Handle
(
"/socket.io/"
,
server
)
router
.
HandleFunc
(
"/
coc
o/elfinder/sftp/{host}/"
,
AuthDecorator
(
sftpHostFinder
))
router
.
HandleFunc
(
"/
coc
o/elfinder/sftp/"
,
AuthDecorator
(
sftpFinder
))
router
.
HandleFunc
(
"/
coc
o/elfinder/sftp/connector/{host}/"
,
router
.
HandleFunc
(
"/
kok
o/elfinder/sftp/{host}/"
,
AuthDecorator
(
sftpHostFinder
))
router
.
HandleFunc
(
"/
kok
o/elfinder/sftp/"
,
AuthDecorator
(
sftpFinder
))
router
.
HandleFunc
(
"/
kok
o/elfinder/sftp/connector/{host}/"
,
AuthDecorator
(
sftpHostConnectorView
))
.
Methods
(
"GET"
,
"POST"
)
addr
:=
net
.
JoinHostPort
(
conf
.
BindHost
,
conf
.
HTTPPort
)
...
...
pkg/httpd/sftpvolume.go
View file @
84f24370
...
...
@@ -12,12 +12,12 @@ import (
"github.com/pkg/sftp"
gossh
"golang.org/x/crypto/ssh"
"koko/pkg/common"
"koko/pkg/config"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/service"
"koko/pkg/srvconn"
"
github.com/jumpserver/
koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/srvconn"
)
var
(
...
...
pkg/i18n/i18n.go
View file @
84f24370
...
...
@@ -6,16 +6,16 @@ import (
"github.com/leonelquinteros/gotext"
"koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/config"
)
func
init
()
{
cf
:=
config
.
GetConf
()
localePath
:=
path
.
Join
(
cf
.
RootPath
,
"locale"
)
if
strings
.
HasPrefix
(
cf
.
Language
,
"zh"
)
{
gotext
.
Configure
(
localePath
,
"zh_CN"
,
"
coc
o"
)
gotext
.
Configure
(
localePath
,
"zh_CN"
,
"
kok
o"
)
}
else
{
gotext
.
Configure
(
localePath
,
"en_US"
,
"
coc
o"
)
gotext
.
Configure
(
localePath
,
"en_US"
,
"
kok
o"
)
}
}
...
...
pkg/i18n/i18n_test.go
View file @
84f24370
...
...
@@ -8,7 +8,7 @@ import (
func
TestT
(
t
*
testing
.
T
)
{
//loc := gotext.NewLocale("./locale", "zh_CN")
//loc.AddDomain("
coc
o")
//loc.AddDomain("
kok
o")
fmt
.
Println
(
T
(
"Welcome to use Jumpserver open source fortress system"
))
}
...
...
pkg/
coco/coc
o.go
→
pkg/
koko/kok
o.go
View file @
84f24370
package
coc
o
package
kok
o
import
(
"fmt"
...
...
@@ -7,11 +7,11 @@ import (
"syscall"
"time"
"koko/pkg/config"
"koko/pkg/httpd"
"koko/pkg/logger"
"koko/pkg/service"
"koko/pkg/sshd"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/httpd"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/sshd"
)
const
version
=
"1.4.0"
...
...
pkg/
coc
o/task.go
→
pkg/
kok
o/task.go
View file @
84f24370
package
coc
o
package
kok
o
import
(
"os"
...
...
@@ -6,11 +6,11 @@ import (
"strings"
"time"
"koko/pkg/common"
"koko/pkg/config"
"koko/pkg/logger"
"koko/pkg/proxy"
"koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/proxy"
"
github.com/jumpserver/
koko/pkg/service"
)
func
Initial
()
{
...
...
pkg/logger/logger.go
View file @
84f24370
...
...
@@ -8,8 +8,8 @@ import (
"github.com/sirupsen/logrus"
"koko/pkg/common"
"koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/config"
)
var
logger
=
logrus
.
New
()
...
...
@@ -38,7 +38,7 @@ func Initial() {
logger
.
SetLevel
(
level
)
// Output to file
logFilePath
:=
path
.
Join
(
conf
.
RootPath
,
"logs"
,
"
coc
o.log"
)
logFilePath
:=
path
.
Join
(
conf
.
RootPath
,
"logs"
,
"
kok
o.log"
)
logDirPath
:=
path
.
Dir
(
logFilePath
)
if
common
.
FileExists
(
logDirPath
)
{
err
:=
os
.
MkdirAll
(
logDirPath
,
os
.
ModePerm
)
...
...
pkg/proxy/parser.go
View file @
84f24370
...
...
@@ -5,10 +5,10 @@ import (
"fmt"
"sync"
"koko/pkg/i18n"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/utils"
"
github.com/jumpserver/
koko/pkg/i18n"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/utils"
)
var
(
...
...
pkg/proxy/parsercmd.go
View file @
84f24370
...
...
@@ -5,7 +5,7 @@ import (
"regexp"
"strings"
"koko/pkg/utils"
"
github.com/jumpserver/
koko/pkg/utils"
)
var
ps1Pattern
=
regexp
.
MustCompile
(
`^\[?.*@.*\]?[\\$#]\s|mysql>\s`
)
...
...
pkg/proxy/proxy.go
View file @
84f24370
...
...
@@ -6,13 +6,13 @@ import (
"strings"
"time"
"koko/pkg/config"
"koko/pkg/i18n"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/service"
"koko/pkg/srvconn"
"koko/pkg/utils"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/i18n"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/srvconn"
"
github.com/jumpserver/
koko/pkg/utils"
)
type
ProxyServer
struct
{
...
...
pkg/proxy/recorder.go
View file @
84f24370
...
...
@@ -8,10 +8,10 @@ import (
"strings"
"time"
"koko/pkg/common"
"koko/pkg/config"
"koko/pkg/logger"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
)
func
NewCommandRecorder
(
sid
string
)
(
recorder
*
CommandRecorder
)
{
...
...
pkg/proxy/recorderstorage/azure.go
View file @
84f24370
...
...
@@ -8,7 +8,7 @@ import (
"github.com/Azure/azure-storage-blob-go/azblob"
"koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/logger"
)
type
AzureReplayStorage
struct
{
...
...
pkg/proxy/recorderstorage/es.go
View file @
84f24370
...
...
@@ -7,8 +7,8 @@ import (
"github.com/elastic/go-elasticsearch"
"koko/pkg/logger"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
)
type
ESCommandStorage
struct
{
...
...
pkg/proxy/recorderstorage/file.go
View file @
84f24370
...
...
@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/model"
)
func
NewFileCommandStorage
(
name
string
)
(
storage
*
FileCommandStorage
,
err
error
)
{
...
...
pkg/proxy/recorderstorage/oss.go
View file @
84f24370
...
...
@@ -3,7 +3,7 @@ package recorderstorage
import
(
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/logger"
)
type
OSSReplayStorage
struct
{
...
...
pkg/proxy/recorderstorage/s3.go
View file @
84f24370
...
...
@@ -8,7 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/logger"
)
type
S3ReplayStorage
struct
{
...
...
pkg/proxy/recorderstorage/server.go
View file @
84f24370
...
...
@@ -4,8 +4,8 @@ import (
"path/filepath"
"strings"
"koko/pkg/model"
"koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/service"
)
type
ServerCommandStorage
struct
{
...
...
pkg/proxy/sessmanager.go
View file @
84f24370
...
...
@@ -4,11 +4,11 @@ import (
"sync"
"time"
"koko/pkg/i18n"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/service"
"koko/pkg/utils"
"
github.com/jumpserver/
koko/pkg/i18n"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/utils"
)
var
sessionMap
=
make
(
map
[
string
]
*
SwitchSession
)
...
...
pkg/proxy/switch.go
View file @
84f24370
...
...
@@ -8,12 +8,12 @@ import (
uuid
"github.com/satori/go.uuid"
"koko/pkg/config"
"koko/pkg/i18n"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/srvconn"
"koko/pkg/utils"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/i18n"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/srvconn"
"
github.com/jumpserver/
koko/pkg/utils"
)
func
NewSwitchSession
(
p
*
ProxyServer
)
(
sw
*
SwitchSession
)
{
...
...
pkg/proxy/transport.go
View file @
84f24370
...
...
@@ -3,7 +3,7 @@ package proxy
import
(
"io"
"koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/logger"
)
type
Transport
interface
{
...
...
pkg/proxy/util.go
View file @
84f24370
...
...
@@ -3,9 +3,9 @@ package proxy
import
(
"strings"
"koko/pkg/config"
"koko/pkg/model"
storage
"koko/pkg/proxy/recorderstorage"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/model"
storage
"
github.com/jumpserver/
koko/pkg/proxy/recorderstorage"
)
type
ReplayStorage
interface
{
...
...
pkg/service/accesskey.go
View file @
84f24370
...
...
@@ -8,9 +8,9 @@ import (
"path"
"strings"
"koko/pkg/common"
"koko/pkg/config"
"koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/logger"
)
var
(
...
...
pkg/service/assets.go
View file @
84f24370
...
...
@@ -3,8 +3,8 @@ package service
import
(
"fmt"
"koko/pkg/logger"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
)
func
GetSystemUserAssetAuthInfo
(
systemUserID
,
assetID
string
)
(
info
model
.
SystemUserAuthInfo
)
{
...
...
pkg/service/init.go
View file @
84f24370
...
...
@@ -7,9 +7,9 @@ import (
"path/filepath"
"time"
"koko/pkg/common"
"koko/pkg/config"
"koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/logger"
)
var
client
=
common
.
NewClient
(
30
,
""
)
...
...
pkg/service/perms.go
View file @
84f24370
...
...
@@ -3,8 +3,8 @@ package service
import
(
"fmt"
"koko/pkg/logger"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
)
func
GetUserAssets
(
userID
,
cachePolicy
string
)
(
assets
model
.
AssetList
)
{
...
...
pkg/service/terminal.go
View file @
84f24370
...
...
@@ -3,8 +3,8 @@ package service
import
(
"fmt"
"koko/pkg/logger"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
)
func
RegisterTerminal
(
name
,
token
,
comment
string
)
(
res
model
.
Terminal
)
{
...
...
pkg/service/users.go
View file @
84f24370
...
...
@@ -5,8 +5,8 @@ import (
"github.com/pkg/errors"
"koko/pkg/logger"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
)
type
AuthResp
struct
{
...
...
pkg/srvconn/connmanager.go
View file @
84f24370
package
srvconn
import
(
"koko/pkg/service"
"
github.com/jumpserver/
koko/pkg/service"
"encoding/json"
"errors"
"fmt"
...
...
@@ -12,8 +12,8 @@ import (
gossh
"golang.org/x/crypto/ssh"
"koko/pkg/logger"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
)
var
(
...
...
pkg/srvconn/sshconn.go
View file @
84f24370
...
...
@@ -7,7 +7,7 @@ import (
gossh
"golang.org/x/crypto/ssh"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/model"
)
type
ServerSSHConnection
struct
{
...
...
pkg/srvconn/telnetconn.go
View file @
84f24370
...
...
@@ -10,8 +10,8 @@ import (
gossh
"golang.org/x/crypto/ssh"
"koko/pkg/logger"
"koko/pkg/model"
"
github.com/jumpserver/
koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/model"
)
const
(
...
...
pkg/sshd/hostkey.go
View file @
84f24370
...
...
@@ -7,7 +7,7 @@ import (
"golang.org/x/crypto/ssh"
"koko/pkg/common"
"
github.com/jumpserver/
koko/pkg/common"
)
type
HostKey
struct
{
...
...
pkg/sshd/server.go
View file @
84f24370
...
...
@@ -5,10 +5,10 @@ import (
"github.com/gliderlabs/ssh"
"koko/pkg/auth"
"koko/pkg/config"
"koko/pkg/handler"
"koko/pkg/logger"
"
github.com/jumpserver/
koko/pkg/auth"
"
github.com/jumpserver/
koko/pkg/config"
"
github.com/jumpserver/
koko/pkg/handler"
"
github.com/jumpserver/
koko/pkg/logger"
)
var
sshServer
*
ssh
.
Server
...
...
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