Skip to content

Commit

Permalink
change package path
Browse files Browse the repository at this point in the history
  • Loading branch information
ffdfgdfg committed Jan 8, 2020
1 parent 1893828 commit 6c7ac59
Show file tree
Hide file tree
Showing 51 changed files with 153 additions and 152 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.npc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM golang as builder
WORKDIR /go/src/github.com/cnlh/nps
WORKDIR /go/src/ehang.io/nps
COPY . .
RUN go get -d -v ./...
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/npc/npc.go

FROM scratch
COPY --from=builder /go/src/github.com/cnlh/nps/npc /
COPY --from=builder /go/src/ehang.io/nps/npc /
VOLUME /conf
ENTRYPOINT ["/npc"]
6 changes: 3 additions & 3 deletions Dockerfile.nps
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang as builder
WORKDIR /go/src/github.com/cnlh/nps
WORKDIR /go/src/ehang.io/nps
COPY . .
RUN go get -d -v ./...
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/nps/nps.go

FROM scratch
COPY --from=builder /go/src/github.com/cnlh/nps/nps /
COPY --from=builder /go/src/github.com/cnlh/nps/web /web
COPY --from=builder /go/src/ehang.io/nps/nps /
COPY --from=builder /go/src/ehang.io/nps/web /web
VOLUME /conf
CMD ["/nps"]
16 changes: 8 additions & 8 deletions bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import (
"sync"
"time"

"ehang.io/nps/lib/common"
"ehang.io/nps/lib/conn"
"ehang.io/nps/lib/crypt"
"ehang.io/nps/lib/file"
"ehang.io/nps/lib/mux"
"ehang.io/nps/lib/version"
"ehang.io/nps/server/connection"
"ehang.io/nps/server/tool"
"github.com/astaxie/beego"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/conn"
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/lib/file"
"github.com/cnlh/nps/lib/mux"
"github.com/cnlh/nps/lib/version"
"github.com/cnlh/nps/server/connection"
"github.com/cnlh/nps/server/tool"
)

