mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
Added setting for customizing webshell start command
This commit is contained in:
parent
70e3f2d372
commit
acc1aabaf7
5 changed files with 9 additions and 3 deletions
|
@ -4,3 +4,4 @@ RunMode = debug
|
|||
JwtSecret =
|
||||
Email =
|
||||
HTTPChallengePort = 9180
|
||||
StartCmd = login
|
||||
|
|
BIN
nginx-ui
BIN
nginx-ui
Binary file not shown.
|
@ -23,6 +23,7 @@ type Server struct {
|
|||
HTTPChallengePort string
|
||||
Email string
|
||||
Database string
|
||||
StartCmd string
|
||||
Demo bool
|
||||
}
|
||||
|
||||
|
@ -31,6 +32,7 @@ var ServerSettings = &Server{
|
|||
RunMode: "debug",
|
||||
HTTPChallengePort: "9180",
|
||||
Database: "database",
|
||||
StartCmd: "login",
|
||||
Demo: false,
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,10 @@ func ReloadNginx() string {
|
|||
|
||||
output := string(out)
|
||||
log.Println(output)
|
||||
|
||||
return output
|
||||
if strings.Contains(output, "failed") {
|
||||
return output
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func GetNginxConfPath(dir string) string {
|
||||
|
|
|
@ -2,6 +2,7 @@ package pty
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/0xJacky/Nginx-UI/server/settings"
|
||||
"github.com/creack/pty"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -24,7 +25,7 @@ type Message struct {
|
|||
const bufferSize = 2048
|
||||
|
||||
func NewPipeLine(conn *websocket.Conn) (p *Pipeline, err error) {
|
||||
c := exec.Command("login")
|
||||
c := exec.Command(settings.ServerSettings.StartCmd)
|
||||
|
||||
ptmx, err := pty.StartWithSize(c, &pty.Winsize{Cols: 90, Rows: 60})
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue