Commit 84f24370 authored by Eric's avatar Eric

rename path

parent e1b0e42c
......@@ -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",
......
......@@ -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 := coco
DIRNAME := cocogo
NAME := koko
DIRNAME := kokodir
BASEPATH := $(shell pwd)
CGO_ENABLED = 0
GOCMD = go
GOBUILD = $(GOCMD) build
SOFTWARENAME=$(NAME)-$(VERSION)
COCOSRCFILE= coco.go
KOKOSRCFILE= koko.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) $(COCOSRCFILE)
GOOS=$@ GOARCH=amd64 go build -o $(NAME) $(KOKOSRCFILE)
cp -f $(NAME) $(DIRNAME)
tar czvf $(BUILDDIR)/$(SOFTWARENAME)-$@-amd64.tar.gz $(DIRNAME)
.PHONY: docker
docker:
@echo "build docker images"
docker build -t cocogo --build-arg http_proxy=$(http_proxy) --build-arg https_proxy=$(https_proxy) $(BASEPATH)/../
docker build -t koko --build-arg http_proxy=$(http_proxy) --build-arg https_proxy=$(https_proxy) $(BASEPATH)/../
.PHONY: clean
clean:
......
NAME: coco2
BOOTSTRAP_TOKEN: PleaseChangeMe
NAME: coco3
BOOTSTRAP_TOKEN: uuvdKUxvhW3v
CORE_HOST: http://127.0.0.1:8080
LOG_LEVEL: INFO
package main
import (
"koko/pkg/coco"
"github.com/jumpserver/koko/pkg/koko"
)
func main() {
coco.RunForever()
koko.RunForever()
}
......@@ -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.")
......
......@@ -5,7 +5,7 @@ import (
"github.com/gliderlabs/ssh"
"koko/pkg/model"
"github.com/jumpserver/koko/pkg/model"
)
type contextKey struct {
......
......@@ -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", "coco-client")
req.Header.Set("user-Agent", "koko-client")
c.setAuthHeader(req)
}
......
......@@ -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
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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) {
......
......@@ -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 {
......
......@@ -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)}
......
package httpd
import "koko/pkg/model"
import "github.com/jumpserver/koko/pkg/model"
type WebContext struct {
User *model.User
......
......@@ -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 {
......
......@@ -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连接后触发
......
......@@ -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("/coco/elfinder/sftp/{host}/", AuthDecorator(sftpHostFinder))
router.HandleFunc("/coco/elfinder/sftp/", AuthDecorator(sftpFinder))
router.HandleFunc("/coco/elfinder/sftp/connector/{host}/",
router.HandleFunc("/koko/elfinder/sftp/{host}/", AuthDecorator(sftpHostFinder))
router.HandleFunc("/koko/elfinder/sftp/", AuthDecorator(sftpFinder))
router.HandleFunc("/koko/elfinder/sftp/connector/{host}/",
AuthDecorator(sftpHostConnectorView)).Methods("GET", "POST")
addr := net.JoinHostPort(conf.BindHost, conf.HTTPPort)
......
......@@ -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 (
......
......@@ -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", "coco")
gotext.Configure(localePath, "zh_CN", "koko")
} else {
gotext.Configure(localePath, "en_US", "coco")
gotext.Configure(localePath, "en_US", "koko")
}
}
......
......@@ -8,7 +8,7 @@ import (
func TestT(t *testing.T) {
//loc := gotext.NewLocale("./locale", "zh_CN")
//loc.AddDomain("coco")
//loc.AddDomain("koko")
fmt.Println(T("Welcome to use Jumpserver open source fortress system"))
}
......
package coco
package koko
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"
......
package coco
package koko
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() {
......
......@@ -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", "coco.log")
logFilePath := path.Join(conf.RootPath, "logs", "koko.log")
logDirPath := path.Dir(logFilePath)
if common.FileExists(logDirPath) {
err := os.MkdirAll(logDirPath, os.ModePerm)
......
......@@ -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 (
......
......@@ -5,7 +5,7 @@ import (
"regexp"
"strings"
"koko/pkg/utils"
"github.com/jumpserver/koko/pkg/utils"
)
var ps1Pattern = regexp.MustCompile(`^\[?.*@.*\]?[\\$#]\s|mysql>\s`)
......
......@@ -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 {
......
......@@ -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) {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"koko/pkg/model"
"github.com/jumpserver/koko/pkg/model"
)
func NewFileCommandStorage(name string) (storage *FileCommandStorage, err error) {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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)
......
......@@ -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) {
......
......@@ -3,7 +3,7 @@ package proxy
import (
"io"
"koko/pkg/logger"
"github.com/jumpserver/koko/pkg/logger"
)
type Transport interface {
......
......@@ -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 {
......
......@@ -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 (
......
......@@ -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) {
......
......@@ -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, "")
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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 {
......
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 (
......
......@@ -7,7 +7,7 @@ import (
gossh "golang.org/x/crypto/ssh"
"koko/pkg/model"
"github.com/jumpserver/koko/pkg/model"
)
type ServerSSHConnection struct {
......
......@@ -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 (
......
......@@ -7,7 +7,7 @@ import (
"golang.org/x/crypto/ssh"
"koko/pkg/common"
"github.com/jumpserver/koko/pkg/common"
)
type HostKey struct {
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment