You've already forked CasaOS
mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-07-15 23:54:17 +02:00
wip
This commit is contained in:
@ -17,6 +17,8 @@ type DockerStatsModel struct {
|
|||||||
Previous interface{} `json:"previous"`
|
Previous interface{} `json:"previous"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeckerDaemonModel struct {
|
// reference - https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
|
||||||
Graph string `json:"graph"`
|
type DockerDaemonConfigurationModel struct {
|
||||||
|
// e.g. `/var/lib/docker`
|
||||||
|
Root string `json:"data-root,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewSshClient(user, password string, port string) (*ssh.Client, error) {
|
func NewSshClient(user, password string, port string) (*ssh.Client, error) {
|
||||||
|
|
||||||
// connet to ssh
|
// connet to ssh
|
||||||
// addr = fmt.Sprintf("%s:%d", host, port)
|
// addr = fmt.Sprintf("%s:%d", host, port)
|
||||||
|
|
||||||
@ -90,11 +89,11 @@ func (w *wsBufferWriter) Write(p []byte) (int, error) {
|
|||||||
defer w.mu.Unlock()
|
defer w.mu.Unlock()
|
||||||
return w.buffer.Write(p)
|
return w.buffer.Write(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SshConn) Close() {
|
func (s *SshConn) Close() {
|
||||||
if s.Session != nil {
|
if s.Session != nil {
|
||||||
s.Session.Close()
|
s.Session.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -111,7 +110,6 @@ func ReceiveWsMsgUser(wsConn *websocket.Conn, logBuff *bytes.Buffer) string {
|
|||||||
// read websocket msg
|
// read websocket msg
|
||||||
_, wsData, err := wsConn.ReadMessage()
|
_, wsData, err := wsConn.ReadMessage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,6 +271,7 @@ func (ssConn *SshConn) SendComboOutput(wsConn *websocket.Conn, exitCh chan bool)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func flushComboOutput(w *wsBufferWriter, wsConn *websocket.Conn) error {
|
func flushComboOutput(w *wsBufferWriter, wsConn *websocket.Conn) error {
|
||||||
if w.buffer.Len() != 0 {
|
if w.buffer.Len() != 0 {
|
||||||
err := wsConn.WriteMessage(websocket.TextMessage, w.buffer.Bytes())
|
err := wsConn.WriteMessage(websocket.TextMessage, w.buffer.Bytes())
|
||||||
@ -341,6 +340,7 @@ func (ssConn *SshConn) Login(wsConn *websocket.Conn, logBuff *bytes.Buffer, exit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ssConn *SshConn) SessionWait(quitChan chan bool) {
|
func (ssConn *SshConn) SessionWait(quitChan chan bool) {
|
||||||
if err := ssConn.Session.Wait(); err != nil {
|
if err := ssConn.Session.Wait(); err != nil {
|
||||||
logrus.WithError(err).Error("ssh session wait failed")
|
logrus.WithError(err).Error("ssh session wait failed")
|
||||||
|
@ -36,7 +36,7 @@ func ExecResultStrArray(cmdStr string) []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// str, err := ioutil.ReadAll(stdout)
|
// str, err := ioutil.ReadAll(stdout)
|
||||||
var networklist = []string{}
|
networklist := []string{}
|
||||||
outputBuf := bufio.NewReader(stdout)
|
outputBuf := bufio.NewReader(stdout)
|
||||||
for {
|
for {
|
||||||
output, _, err := outputBuf.ReadLine()
|
output, _, err := outputBuf.ReadLine()
|
||||||
@ -54,6 +54,8 @@ func ExecResultStrArray(cmdStr string) []string {
|
|||||||
|
|
||||||
func ExecResultStr(cmdStr string) string {
|
func ExecResultStr(cmdStr string) string {
|
||||||
cmd := exec.Command("/bin/bash", "-c", cmdStr)
|
cmd := exec.Command("/bin/bash", "-c", cmdStr)
|
||||||
|
println(cmd.String())
|
||||||
|
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
@ -107,6 +109,5 @@ func ExecSmartCTLByPath(path string) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ExecEnabledSMART(path string) {
|
func ExecEnabledSMART(path string) {
|
||||||
|
|
||||||
exec.Command("smartctl", "-s on", path).Output()
|
exec.Command("smartctl", "-s on", path).Output()
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"io/fs"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
@ -60,7 +61,7 @@ func MkDir(src string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
os.Chmod(src, 0777)
|
os.Chmod(src, 0o777)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -103,7 +104,7 @@ func MustOpen(fileName, filePath string) (*os.File, error) {
|
|||||||
return nil, fmt.Errorf("file.IsNotExistMkDir src: %s, err: %v", src, err)
|
return nil, fmt.Errorf("file.IsNotExistMkDir src: %s, err: %v", src, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err := Open(src+fileName, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0644)
|
f, err := Open(src+fileName, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0o644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Fail to OpenFile :%v", err)
|
return nil, fmt.Errorf("Fail to OpenFile :%v", err)
|
||||||
}
|
}
|
||||||
@ -147,7 +148,7 @@ func CreateFile(path string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CreateFileAndWriteContent(path string, content string) error {
|
func CreateFileAndWriteContent(path string, content string) error {
|
||||||
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0666)
|
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0o666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -163,7 +164,7 @@ func CreateFileAndWriteContent(path string, content string) error {
|
|||||||
|
|
||||||
// IsNotExistMkDir create a directory if it does not exist
|
// IsNotExistMkDir create a directory if it does not exist
|
||||||
func IsNotExistCreateFile(src string) error {
|
func IsNotExistCreateFile(src string) error {
|
||||||
if notExist := CheckNotExist(src); notExist == true {
|
if notExist := CheckNotExist(src); notExist {
|
||||||
if err := CreateFile(src); err != nil {
|
if err := CreateFile(src); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -336,10 +337,17 @@ func WriteToPath(data []byte, path, name string) error {
|
|||||||
} else {
|
} else {
|
||||||
fullPath += "/" + name
|
fullPath += "/" + name
|
||||||
}
|
}
|
||||||
IsNotExistCreateFile(fullPath)
|
return WriteToFullPath(data, fullPath, 0o666)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WriteToFullPath(data []byte, fullPath string, perm fs.FileMode) error {
|
||||||
|
if err := IsNotExistCreateFile(fullPath); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
file, err := os.OpenFile(fullPath,
|
file, err := os.OpenFile(fullPath,
|
||||||
os.O_WRONLY|os.O_TRUNC|os.O_CREATE,
|
os.O_WRONLY|os.O_TRUNC|os.O_CREATE,
|
||||||
0666,
|
perm,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -352,14 +360,13 @@ func WriteToPath(data []byte, path, name string) error {
|
|||||||
|
|
||||||
// 最终拼接
|
// 最终拼接
|
||||||
func SpliceFiles(dir, path string, length int, startPoint int) error {
|
func SpliceFiles(dir, path string, length int, startPoint int) error {
|
||||||
|
|
||||||
fullPath := path
|
fullPath := path
|
||||||
|
|
||||||
IsNotExistCreateFile(fullPath)
|
IsNotExistCreateFile(fullPath)
|
||||||
|
|
||||||
file, _ := os.OpenFile(fullPath,
|
file, _ := os.OpenFile(fullPath,
|
||||||
os.O_WRONLY|os.O_TRUNC|os.O_CREATE,
|
os.O_WRONLY|os.O_TRUNC|os.O_CREATE,
|
||||||
0666,
|
0o666,
|
||||||
)
|
)
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
bufferedWriter := bufio.NewWriter(file)
|
bufferedWriter := bufio.NewWriter(file)
|
||||||
@ -380,7 +387,6 @@ func SpliceFiles(dir, path string, length int, startPoint int) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetCompressionAlgorithm(t string) (string, archiver.Writer, error) {
|
func GetCompressionAlgorithm(t string) (string, archiver.Writer, error) {
|
||||||
|
|
||||||
switch t {
|
switch t {
|
||||||
case "zip", "":
|
case "zip", "":
|
||||||
return ".zip", archiver.NewZip(), nil
|
return ".zip", archiver.NewZip(), nil
|
||||||
@ -400,8 +406,8 @@ func GetCompressionAlgorithm(t string) (string, archiver.Writer, error) {
|
|||||||
return "", nil, errors.New("format not implemented")
|
return "", nil, errors.New("format not implemented")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func AddFile(ar archiver.Writer, path, commonPath string) error {
|
|
||||||
|
|
||||||
|
func AddFile(ar archiver.Writer, path, commonPath string) error {
|
||||||
info, err := os.Stat(path)
|
info, err := os.Stat(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -447,6 +453,7 @@ func AddFile(ar archiver.Writer, path, commonPath string) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func CommonPrefix(sep byte, paths ...string) string {
|
func CommonPrefix(sep byte, paths ...string) string {
|
||||||
// Handle special cases.
|
// Handle special cases.
|
||||||
switch len(paths) {
|
switch len(paths) {
|
||||||
|
@ -11,7 +11,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func InitRouter() *gin.Engine {
|
func InitRouter() *gin.Engine {
|
||||||
|
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
|
|
||||||
r.Use(middleware.Cors())
|
r.Use(middleware.Cors())
|
||||||
@ -100,8 +99,8 @@ func InitRouter() *gin.Engine {
|
|||||||
v1ContainerGroup.PUT("/:id/latest", v1.PutAppUpdate)
|
v1ContainerGroup.PUT("/:id/latest", v1.PutAppUpdate)
|
||||||
// Not used
|
// Not used
|
||||||
v1ContainerGroup.POST("/share", v1.ShareAppFile)
|
v1ContainerGroup.POST("/share", v1.ShareAppFile)
|
||||||
v1ContainerGroup.GET("/info", v1.GetcontainerInfo)
|
v1ContainerGroup.GET("/info", v1.GetDockerDaemonConfiguration)
|
||||||
v1ContainerGroup.PUT("/info", v1.PutcontainerInfo)
|
v1ContainerGroup.PUT("/info", v1.PutDockerDaemonConfiguration)
|
||||||
|
|
||||||
}
|
}
|
||||||
v1AppCategoriesGroup := v1Group.Group("/app-categories")
|
v1AppCategoriesGroup := v1Group.Group("/app-categories")
|
||||||
|
@ -2,8 +2,9 @@ package v1
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/IceWhaleTech/CasaOS/model"
|
"github.com/IceWhaleTech/CasaOS/model"
|
||||||
@ -16,6 +17,10 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
dockerDaemonConfigurationFilePath = "/etc/docker/daemon.json"
|
||||||
|
)
|
||||||
|
|
||||||
// @Summary 获取远程列表
|
// @Summary 获取远程列表
|
||||||
// @Produce application/json
|
// @Produce application/json
|
||||||
// @Accept application/json
|
// @Accept application/json
|
||||||
@ -29,7 +34,6 @@ import (
|
|||||||
// @Success 200 {string} string "ok"
|
// @Success 200 {string} string "ok"
|
||||||
// @Router /app/list [get]
|
// @Router /app/list [get]
|
||||||
func AppList(c *gin.Context) {
|
func AppList(c *gin.Context) {
|
||||||
|
|
||||||
// service.MyService.Docker().DockerContainerCommit("test2")
|
// service.MyService.Docker().DockerContainerCommit("test2")
|
||||||
|
|
||||||
index := c.DefaultQuery("index", "1")
|
index := c.DefaultQuery("index", "1")
|
||||||
@ -151,7 +155,6 @@ func AppUsageList(c *gin.Context) {
|
|||||||
// @Success 200 {string} string "ok"
|
// @Success 200 {string} string "ok"
|
||||||
// @Router /app/appinfo/{id} [get]
|
// @Router /app/appinfo/{id} [get]
|
||||||
func AppInfo(c *gin.Context) {
|
func AppInfo(c *gin.Context) {
|
||||||
|
|
||||||
id := c.Param("id")
|
id := c.Param("id")
|
||||||
language := c.GetHeader("Language")
|
language := c.GetHeader("Language")
|
||||||
info, err := service.MyService.Casa().GetServerAppInfo(id, "", language)
|
info, err := service.MyService.Casa().GetServerAppInfo(id, "", language)
|
||||||
@ -265,53 +268,89 @@ func ShareAppFile(c *gin.Context) {
|
|||||||
c.JSON(common_err.SUCCESS, json.RawMessage(content))
|
c.JSON(common_err.SUCCESS, json.RawMessage(content))
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetcontainerInfo(c *gin.Context) {
|
func GetDockerDaemonConfiguration(c *gin.Context) {
|
||||||
// info, err := service.MyService.Docker().GetDockerInfo()
|
// info, err := service.MyService.Docker().GetDockerInfo()
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// c.JSON(common_err.SERVICE_ERROR, &model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR), Data: err.Error()})
|
// c.JSON(common_err.SERVICE_ERROR, &model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR), Data: err.Error()})
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
daemon := model.DeckerDaemonModel{}
|
dockerConfig := model.DockerDaemonConfigurationModel{}
|
||||||
data := make(map[string]interface{}, 1)
|
data := make(map[string]interface{}, 1)
|
||||||
data["docker_root_dir"] = ""
|
data["docker_root_dir"] = ""
|
||||||
if file.Exists("/etc/docker/daemon.json") {
|
|
||||||
byteResult := file.ReadFullFile("/etc/docker/daemon.json")
|
// TODO read dockerRootDir from /etc/casaos/casaos.conf
|
||||||
err := json.Unmarshal(byteResult, &daemon)
|
if file.Exists(dockerDaemonConfigurationFilePath) {
|
||||||
|
byteResult := file.ReadFullFile(dockerDaemonConfigurationFilePath)
|
||||||
|
err := json.Unmarshal(byteResult, &dockerConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(common_err.CLIENT_ERROR, &model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.INVALID_PARAMS), Data: err.Error()})
|
c.JSON(common_err.CLIENT_ERROR, &model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.INVALID_PARAMS), Data: err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data["docker_root_dir"] = daemon.Graph
|
|
||||||
|
if dockerConfig.Root != "" {
|
||||||
|
data["docker_root_dir"] = dockerConfig.Root
|
||||||
|
} else {
|
||||||
|
data["docker_root_dir"] = "/var/lib/docker"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
c.JSON(common_err.SUCCESS, &model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: data})
|
c.JSON(common_err.SUCCESS, &model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: data})
|
||||||
}
|
}
|
||||||
func PutcontainerInfo(c *gin.Context) {
|
|
||||||
|
func PutDockerDaemonConfiguration(c *gin.Context) {
|
||||||
js := make(map[string]interface{})
|
js := make(map[string]interface{})
|
||||||
err := c.BindJSON(&js)
|
if err := c.BindJSON(&js); err != nil {
|
||||||
if err != nil {
|
c.JSON(http.StatusBadRequest, &model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.INVALID_PARAMS), Data: err.Error()})
|
||||||
c.JSON(common_err.CLIENT_ERROR, &model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.INVALID_PARAMS), Data: err.Error()})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dockerRootDir := js["docker_root_dir"].(string)
|
|
||||||
daemon := model.DeckerDaemonModel{}
|
value, ok := js["docker_root_dir"]
|
||||||
if file.Exists("/etc/docker/daemon.json") {
|
if !ok {
|
||||||
byteResult := file.ReadFullFile("/etc/docker/daemon.json")
|
c.JSON(http.StatusBadRequest, &model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.INVALID_PARAMS), Data: "`docker_root_dir` should not empty"})
|
||||||
err := json.Unmarshal(byteResult, &daemon)
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
dockerConfig := model.DockerDaemonConfigurationModel{}
|
||||||
|
if file.Exists(dockerDaemonConfigurationFilePath) {
|
||||||
|
byteResult := file.ReadFullFile(dockerDaemonConfigurationFilePath)
|
||||||
|
err := json.Unmarshal(byteResult, &dockerConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(common_err.CLIENT_ERROR, &model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.INVALID_PARAMS), Data: err.Error()})
|
c.JSON(http.StatusInternalServerError, &model.Result{Success: common_err.SERVICE_ERROR, Message: "error when trying to deserialize " + dockerDaemonConfigurationFilePath, Data: err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dockerRootDir := value.(string)
|
||||||
|
if dockerRootDir == "/" {
|
||||||
|
dockerConfig.Root = "" // omitempty - empty string will not be serialized
|
||||||
|
} else {
|
||||||
if !file.Exists(dockerRootDir) {
|
if !file.Exists(dockerRootDir) {
|
||||||
c.JSON(common_err.CLIENT_ERROR, &model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.DIR_NOT_EXISTS), Data: common_err.GetMsg(common_err.DIR_NOT_EXISTS)})
|
c.JSON(http.StatusBadRequest, &model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.DIR_NOT_EXISTS), Data: common_err.GetMsg(common_err.DIR_NOT_EXISTS)})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
daemon.Graph = dockerRootDir
|
|
||||||
byteMode, _ := json.Marshal(daemon)
|
|
||||||
file.WriteToPath(byteMode, "/etc/docker", "daemon.json")
|
|
||||||
|
|
||||||
fmt.Println(command.ExecResultStr("systemctl daemon-reload"))
|
dockerConfig.Root = filepath.Join(dockerRootDir, "docker")
|
||||||
fmt.Println(command.ExecResultStr("systemctl restart docker"))
|
|
||||||
|
|
||||||
c.JSON(common_err.SUCCESS, &model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: js})
|
if err := file.IsNotExistMkDir(dockerConfig.Root); err != nil {
|
||||||
|
c.JSON(http.StatusInternalServerError, &model.Result{Success: common_err.SERVICE_ERROR, Message: "error when trying to create " + dockerConfig.Root, Data: err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
byteMode, err := json.Marshal(dockerConfig)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(http.StatusBadRequest, &model.Result{Success: common_err.CLIENT_ERROR, Message: "error when trying to serialize docker config", Data: dockerConfig})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := file.WriteToFullPath(byteMode, dockerDaemonConfigurationFilePath, 0o644); err != nil {
|
||||||
|
c.JSON(http.StatusInternalServerError, &model.Result{Success: common_err.SERVICE_ERROR, Message: "error when trying to write to " + dockerDaemonConfigurationFilePath, Data: err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO also write dockerRootDir to /etc/casaos/casaos.conf
|
||||||
|
|
||||||
|
println(command.ExecResultStr("systemctl daemon-reload"))
|
||||||
|
println(command.ExecResultStr("systemctl restart docker"))
|
||||||
|
|
||||||
|
c.JSON(http.StatusOK, &model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: js})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user