type Client struct {
Expand Down
8 changes: 4 additions & 4 deletions build.android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ git checkout v1.2.0
go install -v ./cmd/fyne
#fyne package -os android fyne.io/fyne/cmd/hello
echo "fyne install success"
mkdir -p /go/src/github.com/cnlh/nps
cp -R /app/* /go/src/github.com/cnlh/nps
cd /go/src/github.com/cnlh/nps
mkdir -p /go/src/ehang.io/nps
cp -R /app/* /go/src/ehang.io/nps
cd /go/src/ehang.io/nps
#go get -u fyne.io/fyne fyne.io/fyne/cmd/fyne
rm cmd/npc/sdk.go
#go get -u ./...
#go mod tidy
#rm -rf /go/src/golang.org/x/mobile
echo "tidy success"
cd /go/src/github.com/cnlh/nps
cd /go/src/ehang.io/nps
go mod vendor
cd vendor
cp -R * /go/src
Expand Down
11 changes: 6 additions & 5 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"github.com/astaxie/beego/logs"
"github.com/xtaci/kcp-go"

"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/config"
"github.com/cnlh/nps/lib/conn"
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/lib/mux"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/config"
"ehang.io/nps/lib/conn"
"ehang.io/nps/lib/crypt"
"ehang.io/nps/lib/mux"
)

type TRPClient struct {
Expand Down Expand Up @@ -44,6 +44,7 @@ func NewRPClient(svraddr string, vKey string, bridgeConnType string, proxyUrl st

var NowStatus int
var CloseClient bool

//start
func (s *TRPClient) Start() {
CloseClient = false
Expand Down
10 changes: 5 additions & 5 deletions client/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
"strings"
"time"

"ehang.io/nps/lib/common"
"ehang.io/nps/lib/config"
"ehang.io/nps/lib/conn"
"ehang.io/nps/lib/crypt"
"ehang.io/nps/lib/version"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/config"
"github.com/cnlh/nps/lib/conn"
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/lib/version"
"github.com/xtaci/kcp-go"
"golang.org/x/net/proxy"
)
Expand Down
6 changes: 3 additions & 3 deletions client/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strings"
"time"

"ehang.io/nps/lib/conn"
"ehang.io/nps/lib/file"
"ehang.io/nps/lib/sheap"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/lib/conn"
"github.com/cnlh/nps/lib/file"
"github.com/cnlh/nps/lib/sheap"
"github.com/pkg/errors"
)

Expand Down
14 changes: 7 additions & 7 deletions client/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
"sync"
"time"

"ehang.io/nps/lib/common"
"ehang.io/nps/lib/config"
"ehang.io/nps/lib/conn"
"ehang.io/nps/lib/crypt"
"ehang.io/nps/lib/file"
"ehang.io/nps/lib/mux"
"ehang.io/nps/server/proxy"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/config"
"github.com/cnlh/nps/lib/conn"
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/lib/file"
"github.com/cnlh/nps/lib/mux"
"github.com/cnlh/nps/server/proxy"
"github.com/xtaci/kcp-go"
)

Expand Down
2 changes: 1 addition & 1 deletion client/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/cnlh/nps/lib/common"
"ehang.io/nps/lib/common"
)

func RegisterLocalIp(server string, vKey string, tp string, proxyUrl string, hour int) {
Expand Down
12 changes: 6 additions & 6 deletions cmd/npc/npc.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package main

import (
"ehang.io/nps/client"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/config"
"ehang.io/nps/lib/file"
"ehang.io/nps/lib/install"
"ehang.io/nps/lib/version"
"flag"
"fmt"
"github.com/astaxie/beego/logs"
"github.com/ccding/go-stun/stun"
"github.com/cnlh/nps/client"
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/config"
"github.com/cnlh/nps/lib/file"
"github.com/cnlh/nps/lib/install"
"github.com/cnlh/nps/lib/version"
"github.com/kardianos/service"
"os"
"runtime"
Expand Down
6 changes: 3 additions & 3 deletions cmd/npc/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package main

import (
"C"
"ehang.io/nps/client"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/version"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/client"
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/version"
)

var cl *client.TRPClient
Expand Down
20 changes: 10 additions & 10 deletions cmd/nps/nps.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package main

import (
"ehang.io/nps/lib/install"
"flag"
"github.com/cnlh/nps/lib/install"
"log"
"os"
"path/filepath"
"runtime"
"strings"

"ehang.io/nps/lib/common"
"ehang.io/nps/lib/crypt"
"ehang.io/nps/lib/daemon"
"ehang.io/nps/lib/file"
"ehang.io/nps/lib/version"
"ehang.io/nps/server"
"ehang.io/nps/server/connection"
"ehang.io/nps/server/tool"
"github.com/astaxie/beego"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/lib/daemon"
"github.com/cnlh/nps/lib/file"
"github.com/cnlh/nps/lib/version"
"github.com/cnlh/nps/server"
"github.com/cnlh/nps/server/connection"
"github.com/cnlh/nps/server/tool"

"github.com/cnlh/nps/web/routers"
"ehang.io/nps/web/routers"
"github.com/kardianos/service"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cnlh/nps
module ehang.io/nps

go 1.13

Expand Down
8 changes: 4 additions & 4 deletions gui/npc/npc.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package main

import (
"ehang.io/nps/client"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/daemon"
"ehang.io/nps/lib/version"
"fmt"
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/layout"
"fyne.io/fyne/widget"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/client"
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/daemon"
"github.com/cnlh/nps/lib/version"
"io/ioutil"
"os"
"path"
Expand Down
2 changes: 1 addition & 1 deletion lib/common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"strings"
"sync"

"github.com/cnlh/nps/lib/crypt"
"ehang.io/nps/lib/crypt"
)

//Get the corresponding IP address through domain name
Expand Down
6 changes: 3 additions & 3 deletions lib/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"regexp"
"strings"

"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/file"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/file"
)

type CommonConfig struct {
Expand Down Expand Up @@ -241,7 +241,7 @@ func dealTunnel(s string) *file.Tunnel {
t.StripPre = item[1]
case "multi_account":
t.MultiAccount = &file.MultiAccount{}
if common.FileExists(item[1]){
if common.FileExists(item[1]) {
if b, err := common.ReadAllFromFile(item[1]); err != nil {
panic(err)
} else {
Expand Down
12 changes: 6 additions & 6 deletions lib/conn/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package conn
import (
"bufio"
"bytes"
"ehang.io/nps/lib/goroutine"
"encoding/binary"
"encoding/json"
"errors"
"github.com/astaxie/beego/logs"
"github.com/cnlh/nps/lib/goroutine"
"io"
"net"
"net/http"
Expand All @@ -16,11 +16,11 @@ import (
"strings"
"time"

"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/lib/file"
"github.com/cnlh/nps/lib/mux"
"github.com/cnlh/nps/lib/rate"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/crypt"
"ehang.io/nps/lib/file"
"ehang.io/nps/lib/mux"
"ehang.io/nps/lib/rate"
"github.com/xtaci/kcp-go"
)

Expand Down
2 changes: 1 addition & 1 deletion lib/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
"strings"

"github.com/cnlh/nps/lib/common"
"ehang.io/nps/lib/common"
)

func InitDaemon(f string, runPath string, pidPath string) {
Expand Down
2 changes: 1 addition & 1 deletion lib/daemon/reload.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"path/filepath"
"syscall"

"ehang.io/nps/lib/common"
"github.com/astaxie/beego"
"github.com/cnlh/nps/lib/common"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions lib/file/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"strings"
"sync"

"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/lib/rate"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/crypt"
"ehang.io/nps/lib/rate"
)

type DbUtils struct {
Expand Down
4 changes: 2 additions & 2 deletions lib/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"sync"
"sync/atomic"

"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/rate"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/rate"
)

func NewJsonDb(runPath string) *JsonDb {
Expand Down
2 changes: 1 addition & 1 deletion lib/file/obj.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync/atomic"
"time"

"github.com/cnlh/nps/lib/rate"
"ehang.io/nps/lib/rate"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions lib/goroutine/pool.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package goroutine

import (
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/file"
"ehang.io/nps/lib/common"
"ehang.io/nps/lib/file"
"github.com/panjf2000/ants/v2"
"io"
"net"
Expand Down
Loading

0 comments on commit 6c7ac59

Please sign in to comment.