diff --git a/cmd/main-server.go b/cmd/main-server.go index 171bb527..1e1a2e5d 100644 --- a/cmd/main-server.go +++ b/cmd/main-server.go @@ -20,15 +20,15 @@ import ( "github.com/google/uuid" "github.com/gorilla/mux" - "github.com/scripthaus-dev/sh2-server/pkg/cmdrunner" - "github.com/scripthaus-dev/sh2-server/pkg/pcloud" - "github.com/scripthaus-dev/sh2-server/pkg/remote" - "github.com/scripthaus-dev/sh2-server/pkg/rtnstate" - "github.com/scripthaus-dev/sh2-server/pkg/scbase" - "github.com/scripthaus-dev/sh2-server/pkg/scpacket" - "github.com/scripthaus-dev/sh2-server/pkg/scws" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" - "github.com/scripthaus-dev/sh2-server/pkg/wsshell" + "github.com/commandlinedev/prompt-server/pkg/cmdrunner" + "github.com/commandlinedev/prompt-server/pkg/pcloud" + "github.com/commandlinedev/prompt-server/pkg/remote" + "github.com/commandlinedev/prompt-server/pkg/rtnstate" + "github.com/commandlinedev/prompt-server/pkg/scbase" + "github.com/commandlinedev/prompt-server/pkg/scpacket" + "github.com/commandlinedev/prompt-server/pkg/scws" + "github.com/commandlinedev/prompt-server/pkg/sstore" + "github.com/commandlinedev/prompt-server/pkg/wsshell" ) type WebFnType = func(http.ResponseWriter, *http.Request) diff --git a/go.mod b/go.mod index 5c2dade3..3904a9e8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/scripthaus-dev/sh2-server +module github.com/commandlinedev/prompt-server go 1.18 @@ -13,7 +13,7 @@ require ( github.com/jmoiron/sqlx v1.3.5 github.com/mattn/go-sqlite3 v1.14.14 github.com/sawka/txwrap v0.1.2 - github.com/scripthaus-dev/mshell v0.0.0 + github.com/commandlinedev/apishell v0.0.0 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/mod v0.5.1 golang.org/x/sys v0.0.0-20220412211240-33da011f77ad diff --git a/pkg/cmdrunner/cmdrunner.go b/pkg/cmdrunner/cmdrunner.go index 47dfe885..d0f40778 100644 --- a/pkg/cmdrunner/cmdrunner.go +++ b/pkg/cmdrunner/cmdrunner.go @@ -18,17 +18,17 @@ import ( "unicode" "github.com/google/uuid" - "github.com/scripthaus-dev/mshell/pkg/base" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/mshell/pkg/shexec" - "github.com/scripthaus-dev/sh2-server/pkg/comp" - "github.com/scripthaus-dev/sh2-server/pkg/pcloud" - "github.com/scripthaus-dev/sh2-server/pkg/remote" - "github.com/scripthaus-dev/sh2-server/pkg/remote/openai" - "github.com/scripthaus-dev/sh2-server/pkg/scbase" - "github.com/scripthaus-dev/sh2-server/pkg/scpacket" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/apishell/pkg/base" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/apishell/pkg/shexec" + "github.com/commandlinedev/prompt-server/pkg/comp" + "github.com/commandlinedev/prompt-server/pkg/pcloud" + "github.com/commandlinedev/prompt-server/pkg/remote" + "github.com/commandlinedev/prompt-server/pkg/remote/openai" + "github.com/commandlinedev/prompt-server/pkg/scbase" + "github.com/commandlinedev/prompt-server/pkg/scpacket" + "github.com/commandlinedev/prompt-server/pkg/sstore" + "github.com/commandlinedev/prompt-server/pkg/utilfn" ) const ( diff --git a/pkg/cmdrunner/resolver.go b/pkg/cmdrunner/resolver.go index ea83da11..64c264fd 100644 --- a/pkg/cmdrunner/resolver.go +++ b/pkg/cmdrunner/resolver.go @@ -9,9 +9,9 @@ import ( "strings" "github.com/google/uuid" - "github.com/scripthaus-dev/sh2-server/pkg/remote" - "github.com/scripthaus-dev/sh2-server/pkg/scpacket" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" + "github.com/commandlinedev/prompt-server/pkg/remote" + "github.com/commandlinedev/prompt-server/pkg/scpacket" + "github.com/commandlinedev/prompt-server/pkg/sstore" ) const ( diff --git a/pkg/cmdrunner/shparse.go b/pkg/cmdrunner/shparse.go index 12803925..8ca9853f 100644 --- a/pkg/cmdrunner/shparse.go +++ b/pkg/cmdrunner/shparse.go @@ -6,10 +6,10 @@ import ( "regexp" "strings" - "github.com/scripthaus-dev/mshell/pkg/shexec" - "github.com/scripthaus-dev/mshell/pkg/simpleexpand" - "github.com/scripthaus-dev/sh2-server/pkg/scpacket" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/apishell/pkg/shexec" + "github.com/commandlinedev/apishell/pkg/simpleexpand" + "github.com/commandlinedev/prompt-server/pkg/scpacket" + "github.com/commandlinedev/prompt-server/pkg/utilfn" "mvdan.cc/sh/v3/expand" "mvdan.cc/sh/v3/syntax" ) diff --git a/pkg/cmdrunner/termopts.go b/pkg/cmdrunner/termopts.go index 5b34dfa0..563690c3 100644 --- a/pkg/cmdrunner/termopts.go +++ b/pkg/cmdrunner/termopts.go @@ -5,11 +5,11 @@ import ( "strconv" "strings" - "github.com/scripthaus-dev/mshell/pkg/base" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/mshell/pkg/shexec" - "github.com/scripthaus-dev/sh2-server/pkg/remote" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" + "github.com/commandlinedev/apishell/pkg/base" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/apishell/pkg/shexec" + "github.com/commandlinedev/prompt-server/pkg/remote" + "github.com/commandlinedev/prompt-server/pkg/sstore" ) // PTERM=MxM,Mx25 diff --git a/pkg/comp/comp.go b/pkg/comp/comp.go index 8dc8f457..610043ae 100644 --- a/pkg/comp/comp.go +++ b/pkg/comp/comp.go @@ -11,10 +11,10 @@ import ( "unicode" "unicode/utf8" - "github.com/scripthaus-dev/mshell/pkg/simpleexpand" - "github.com/scripthaus-dev/sh2-server/pkg/shparse" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/apishell/pkg/simpleexpand" + "github.com/commandlinedev/prompt-server/pkg/shparse" + "github.com/commandlinedev/prompt-server/pkg/sstore" + "github.com/commandlinedev/prompt-server/pkg/utilfn" "mvdan.cc/sh/v3/syntax" ) diff --git a/pkg/comp/simplecomp.go b/pkg/comp/simplecomp.go index 2a225113..b094eb5f 100644 --- a/pkg/comp/simplecomp.go +++ b/pkg/comp/simplecomp.go @@ -6,9 +6,9 @@ import ( "sync" "github.com/google/uuid" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/sh2-server/pkg/remote" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/prompt-server/pkg/remote" + "github.com/commandlinedev/prompt-server/pkg/utilfn" ) var globalLock = &sync.Mutex{} diff --git a/pkg/pcloud/pcloud.go b/pkg/pcloud/pcloud.go index 40a5fe08..5d6c14bd 100644 --- a/pkg/pcloud/pcloud.go +++ b/pkg/pcloud/pcloud.go @@ -15,10 +15,10 @@ import ( "sync" "time" - "github.com/scripthaus-dev/sh2-server/pkg/dbutil" - "github.com/scripthaus-dev/sh2-server/pkg/rtnstate" - "github.com/scripthaus-dev/sh2-server/pkg/scbase" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" + "github.com/commandlinedev/prompt-server/pkg/dbutil" + "github.com/commandlinedev/prompt-server/pkg/rtnstate" + "github.com/commandlinedev/prompt-server/pkg/scbase" + "github.com/commandlinedev/prompt-server/pkg/sstore" ) const PCloudEndpoint = "https://api.getprompt.dev/central" diff --git a/pkg/pcloud/pclouddata.go b/pkg/pcloud/pclouddata.go index 4fd023c9..5cca7626 100644 --- a/pkg/pcloud/pclouddata.go +++ b/pkg/pcloud/pclouddata.go @@ -5,10 +5,10 @@ import ( "encoding/json" "fmt" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/sh2-server/pkg/remote" - "github.com/scripthaus-dev/sh2-server/pkg/rtnstate" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/prompt-server/pkg/remote" + "github.com/commandlinedev/prompt-server/pkg/rtnstate" + "github.com/commandlinedev/prompt-server/pkg/sstore" ) type NoTelemetryInputType struct { diff --git a/pkg/remote/openai/openai.go b/pkg/remote/openai/openai.go index 88075bf1..a2f646b5 100644 --- a/pkg/remote/openai/openai.go +++ b/pkg/remote/openai/openai.go @@ -6,8 +6,8 @@ import ( "io" openaiapi "github.com/sashabaranov/go-openai" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/prompt-server/pkg/sstore" ) // https://github.com/tiktoken-go/tokenizer diff --git a/pkg/remote/remote.go b/pkg/remote/remote.go index 76060f33..823e93bd 100644 --- a/pkg/remote/remote.go +++ b/pkg/remote/remote.go @@ -19,15 +19,15 @@ import ( "time" "github.com/armon/circbuf" + "github.com/commandlinedev/apishell/pkg/base" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/apishell/pkg/shexec" + "github.com/commandlinedev/apishell/pkg/statediff" + "github.com/commandlinedev/prompt-server/pkg/scbase" + "github.com/commandlinedev/prompt-server/pkg/scpacket" + "github.com/commandlinedev/prompt-server/pkg/sstore" "github.com/creack/pty" "github.com/google/uuid" - "github.com/scripthaus-dev/mshell/pkg/base" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/mshell/pkg/shexec" - "github.com/scripthaus-dev/mshell/pkg/statediff" - "github.com/scripthaus-dev/sh2-server/pkg/scbase" - "github.com/scripthaus-dev/sh2-server/pkg/scpacket" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" "golang.org/x/mod/semver" ) @@ -76,7 +76,7 @@ const ( func init() { if scbase.MShellVersion != base.MShellVersion { - panic(fmt.Sprintf("sh2-server mshell version must match '%s' vs '%s'", scbase.MShellVersion, base.MShellVersion)) + panic(fmt.Sprintf("prompt-server apishell version must match '%s' vs '%s'", scbase.MShellVersion, base.MShellVersion)) } } diff --git a/pkg/remote/updatequeue.go b/pkg/remote/updatequeue.go index 7b978e38..c93ae6f6 100644 --- a/pkg/remote/updatequeue.go +++ b/pkg/remote/updatequeue.go @@ -1,7 +1,7 @@ package remote import ( - "github.com/scripthaus-dev/mshell/pkg/base" + "github.com/commandlinedev/apishell/pkg/base" ) func startCmdWait(ck base.CommandKey) { diff --git a/pkg/rtnstate/rtnstate.go b/pkg/rtnstate/rtnstate.go index e882cab5..a220a7e5 100644 --- a/pkg/rtnstate/rtnstate.go +++ b/pkg/rtnstate/rtnstate.go @@ -7,11 +7,11 @@ import ( "strings" "github.com/alessio/shellescape" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/mshell/pkg/shexec" - "github.com/scripthaus-dev/mshell/pkg/simpleexpand" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/apishell/pkg/shexec" + "github.com/commandlinedev/apishell/pkg/simpleexpand" + "github.com/commandlinedev/prompt-server/pkg/sstore" + "github.com/commandlinedev/prompt-server/pkg/utilfn" "mvdan.cc/sh/v3/syntax" ) diff --git a/pkg/scbase/scbase.go b/pkg/scbase/scbase.go index 0c09faae..584abb1b 100644 --- a/pkg/scbase/scbase.go +++ b/pkg/scbase/scbase.go @@ -18,7 +18,7 @@ import ( "time" "github.com/google/uuid" - "github.com/scripthaus-dev/mshell/pkg/base" + "github.com/commandlinedev/apishell/pkg/base" "golang.org/x/mod/semver" "golang.org/x/sys/unix" ) diff --git a/pkg/scpacket/scpacket.go b/pkg/scpacket/scpacket.go index 3e2bf633..88255b9e 100644 --- a/pkg/scpacket/scpacket.go +++ b/pkg/scpacket/scpacket.go @@ -6,9 +6,9 @@ import ( "strings" "github.com/alessio/shellescape" - "github.com/scripthaus-dev/mshell/pkg/base" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" + "github.com/commandlinedev/apishell/pkg/base" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/prompt-server/pkg/sstore" ) const FeCommandPacketStr = "fecmd" diff --git a/pkg/scws/scws.go b/pkg/scws/scws.go index b61fabc8..57b1c65d 100644 --- a/pkg/scws/scws.go +++ b/pkg/scws/scws.go @@ -8,12 +8,12 @@ import ( "time" "github.com/google/uuid" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/sh2-server/pkg/mapqueue" - "github.com/scripthaus-dev/sh2-server/pkg/remote" - "github.com/scripthaus-dev/sh2-server/pkg/scpacket" - "github.com/scripthaus-dev/sh2-server/pkg/sstore" - "github.com/scripthaus-dev/sh2-server/pkg/wsshell" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/prompt-server/pkg/mapqueue" + "github.com/commandlinedev/prompt-server/pkg/remote" + "github.com/commandlinedev/prompt-server/pkg/scpacket" + "github.com/commandlinedev/prompt-server/pkg/sstore" + "github.com/commandlinedev/prompt-server/pkg/wsshell" ) const WSStatePacketChSize = 20 diff --git a/pkg/shparse/comp.go b/pkg/shparse/comp.go index f33e1ad5..28ddde7b 100644 --- a/pkg/shparse/comp.go +++ b/pkg/shparse/comp.go @@ -3,7 +3,7 @@ package shparse import ( "strings" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/prompt-server/pkg/utilfn" ) const ( diff --git a/pkg/shparse/extend.go b/pkg/shparse/extend.go index 487a3808..8da19810 100644 --- a/pkg/shparse/extend.go +++ b/pkg/shparse/extend.go @@ -5,7 +5,7 @@ import ( "unicode" "unicode/utf8" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/prompt-server/pkg/utilfn" ) var noEscChars []bool diff --git a/pkg/shparse/shparse.go b/pkg/shparse/shparse.go index d2e31827..e96fe3d9 100644 --- a/pkg/shparse/shparse.go +++ b/pkg/shparse/shparse.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/prompt-server/pkg/utilfn" ) // diff --git a/pkg/shparse/shparse_test.go b/pkg/shparse/shparse_test.go index 8ca32cc2..16c8a83a 100644 --- a/pkg/shparse/shparse_test.go +++ b/pkg/shparse/shparse_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/scripthaus-dev/sh2-server/pkg/utilfn" + "github.com/commandlinedev/prompt-server/pkg/utilfn" ) // $(ls f[*]); ./x diff --git a/pkg/sstore/dbops.go b/pkg/sstore/dbops.go index 4e03bb19..559fddb2 100644 --- a/pkg/sstore/dbops.go +++ b/pkg/sstore/dbops.go @@ -13,11 +13,11 @@ import ( "github.com/google/uuid" "github.com/jmoiron/sqlx" "github.com/sawka/txwrap" - "github.com/scripthaus-dev/mshell/pkg/base" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/mshell/pkg/shexec" - "github.com/scripthaus-dev/sh2-server/pkg/dbutil" - "github.com/scripthaus-dev/sh2-server/pkg/scbase" + "github.com/commandlinedev/apishell/pkg/base" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/apishell/pkg/shexec" + "github.com/commandlinedev/prompt-server/pkg/dbutil" + "github.com/commandlinedev/prompt-server/pkg/scbase" ) const HistoryCols = "h.historyid, h.ts, h.userid, h.sessionid, h.screenid, h.lineid, h.cmdid, h.haderror, h.cmdstr, h.remoteownerid, h.remoteid, h.remotename, h.ismetacmd, h.incognito, h.linenum" diff --git a/pkg/sstore/fileops.go b/pkg/sstore/fileops.go index c6d11828..61214836 100644 --- a/pkg/sstore/fileops.go +++ b/pkg/sstore/fileops.go @@ -9,8 +9,8 @@ import ( "path" "github.com/google/uuid" - "github.com/scripthaus-dev/mshell/pkg/cirfile" - "github.com/scripthaus-dev/sh2-server/pkg/scbase" + "github.com/commandlinedev/apishell/pkg/cirfile" + "github.com/commandlinedev/prompt-server/pkg/scbase" ) func CreateCmdPtyFile(ctx context.Context, screenId string, cmdId string, maxSize int64) error { diff --git a/pkg/sstore/migrate.go b/pkg/sstore/migrate.go index 3d9fc3cb..93abb367 100644 --- a/pkg/sstore/migrate.go +++ b/pkg/sstore/migrate.go @@ -12,7 +12,7 @@ import ( _ "github.com/golang-migrate/migrate/v4/source/file" "github.com/golang-migrate/migrate/v4/source/iofs" _ "github.com/mattn/go-sqlite3" - sh2db "github.com/scripthaus-dev/sh2-server/db" + sh2db "github.com/commandlinedev/prompt-server/db" "github.com/golang-migrate/migrate/v4" ) diff --git a/pkg/sstore/quick.go b/pkg/sstore/quick.go index 788c404d..a887d23d 100644 --- a/pkg/sstore/quick.go +++ b/pkg/sstore/quick.go @@ -1,7 +1,7 @@ package sstore import ( - "github.com/scripthaus-dev/sh2-server/pkg/dbutil" + "github.com/commandlinedev/prompt-server/pkg/dbutil" ) var quickSetStr = dbutil.QuickSetStr diff --git a/pkg/sstore/sstore.go b/pkg/sstore/sstore.go index 1dc630c6..433f31ad 100644 --- a/pkg/sstore/sstore.go +++ b/pkg/sstore/sstore.go @@ -20,10 +20,10 @@ import ( "github.com/google/uuid" "github.com/jmoiron/sqlx" "github.com/sawka/txwrap" - "github.com/scripthaus-dev/mshell/pkg/packet" - "github.com/scripthaus-dev/mshell/pkg/shexec" - "github.com/scripthaus-dev/sh2-server/pkg/dbutil" - "github.com/scripthaus-dev/sh2-server/pkg/scbase" + "github.com/commandlinedev/apishell/pkg/packet" + "github.com/commandlinedev/apishell/pkg/shexec" + "github.com/commandlinedev/prompt-server/pkg/dbutil" + "github.com/commandlinedev/prompt-server/pkg/scbase" _ "github.com/mattn/go-sqlite3" )