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
9cdf0cb7
Commit
9cdf0cb7
authored
Sep 25, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改url地址
parent
c32db87d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
23 deletions
+36
-23
Dockerfile
Dockerfile
+6
-6
file_manager.html
cmd/templates/elfinder/file_manager.html
+11
-11
server.go
pkg/httpd/server.go
+18
-6
init.go
pkg/service/init.go
+1
-0
No files found.
Dockerfile
View file @
9cdf0cb7
FROM
golang:1.12-alpine as stage-build
LABEL
stage=stage-build
WORKDIR
/opt/
coc
o
WORKDIR
/opt/
kok
o
ARG
GOPROXY
ENV
GOPROXY=$GOPROXY
ENV
GO111MODULE=on
...
...
@@ -13,11 +13,11 @@ COPY . .
RUN
cd
cmd
&&
go build koko.go
FROM
alpine
WORKDIR
/opt/
coc
o/
COPY
--from=stage-build /opt/
coc
o/cmd/koko .
COPY
--from=stage-build /opt/
coc
o/cmd/locale/ locale
COPY
--from=stage-build /opt/
coc
o/cmd/static/ static
COPY
--from=stage-build /opt/
coc
o/cmd/templates/ templates
WORKDIR
/opt/
kok
o/
COPY
--from=stage-build /opt/
kok
o/cmd/koko .
COPY
--from=stage-build /opt/
kok
o/cmd/locale/ locale
COPY
--from=stage-build /opt/
kok
o/cmd/static/ static
COPY
--from=stage-build /opt/
kok
o/cmd/templates/ templates
COPY
cmd/config_example.yml .
COPY
entrypoint.sh .
RUN
chmod
755 ./entrypoint.sh
\
...
...
cmd/templates/elfinder/file_manager.html
View file @
9cdf0cb7
<html>
<body
style=
"margin: 0"
>
<script
type=
"text/javascript"
src=
"/
coc
o/static/js/jquery-2.1.1.js"
></script>
<script
type=
"text/javascript"
src=
"/
coc
o/static/js/jquery-ui-1.10.4.min.js"
></script>
<script
type=
"text/javascript"
src=
"/
coc
o/static/js/neffos.min.js"
></script>
<script
type=
"text/javascript"
src=
"/
coc
o/static/plugins/elfinder/elfinder.full.js"
></script>
<script
type=
"text/javascript"
src=
"/
coc
o/static/plugins/elfinder/i18n/elfinder.pl.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/
coc
o/static/js/jquery-ui-1.10.4.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/
coc
o/static/plugins/elfinder/css/elfinder.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/
coc
o/static/plugins/elfinder/css/theme-gray.css"
>
<script
type=
"text/javascript"
src=
"/
kok
o/static/js/jquery-2.1.1.js"
></script>
<script
type=
"text/javascript"
src=
"/
kok
o/static/js/jquery-ui-1.10.4.min.js"
></script>
<script
type=
"text/javascript"
src=
"/
kok
o/static/js/neffos.min.js"
></script>
<script
type=
"text/javascript"
src=
"/
kok
o/static/plugins/elfinder/elfinder.full.js"
></script>
<script
type=
"text/javascript"
src=
"/
kok
o/static/plugins/elfinder/i18n/elfinder.pl.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/
kok
o/static/js/jquery-ui-1.10.4.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/
kok
o/static/plugins/elfinder/css/elfinder.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"/
kok
o/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
:
""
;
var
wsURL
=
scheme
+
"://"
+
document
.
location
.
hostname
+
port
+
"/
socket.io
/"
;
var
wsURL
=
scheme
+
"://"
+
document
.
location
.
hostname
+
port
+
"/
koko/ws
/"
;
let
interval
;
dial
(
wsURL
,
{
"elfinder"
:
{
...
...
@@ -57,7 +57,7 @@
},
customData
:
{
'sid'
:
sid
},
width
:
'100%'
,
url
:
'/
coc
o/elfinder/sftp/connector/{{.}}/'
,
url
:
'/
kok
o/elfinder/sftp/connector/{{.}}/'
,
resizable
:
false
,
lang
:
'pl'
,
requestType
:
'get'
,
...
...
@@ -105,7 +105,7 @@
}
if
(
lng
!==
'en'
)
{
$
.
ajax
({
url
:
'/
coc
o/static/plugins/elfinder/i18n'
+
'/elfinder.'
+
lng
+
'.js'
,
url
:
'/
kok
o/static/plugins/elfinder/i18n'
+
'/elfinder.'
+
lng
+
'.js'
,
cache
:
true
,
dataType
:
'script'
})
...
...
pkg/httpd/server.go
View file @
9cdf0cb7
...
...
@@ -86,13 +86,25 @@ func StartHTTPServer() {
router
:=
mux
.
NewRouter
()
fs
:=
http
.
FileServer
(
http
.
Dir
(
filepath
.
Join
(
conf
.
RootPath
,
"static"
)))
router
.
PathPrefix
(
"/coco/static/"
)
.
Handler
(
http
.
StripPrefix
(
"/coco/static/"
,
fs
))
router
.
Handle
(
"/socket.io/"
,
sshWs
)
router
.
HandleFunc
(
"/coco/elfinder/sftp/{host}/"
,
AuthDecorator
(
sftpHostFinder
))
router
.
HandleFunc
(
"/coco/elfinder/sftp/"
,
AuthDecorator
(
sftpFinder
))
router
.
HandleFunc
(
"/coco/elfinder/sftp/connector/{host}/"
,
AuthDecorator
(
sftpHostConnectorView
))
.
Methods
(
"GET"
,
"POST"
)
subRouter
:=
router
.
PathPrefix
(
"/koko/"
)
.
Subrouter
()
subRouter
.
PathPrefix
(
"/static/"
)
.
Handler
(
http
.
StripPrefix
(
"/koko/static/"
,
fs
))
subRouter
.
Handle
(
"/ws/"
,
sshWs
)
elfinderRouter
:=
subRouter
.
PathPrefix
(
"/elfinder/"
)
.
Subrouter
()
elfinderRouter
.
HandleFunc
(
"/sftp/{host}/"
,
AuthDecorator
(
sftpHostFinder
))
elfinderRouter
.
HandleFunc
(
"/sftp/"
,
AuthDecorator
(
sftpFinder
))
elfinderRouter
.
HandleFunc
(
"/sftp/connector/{host}/"
,
AuthDecorator
(
sftpHostConnectorView
),
)
.
Methods
(
"GET"
,
"POST"
)
//router.PathPrefix("/coco/static/").Handler(http.StripPrefix("/coco/static/", fs))
//router.Handle("/socket.io/", sshWs)
//router.HandleFunc("/coco/elfinder/sftp/{host}/", AuthDecorator(sftpHostFinder))
//router.HandleFunc("/coco/elfinder/sftp/", AuthDecorator(sftpFinder))
//router.HandleFunc("/coco/elfinder/sftp/connector/{host}/",
// AuthDecorator(sftpHostConnectorView)).Methods("GET", "POST")
addr
:=
net
.
JoinHostPort
(
conf
.
BindHost
,
conf
.
HTTPPort
)
logger
.
Debug
(
"Start HTTP server at "
,
addr
)
...
...
pkg/service/init.go
View file @
9cdf0cb7
...
...
@@ -102,6 +102,7 @@ func KeepSyncConfigWithServer(ctx context.Context) {
select
{
case
<-
ctx
.
Done
()
:
logger
.
Info
(
"Sync config with server exit."
)
return
case
<-
ticker
.
C
:
err
:=
LoadConfigFromServer
()
if
err
!=
nil
{
...
...
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