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
31a4a167
Unverified
Commit
31a4a167
authored
Jul 18, 2019
by
老广
Committed by
GitHub
Jul 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #42 from jumpserver/dev
Dev
parents
b9df19f4
458b7cd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
15 deletions
+17
-15
README.md
README.md
+4
-0
file_manager.html
cmd/templates/elfinder/file_manager.html
+7
-7
server.go
pkg/httpd/server.go
+6
-8
No files found.
README.md
View file @
31a4a167
...
...
@@ -3,6 +3,10 @@
koko是golang版本的的coco;重构了coco的SSH/SFTP服务和web terminal服务。
## 注意
Koko的 web socket库不再使用socket.io,因为go里没有稳定的,替换成了
[
neffos
](
https://github.com/kataras/neffos
)
,
所以luna不再和原来兼容,请下载luna的koko版本
## 主要功能
...
...
cmd/templates/elfinder/file_manager.html
View file @
31a4a167
<html>
<body
style=
"margin: 0"
>
<script
type=
"text/javascript"
src=
"/static/js/jquery-2.1.1.js"
></script>
<script
type=
"text/javascript"
src=
"/static/js/jquery-ui-1.10.4.min.js"
></script>
<script
type=
"text/javascript"
src=
"/static/js/neffos.min.js"
></script>
<script
type=
"text/javascript"
src=
"/static/plugins/elfinder/elfinder.full.js"
></script>
<script
type=
"text/javascript"
src=
"/static/plugins/elfinder/i18n/elfinder.pl.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/static/plugins/elfinder/css/elfinder.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/static/plugins/elfinder/css/theme-gray.css"
>
<script
type=
"text/javascript"
src=
"/
coco/
static/js/jquery-2.1.1.js"
></script>
<script
type=
"text/javascript"
src=
"/
coco/
static/js/jquery-ui-1.10.4.min.js"
></script>
<script
type=
"text/javascript"
src=
"/
coco/
static/js/neffos.min.js"
></script>
<script
type=
"text/javascript"
src=
"/
coco/
static/plugins/elfinder/elfinder.full.js"
></script>
<script
type=
"text/javascript"
src=
"/
coco/
static/plugins/elfinder/i18n/elfinder.pl.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/
coco/
static/plugins/elfinder/css/elfinder.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/
coco/
static/plugins/elfinder/css/theme-gray.css"
>
<script
type=
"text/javascript"
charset=
"utf-8"
>
var
scheme
=
document
.
location
.
protocol
==
"https:"
?
"wss"
:
"ws"
;
var
port
=
document
.
location
.
port
?
":"
+
document
.
location
.
port
:
""
;
...
...
pkg/httpd/server.go
View file @
31a4a167
...
...
@@ -19,7 +19,7 @@ var (
var
wsEvents
=
neffos
.
Namespaces
{
"ssh"
:
neffos
.
Events
{
neffos
.
OnNamespaceConnected
:
OnNamespaceConnected
,
neffos
.
OnNamespaceConnected
:
OnNamespaceConnected
,
neffos
.
OnNamespaceDisconnect
:
OnNamespaceDisconnect
,
neffos
.
OnRoomJoined
:
func
(
c
*
neffos
.
NSConn
,
msg
neffos
.
Message
)
error
{
return
nil
...
...
@@ -28,14 +28,14 @@ var wsEvents = neffos.Namespaces{
return
nil
},
"data"
:
OnDataHandler
,
"data"
:
OnDataHandler
,
"resize"
:
OnResizeHandler
,
"host"
:
OnHostHandler
,
"host"
:
OnHostHandler
,
"logout"
:
OnLogoutHandler
,
"token"
:
OnTokenHandler
,
"token"
:
OnTokenHandler
,
},
"elfinder"
:
neffos
.
Events
{
neffos
.
OnNamespaceConnected
:
OnELFinderConnect
,
neffos
.
OnNamespaceConnected
:
OnELFinderConnect
,
neffos
.
OnNamespaceDisconnect
:
OnELFinderDisconnect
,
},
}
...
...
@@ -51,7 +51,7 @@ func StartHTTPServer() {
router
:=
mux
.
NewRouter
()
fs
:=
http
.
FileServer
(
http
.
Dir
(
filepath
.
Join
(
conf
.
RootPath
,
"static"
)))
router
.
PathPrefix
(
"/static/"
)
.
Handler
(
http
.
StripPrefix
(
"/static/"
,
fs
))
router
.
PathPrefix
(
"/
coco/
static/"
)
.
Handler
(
http
.
StripPrefix
(
"/static/"
,
fs
))
router
.
Handle
(
"/socket.io/"
,
sshWs
)
router
.
HandleFunc
(
"/coco/elfinder/sftp/{host}/"
,
AuthDecorator
(
sftpHostFinder
))
...
...
@@ -68,5 +68,3 @@ func StartHTTPServer() {
func
StopHTTPServer
()
{
_
=
httpServer
.
Close
()
}
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