From c7c32272bbecd7e2df622558b485336e70b89e01 Mon Sep 17 00:00:00 2001 From: caoyingjunz Date: Mon, 30 Dec 2024 20:08:06 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E4=BB=93=E5=BA=93=20(#566)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 8 ++++---- config.yaml | 4 ++-- hack/update-image.sh | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 198e336e..b8ed8a5f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -29,7 +29,7 @@ jobs: - name: Login harbor uses: docker/login-action@v3 with: - registry: harbor.cloud.pixiuio.com + registry: crpi-0ecikjs9ylb2hqyo.cn-hangzhou.personal.cr.aliyuncs.com username: ${{ secrets.HARBOR_USERNAME }} password: ${{ secrets.HARBOR_PASSWORD }} @@ -43,6 +43,6 @@ jobs: VERSION=${{ env.COMMIT_HASH }}-${{ env.TIMESTAMP }} push: true tags: | - harbor.cloud.pixiuio.com/${{ secrets.HARBOR_PROJECT }}/pixiu:latest - harbor.cloud.pixiuio.com/${{ secrets.HARBOR_PROJECT }}/pixiu:v0.1 - harbor.cloud.pixiuio.com/${{ secrets.HARBOR_PROJECT }}/pixiu:${{ env.COMMIT_HASH }} + crpi-0ecikjs9ylb2hqyo.cn-hangzhou.personal.cr.aliyuncs.com/pixiu-public/pixiu:latest + crpi-0ecikjs9ylb2hqyo.cn-hangzhou.personal.cr.aliyuncs.com/pixiu-public/pixiu:v1.0.1 + crpi-0ecikjs9ylb2hqyo.cn-hangzhou.personal.cr.aliyuncs.com/pixiu-public/pixiu:${{ env.COMMIT_HASH }} diff --git a/config.yaml b/config.yaml index fa921d45..607bb027 100644 --- a/config.yaml +++ b/config.yaml @@ -26,12 +26,12 @@ mysql: worker: work_dir: /tmp/pixiu engines: - - image: harbor.cloud.pixiuio.com/pixiuio/kubez-ansible:v2.0.1 + - image: ccr.ccs.tencentyun.com/pixiucloud/kubez-ansible:v2.0.1 os_supported: - centos7 - debian10 - ubuntu18.04 - - image: harbor.cloud.pixiuio.com/pixiuio/kubez-ansible:v3.0.1 + - image: ccr.ccs.tencentyun.com/pixiucloud/kubez-ansible:v3.0.1 os_supported: - debian11 - ubuntu20.04 diff --git a/hack/update-image.sh b/hack/update-image.sh index 5ee5338b..c03aa757 100644 --- a/hack/update-image.sh +++ b/hack/update-image.sh @@ -1,9 +1,9 @@ #!/bin/bash function update() { - docker pull harbor.cloud.pixiuio.com/pixiuio/pixiu-aio:latest + docker ccr.ccs.tencentyun.com/pixiucloud/pixiu-aio:latest docker rm -f pixiu-aio sleep 3 - docker run -d --net host --restart=always --privileged=true -v /etc/pixiu:/etc/pixiu -v /var/run/docker.sock:/var/run/docker.sock --name pixiu-aio harbor.cloud.pixiuio.com/pixiuio/pixiu-aio:latest + docker run -d --net host --restart=always --privileged=true -v /etc/pixiu:/etc/pixiu -v /var/run/docker.sock:/var/run/docker.sock --name pixiu-aio ccr.ccs.tencentyun.com/pixiucloud/pixiu-aio:latest } update From 6dd3834ece9829d2e60a8444605d2912c9fa5cc4 Mon Sep 17 00:00:00 2001 From: caoyingjunz Date: Wed, 15 Jan 2025 21:47:43 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96pixiu=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=BF=9B=E7=A8=8B=20(#569)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-webshell-image.yml | 4 +- .github/workflows/docker-image.yml | 2 +- Dockerfile | 13 ----- docker/Dockerfile | 64 ++++++++-------------- docker/Dockerfile-toolbox | 40 ++++++++++++++ docker/start.sh | 16 ++++++ 6 files changed, 83 insertions(+), 56 deletions(-) delete mode 100644 Dockerfile create mode 100644 docker/Dockerfile-toolbox create mode 100644 docker/start.sh diff --git a/.github/workflows/build-webshell-image.yml b/.github/workflows/build-webshell-image.yml index 8367a3f1..e6f6f370 100644 --- a/.github/workflows/build-webshell-image.yml +++ b/.github/workflows/build-webshell-image.yml @@ -5,7 +5,7 @@ on: branches: - "master" paths: - - 'docker/Dockerfile' + - 'docker/Dockerfile-toolbox' - 'Makefile' env: @@ -39,7 +39,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - file: ./docker/Dockerfile + file: ./docker/Dockerfile-toolbox platforms: linux/amd64,linux/arm64 build-args: | K8S_VERSION=${{ env.K8S_VERSION }} diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b8ed8a5f..831085f0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -37,7 +37,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - file: ./Dockerfile + file: ./docker/Dockerfile platforms: linux/amd64,linux/arm64 build-args: | VERSION=${{ env.COMMIT_HASH }}-${{ env.TIMESTAMP }} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0556a4b8..00000000 --- a/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM golang:1.17-alpine as builder -WORKDIR /app -ARG VERSION -ENV GOPROXY=https://goproxy.cn -COPY ./go.mod ./ -COPY ./go.sum ./ -#RUN go mod download -COPY . . -RUN CGO_ENABLED=0 go build -ldflags "-s -w -X 'main.version=${VERSION}'" -o pixiu ./cmd - -FROM busybox as runner -COPY --from=builder /app/pixiu /app -ENTRYPOINT ["/app"] diff --git a/docker/Dockerfile b/docker/Dockerfile index f92b7928..33334042 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,40 +1,24 @@ -# 使用 Ubuntu 作为基础镜像 -FROM ubuntu:22.04 - -ARG K8S_VERSION -ARG HELM_VERSION - -# 安装vim -RUN apt-get update && apt-get install -y vim - -# 安装必要的软件包 -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl bash-completion - -# 安装 kubectl -RUN ARCH=$(uname -m|sed 's|x86_64|amd64|'|sed 's|aarch64|arm64|') && \ - curl -LO "https://dl.k8s.io/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl" && \ - install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \ - rm -rf kubectl - -# 安装 helm -RUN ARCH=$(uname -m|sed 's|x86_64|amd64|'|sed 's|aarch64|arm64|') && \ - curl -LO "https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz" && \ - tar -zxvf helm-${HELM_VERSION}-linux-${ARCH}.tar.gz && \ - rm -rf helm-${HELM_VERSION}-linux-${ARCH}.tar.gz && \ - mv linux-${ARCH}/helm /usr/local/bin/helm && \ - rm -rf linux-${ARCH} - -# 配置 bash 补全和自定义的 PS1 提示符 -RUN echo 'source /etc/profile.d/bash_completion.sh' >> /root/.bashrc \ - && echo 'source <(kubectl completion bash)' >> /root/.bashrc \ - && echo 'source <(helm completion bash)' >> /root/.bashrc \ - && echo "PS1='[\[\033[0;34m\]\u\[\033[0;37m\]@\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[0;37m\]]\[\033[0;31m\]\$\[\033[00m\] '" >> /root/.bashrc - -# 设置工作目录 -WORKDIR /root - -# 设置环境变量等(可选) -ENV PATH="/usr/local/bin:${PATH}" - -# 启动 bash 终端 -CMD ["sleep", "infinity"] +FROM golang:1.17-alpine as builder +WORKDIR /app +ARG VERSION +ENV GOPROXY=https://goproxy.cn +COPY ../go.mod ./ +COPY ../go.sum ./ +#RUN go mod download +COPY .. . +RUN CGO_ENABLED=0 go build -ldflags "-s -w -X 'main.version=${VERSION}'" -o pixiu ./cmd + +FROM node:16.18.0-alpine as dashboard-builder +WORKDIR /build +RUN apk add git +RUN git clone https://github.com/pixiu-io/dashboard.git +RUN cd dashboard && npm install && npm run build + +FROM busybox as runner +LABEL MAINTAINER="PIXIU" + +COPY --from=builder /app/pixiu /app +COPY --from=dashboard-builder /build/dashboard/dist /static +COPY docker/start.sh /usr/local/bin/pixiu_start + +CMD ["pixiu_start"] diff --git a/docker/Dockerfile-toolbox b/docker/Dockerfile-toolbox new file mode 100644 index 00000000..f92b7928 --- /dev/null +++ b/docker/Dockerfile-toolbox @@ -0,0 +1,40 @@ +# 使用 Ubuntu 作为基础镜像 +FROM ubuntu:22.04 + +ARG K8S_VERSION +ARG HELM_VERSION + +# 安装vim +RUN apt-get update && apt-get install -y vim + +# 安装必要的软件包 +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl bash-completion + +# 安装 kubectl +RUN ARCH=$(uname -m|sed 's|x86_64|amd64|'|sed 's|aarch64|arm64|') && \ + curl -LO "https://dl.k8s.io/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \ + rm -rf kubectl + +# 安装 helm +RUN ARCH=$(uname -m|sed 's|x86_64|amd64|'|sed 's|aarch64|arm64|') && \ + curl -LO "https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz" && \ + tar -zxvf helm-${HELM_VERSION}-linux-${ARCH}.tar.gz && \ + rm -rf helm-${HELM_VERSION}-linux-${ARCH}.tar.gz && \ + mv linux-${ARCH}/helm /usr/local/bin/helm && \ + rm -rf linux-${ARCH} + +# 配置 bash 补全和自定义的 PS1 提示符 +RUN echo 'source /etc/profile.d/bash_completion.sh' >> /root/.bashrc \ + && echo 'source <(kubectl completion bash)' >> /root/.bashrc \ + && echo 'source <(helm completion bash)' >> /root/.bashrc \ + && echo "PS1='[\[\033[0;34m\]\u\[\033[0;37m\]@\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[0;37m\]]\[\033[0;31m\]\$\[\033[00m\] '" >> /root/.bashrc + +# 设置工作目录 +WORKDIR /root + +# 设置环境变量等(可选) +ENV PATH="/usr/local/bin:${PATH}" + +# 启动 bash 终端 +CMD ["sleep", "infinity"] diff --git a/docker/start.sh b/docker/start.sh new file mode 100644 index 00000000..5a5e5132 --- /dev/null +++ b/docker/start.sh @@ -0,0 +1,16 @@ +#!/bin/sh +set -o errexit +set -o xtrace + +if [[ ! -d "/etc/pixiu" ]]; then + mkdir -p /etc/pixiu +fi + +if [[ -e "/static/config.json" ]]; then + rm -rf /static/config.json +fi +if [[ -e "/etc/pixiu/config.json" ]]; then + cp /etc/pixiu/config.json /static/config.json +fi + +/app From 5633186a33ed595124211a1387ba925da578a52e Mon Sep 17 00:00:00 2001 From: caoyingjunz Date: Wed, 15 Jan 2025 22:31:07 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=89=8D=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6=20(#561)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/server/router/router.go | 4 +- cmd/app/config/config.go | 2 + cmd/app/options/options.go | 4 ++ config.yaml | 2 + install.md | 6 +- pkg/static/embedfile.go | 67 -------------------- pkg/static/localfile.go | 61 ++++++++++++++++++ pkg/static/{servefilesystem.go => static.go} | 6 +- 8 files changed, 80 insertions(+), 72 deletions(-) delete mode 100644 pkg/static/embedfile.go create mode 100644 pkg/static/localfile.go rename pkg/static/{servefilesystem.go => static.go} (91%) diff --git a/api/server/router/router.go b/api/server/router/router.go index c94e03f9..abf0d4e0 100644 --- a/api/server/router/router.go +++ b/api/server/router/router.go @@ -61,7 +61,9 @@ func InstallRouters(o *options.Options) { install(o, fs...) - o.HttpEngine.Use(static.ServeEmbed("static", EmbedFS)) + // StaticFiles 启用前端集成 + o.HttpEngine.Use(static.Serve("/", static.LocalFile(o.ComponentConfig.Default.StaticFiles, true))) + // 启动健康检查 o.HttpEngine.GET("/healthz", func(c *gin.Context) { c.String(http.StatusOK, "ok") }) // 启动 APIs 服务 diff --git a/cmd/app/config/config.go b/cmd/app/config/config.go index 61623469..58ad5794 100644 --- a/cmd/app/config/config.go +++ b/cmd/app/config/config.go @@ -51,6 +51,8 @@ type DefaultOptions struct { AutoMigrate bool `yaml:"auto_migrate"` logutil.LogOptions `yaml:",inline"` + // 静态文件路径 + StaticFiles string `yaml:"static_files"` } func (o DefaultOptions) Valid() error { diff --git a/cmd/app/options/options.go b/cmd/app/options/options.go index 70111f59..13f06572 100644 --- a/cmd/app/options/options.go +++ b/cmd/app/options/options.go @@ -48,6 +48,7 @@ const ( defaultConfigFile = "/etc/pixiu/config.yaml" defaultLogFormat = logutil.LogFormatJson defaultWorkDir = "/etc/pixiu" + defaultStaticDir = "/static" defaultSlowSQLDuration = 1 * time.Second @@ -114,6 +115,9 @@ func (o *Options) Complete() error { if o.ComponentConfig.Worker.WorkDir == "" { o.ComponentConfig.Worker.WorkDir = defaultWorkDir } + if len(o.ComponentConfig.Default.StaticFiles) == 0 { + o.ComponentConfig.Default.StaticFiles = defaultStaticDir + } if o.ComponentConfig.Audit.Schedule == "" { o.ComponentConfig.Audit.Schedule = jobmanager.DefaultSchedule } diff --git a/config.yaml b/config.yaml index 607bb027..4fdf7367 100644 --- a/config.yaml +++ b/config.yaml @@ -10,6 +10,8 @@ default: # 日志的格式,可选 text 和 json log_format: json log_level: info + # 静态文件路径 + static_files: /static #tls: # cert_file: test.pem diff --git a/install.md b/install.md index d4669a75..3afa8bb3 100644 --- a/install.md +++ b/install.md @@ -59,16 +59,16 @@ worker: - rocky9.3 - openEuler22.03 -# 前端配置(ip 根据实际情况调整,如果是虚拟机,则配置成虚拟机的公网IP,安全组放通80和8090端口) +# 前端配置(ip 根据实际情况调整,如果是虚拟机,则配置成虚拟机的公网IP,安全组放通80(http)或者443(https)端口) vim /etc/pixiu/config.json { "url": "http://192.168.16.156", - "watchUrl": "http://192.168.16.156:8090" + "watchUrl": "http://192.168.16.156" } ``` # 启动 pixiu ```bash -docker run -d --net host --restart=always --privileged=true -v /etc/pixiu:/etc/pixiu -v /var/run/docker.sock:/var/run/docker.sock --name pixiu-aio ccr.ccs.tencentyun.com/pixiucloud/pixiu-aio +docker run -d --net host --restart=always --privileged=true -v /etc/pixiu:/etc/pixiu -v /var/run/docker.sock:/var/run/docker.sock --name pixiu ccr.ccs.tencentyun.com/pixiucloud/pixiu 登录效果 浏览器登陆: http://192.168.16.156 ``` diff --git a/pkg/static/embedfile.go b/pkg/static/embedfile.go deleted file mode 100644 index 85928ded..00000000 --- a/pkg/static/embedfile.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -* Copyright 2024 Pixiu. All rights reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http:*www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. - */ - -package static - -import ( - "embed" - "io/fs" - "net/http" - "strings" - - "github.com/gin-gonic/gin" -) - -type embedFileSystem struct { - http.FileSystem -} - -func (e embedFileSystem) Exists(prefix string, path string) bool { - _, err := e.Open(path) - return err == nil -} - -func EmbedFolder(fsEmbed embed.FS, reqPath string) (ServeFileSystem, error) { - targetPath := strings.TrimSpace(reqPath) - if targetPath == "" { - return embedFileSystem{ - FileSystem: http.FS(fsEmbed), - }, nil - } - - fsys, _ := fs.Sub(fsEmbed, targetPath) - _, err := fsEmbed.Open(targetPath) - if err != nil { - return nil, err - } - - return embedFileSystem{ - FileSystem: http.FS(fsys), - }, nil -} - -func ServeEmbed(reqPath string, fsEmbed embed.FS) gin.HandlerFunc { - embedFS, err := EmbedFolder(fsEmbed, reqPath) - if err != nil { - return func(c *gin.Context) { - c.JSON(http.StatusInternalServerError, gin.H{ - "message": "initialization of embed folder failed", - "error": err.Error(), - }) - } - } - return gin.WrapH(http.FileServer(embedFS)) -} diff --git a/pkg/static/localfile.go b/pkg/static/localfile.go new file mode 100644 index 00000000..ab94f781 --- /dev/null +++ b/pkg/static/localfile.go @@ -0,0 +1,61 @@ +/* +Copyright 2025 The Pixiu Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package static + +import ( + "github.com/gin-gonic/gin" + "net/http" + "os" + "path" + "strings" +) + +type localFileSystem struct { + http.FileSystem + root string + indexes bool +} + +func LocalFile(root string, indexes bool) *localFileSystem { + return &localFileSystem{ + FileSystem: gin.Dir(root, indexes), + root: root, + indexes: indexes, + } +} +func (l *localFileSystem) Exists(prefix string, file string) bool { + if p := strings.TrimPrefix(file, prefix); len(p) < len(file) { + name := path.Join(l.root, path.Clean(p)) + if strings.Contains(name, "\\") || strings.Contains(name, "..") { + return false + } + stats, err := os.Stat(name) + if err != nil { + return false + } + if stats.IsDir() { + if !l.indexes { + _, err := os.Stat(path.Join(name, "index.html")) + if err != nil { + return false + } + } + } + return true + } + return false +} diff --git a/pkg/static/servefilesystem.go b/pkg/static/static.go similarity index 91% rename from pkg/static/servefilesystem.go rename to pkg/static/static.go index 8f041e3b..b1748ca3 100644 --- a/pkg/static/servefilesystem.go +++ b/pkg/static/static.go @@ -1,5 +1,5 @@ /* -Copyright 2024 The Pixiu Authors. +Copyright 2025 The Pixiu Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -28,6 +28,10 @@ type ServeFileSystem interface { Exists(prefix string, path string) bool } +func ServeRoot(urlPrefix, root string) gin.HandlerFunc { + return Serve(urlPrefix, LocalFile(root, false)) +} + // Serve returns a middleware handler that serves static files in the given directory. func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc { return ServeCached(urlPrefix, fs, 0) From 6d0178f5629ae314c33eeff374acfa8bb74644ca Mon Sep 17 00:00:00 2001 From: caoyingjunz Date: Wed, 15 Jan 2025 23:23:21 +0800 Subject: [PATCH 4/5] Add +x for start.sh (#570) --- docker/start.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 docker/start.sh diff --git a/docker/start.sh b/docker/start.sh old mode 100644 new mode 100755 From 9e93c7822a6592cf4d00ec01ed0975d59d23108c Mon Sep 17 00:00:00 2001 From: caoyingjunz Date: Fri, 17 Jan 2025 01:07:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=AE=80=E5=8C=96=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E4=BE=9D=E8=B5=96=E9=85=8D=E7=BD=AE=20(#571)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.yaml | 4 ++++ docker/start.sh | 11 +++++++++-- install.md | 11 ++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/config.yaml b/config.yaml index 4fdf7367..970293f7 100644 --- a/config.yaml +++ b/config.yaml @@ -13,6 +13,10 @@ default: # 静态文件路径 static_files: /static +# 配置前端请求地址 +dashboard: + url: http://localhost:8080 + #tls: # cert_file: test.pem # key_file: test.key diff --git a/docker/start.sh b/docker/start.sh index 5a5e5132..35b5e3f1 100755 --- a/docker/start.sh +++ b/docker/start.sh @@ -9,8 +9,15 @@ fi if [[ -e "/static/config.json" ]]; then rm -rf /static/config.json fi -if [[ -e "/etc/pixiu/config.json" ]]; then - cp /etc/pixiu/config.json /static/config.json + +URL=$(grep "url" /etc/pixiu/config.yaml | awk -F'url:' '{print $2}' | tr -d '[:space:]') +if [[ -z "$URL" ]]; then + URL="http://localhost:8080" fi +cat >/static/config.json << EOF +{ + "url": "${URL}" +} +EOF /app diff --git a/install.md b/install.md index 3afa8bb3..fc816f0f 100644 --- a/install.md +++ b/install.md @@ -34,6 +34,10 @@ default: # 自动创建指定模型的数据库表结构,不会更新已存在的数据库表 auto_migrate: true +# 前端配置(ip 根据实际情况调整,如果是虚拟机,则配置成虚拟机的公网IP,安全组放通80(http)或者443(https)端口) +dashboard: + url: http://localhost:8080 + # 数据库地址信息, 根据实际情况配置 mysql: host: pixiu # 数据库的ip @@ -58,13 +62,6 @@ worker: - rocky9.2 - rocky9.3 - openEuler22.03 - -# 前端配置(ip 根据实际情况调整,如果是虚拟机,则配置成虚拟机的公网IP,安全组放通80(http)或者443(https)端口) -vim /etc/pixiu/config.json -{ - "url": "http://192.168.16.156", - "watchUrl": "http://192.168.16.156" -} ``` # 启动 pixiu ```bash