Go语言开发灵活管理资源的开源CMDB

之前开源过一个比较灵活多云的 CMDB,只有没有时间整理部署方式,最近总是有朋友问,所以本文就介绍一下,如何部署 fiy 开源CMDB。

如果你还没有了解过,这款 CMDB,欢迎看下演示站点或者之前些的文章。

Github:https://github.com/lanyulei/fiy

演示站点:https://fdevops.com:8060

演示站点默认账号密码:admin / 123456

文章介绍:https://blog.51cto.com/u_11293981/2783015

部署

下面介绍两种部署方式,脚本一键部署和前后端分离的部署方式。

脚本一键部署的话,相当于将前端编译后放入后端的静态文件存放的位置。省去了部署及维护前端的操作,简单一些。

前后端分离的部署方式,则是通过 nginx 部署前端,同时通过 nginx 的反向代理将请求代理到后端的方式,如果对 nginx 熟悉的,可以尝试这种方式。

脚本一键部署和前后端分离的部署方式,任选其一即可。

脚本一键部署

在此感谢 @Jiang-boyang 提供的部署脚本。

部署应用程序之前,请自行部署 MySQL、ES。

拉取代码

git clone https://github.com/lanyulei/fiy.git
# 或者
git clone https://gitee.com/yllan/fiy

执行部署脚本

cd fiy
./build.sh install

部署脚本执行的过程中,会有需要确认的输入项目,仔细看下,很清晰的描述。

执行完成后,启动程序。

./build.sh start
# 或者
cd build
./fiy server -c=config/settings.yml

启动成功则表示安装成功了。

默认情况下启动端口为 8000,可通过 http://ip:port 访问。

例如:http://localhost:8000 。

前后端分离部署

后端

拉取代码

git clone https://github.com/lanyulei/fiy.git
# 或者
git clone https://gitee.com/yllan/fiy.git

配置代理

go env -w GOPROXY=https://goproxy.cn,direct

安装依赖

cd fiy
go mod tidy

编译

go build -ldflags="-s -w" -o fiy main.go

配置数据库

vim config/settings.yml
# 修改为你们自己的数据库配置。 层级:settings.database.source 。

同步基础数据

# 注意,这一步必须要数据库配置好后,才可进行后续步骤。
./fiy migrate -c config/settings.yml

启动服务

./fiy server -c config/settings.yml

服务成功启动后,后端就完事了。

前端

拉取代码

git clone https://github.com/lanyulei/fiy-ui.git
# 或者
git clone https://gitee.com/yllan/fiy-ui.git

安装依赖

cd fiy-ui
npm install # 若是慢的话,请自行下载 cnpm 尝试。

修改 env 文件,调整为当前程序的访问地址,域名或者IP+端口。

vim .env.production
# 修改 VUE_APP_BASE_API 的值为,你应用的访问地址。

编译

npm run build:prod
mkdir -p /opt/fiy-ui
mv dist /opt/fiy-ui/

若是没有安装 nginx 请自行安装配置。

以下为我的 Nginx 配置,可根据各自实际场景进行相应的调整。

端口若冲突,请自行修改为不冲突的端口。

server {
  listen 8001; # 监听端口
  server_name fdevops.com:8001; # 域名可以有多个,用空格隔开

  # access_log  /opt/fiy-ui/logs/nginx.access.log;
  # error_log  /opt/fiy-ui/logs/nginx.error.log;
  location / {
    root /opt/fiy-ui/dist;
    index index.html index.htm; #目录内的默认打开文件,如果没有匹配到index.html,则搜索index.htm,依次类推
  }

  #ssl配置省略
  location /api {
    # rewrite ^.+api/?(.*)$ /$1 break;
    proxy_pass http://127.0.0.1:8000; #node api server 即需要代理的IP地址
    proxy_redirect off;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

  # 登陆
  location /login {
    proxy_pass http://127.0.0.1:8000; #node api server 即需要代理的IP地址
    proxy_redirect off;
    proxy_ignore_client_abort on;
    proxy_max_temp_file_size 256m;
    proxy_connect_timeout      90;
    proxy_send_timeout         90;
    proxy_read_timeout         90;
    proxy_buffer_size          4k;
    proxy_buffers              4 32k;
    proxy_busy_buffers_size    32k;
    proxy_temp_file_write_size 64k;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

  # 刷新token
  location /refresh_token {
    proxy_pass http://127.0.0.1:8000; #node api server 即需要代理的IP地址
    proxy_set_header Host $host:$server_port;
  }

  # 接口地址
  location /swagger {
    proxy_pass http://127.0.0.1:8000; #node api server 即需要代理的IP地址
    proxy_set_header Host $host:$server_port;
  }

  # 后端静态文件路径
  location /static/uploadfile {
    proxy_pass http://127.0.0.1:8000; #node api server 即需要代理的IP地址
    proxy_set_header Host $host:$server_port;
  }

  #error_page  404              /404.html;    #对错误页面404.html 做了定向配置

  # redirect server error pages to the static page /50x.html
  #将服务器错误页面重定向到静态页面/50x.html
  error_page 500 502 503 504 /50x.html;
  location = /50x.html {
    root html;
  }
}

nginx 启动成功后,则可通过 http://IP:8001 的方式访问,测试。

功能介绍

展示部分功能截图,更详细具体的内容,还请自行进入演示站点查看。

演示站点:https://fdevops.com:8060

统一搜索

结合 ES 实现所有资源的统一搜索,在这里不需要关注是什么类型的资源,只需要输入关键字,即可搜索出对应关键字的数据。

Go语言开发灵活管理资源的开源CMDB

业务拓扑

根据业务划分资源数据,可清晰的看出当前业务所拥有的资源数据。

Go语言开发灵活管理资源的开源CMDB

服务模板

服务有那些进程及进程的一些基本信息,例如:进程重启命令、进程停止命令、进程重载命令、工作用户、启动数量等等。

Go语言开发灵活管理资源的开源CMDB

资源目录

所有资源的一个汇总,通过这里可以进入对应的资源列表页面。

Go语言开发灵活管理资源的开源CMDB

资源列表

Go语言开发灵活管理资源的开源CMDB

批量导入资源

Go语言开发灵活管理资源的开源CMDB

云资源

云账号添加,方便进行云资源的同步,目前支持百度云、阿里云、腾讯云。

Go语言开发灵活管理资源的开源CMDB

配置云资源同步的任务。

Go语言开发灵活管理资源的开源CMDB

模型管理

模型管理,即通过模型及配置的模型字段,添加对应的数据。能更加灵活的让我们管理我们的资源,需要什么资源就创建对应的模型即可。

语言描述的有点苍白,可看下面的截图或者演示站点上去点击测试,更能容易理解。

Go语言开发灵活管理资源的开源CMDB

模型字段

Go语言开发灵活管理资源的开源CMDB

编辑字段

Go语言开发灵活管理资源的开源CMDB

模型关系

通过配置模型之间的上下游关系,自动生成对应的模型关系图。

Go语言开发灵活管理资源的开源CMDB

操作审计

用户的增删改操作,统统记录下来,方便排查及修复误操作的数据。

Go语言开发灵活管理资源的开源CMDB

本次操作的新旧数据对比

Go语言开发灵活管理资源的开源CMDB

更多功能,就不一一介绍了。可自行进行演示站点体验。

本文为原创文章,未经授权禁止转载本站文章。
原文出处:兰玉磊的个人博客
原文链接:https://www.fdevops.com/2022/04/16/go-cmdb-31077
版权:本文采用「署名-非商业性使用-相同方式共享 4.0 国际」知识共享许可协议进行许可。

(37)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
兰玉磊兰玉磊
上一篇 2022年4月10日
下一篇 2022年6月26日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

评论列表(36条)

  • 大鱼
    大鱼 2022年4月28日 16:17

    部署完成后,数据权限也开了 为什么增删改都是403

    • 兰玉磊
      兰玉磊 2022年4月28日 16:22

      @大鱼具体报错,发下。

    • 大鱼
      大鱼 2022年4月28日 16:24

      @兰玉磊例如新增用户
      Request URL: http://10.13.30.163:8060/api/v1/configKey
      Request Method: POST
      Status Code: 403 Forbidden
      Remote Address: 10.13.30.163:8060
      Referrer Policy: strict-origin-when-cross-origin

    • 大鱼
      大鱼 2022年4月28日 17:07

      @兰玉磊Request failed with status code 403。fiy服务日志没有报错
      demo环境也有这个问题

    • 兰玉磊
      兰玉磊 2022年4月28日 17:12

      @大鱼demo 环境,我是在 nginx 层面,禁止非 GET 请求了。

    • 大鱼
      大鱼 2022年4月29日 08:48

      @兰玉磊去掉后可以了,部署文档中的nginx禁止非 GET 请求配置要去掉一下

    • 兰玉磊
      兰玉磊 2022年4月29日 09:34

      @大鱼嗯呐。

  • firfly
    firfly 2022年5月6日 12:21

    为何我按照脚本一键部署后,admin登录了只有个欢迎页面,menu栏只有首页,没有其他内容?what I missed?

    • qq
      qq 2022年10月21日 09:17

      @firfly我也是 解决了吗

    • qq
      qq 2022年10月21日 09:34

      @firflyfiy/config/sql/下有2个sql文件需要手动执行一下,一键部署没有自动执行

  • Dnld
    Dnld 2022年5月10日 09:50

    请问大佬,服务模板和业务拓扑是怎么关联起来的?

  • xc
    xc 2022年5月11日 18:32

    资源管理–>业务–>业务拓扑 报错:[error] unsupported data type: &[]
    /fiy/app/cmdb/apis/business/topology.go:48;/fiy/app/cmdb/apis/business/topology.go:67
    什么原因呢

  • 大G
    大G 2022年5月17日 09:39

    你好,前后端分离编译,启动后端服务报错,panic: html/template: pattern matches no files: `static/ui/index.html` 原因是什么呢?

    • 高文
      高文 2022年6月4日 12:57

      @大G我也是这个问题,请问解决了吗?

    • 小智
      小智 2022年6月22日 09:50

      @高文项目里面的node-sass用的是4.14.x,根据这个https://www.npmjs.com/package/node-sass 得知 .最好用node14版本好一些,建议用docker node:14-alpine 这个镜像来编译,一次性编译通过,有需要的小伙伴可以使用 lz270978971/fiy-ui:latest 这个镜像,源码默认在/root/home 下面,可以配置好后,直接编译,编译好后,放到static/ui 目录下

    • chtuser
      chtuser 2023年5月11日 16:16

      @大G问题解决了么

  • bruse-zhou
    bruse-zhou 2022年5月27日 10:54

    大佬,有没有兴趣开个课啥的

  • xmlg
    xmlg 2022年6月10日 11:02

    后期还会增加新的功能嘛,首页这个还需要几个 展示图

  • 王浩
    王浩 2022年6月30日 14:01

    求助一波,我cnpm install 报错:
    make: Entering directory `/root/cmdb/fiy-ui/node_modules/_node-sass@4.14.1@node-sass/build’
    g++ ‘-DNODE_GYP_MODULE_NAME=libsass’ ‘-DUSING_UV_SHARED=1’ ‘-DUSING_V8_SHARED=1’ ‘-DV8_DEPRECATION_WARNINGS=1’ ‘-DV8_DEPRECATION_WARNINGS’ ‘-DV8_IMMINENT_DEPRECATION_WARNINGS’ ‘-D_GLIBCXX_USE_CXX11_ABI=1’ ‘-D_LARGEFILE_SOURCE’ ‘-D_FILE_OFFSET_BITS=64’ ‘-D__STDC_FORMAT_MACROS’ ‘-DOPENSSL_NO_PINSHARED’ ‘-DOPENSSL_THREADS’ ‘-DLIBSASS_VERSION=”3.5.5″‘ -I/root/.node-gyp/16.15.1/include/node -I/root/.node-gyp/16.15.1/src -I/root/.node-gyp/16.15.1/deps/openssl/config -I/root/.node-gyp/16.15.1/deps/openssl/openssl/include -I/root/.node-gyp/16.15.1/deps/uv/include -I/root/.node-gyp/16.15.1/deps/zlib -I/root/.node-gyp/16.15.1/deps/v8/include -I../src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
    g++: error: unrecognized command line option ‘-std=gnu++14’
    make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Error 1
    make: Leaving directory `/root/cmdb/fiy-ui/node_modules/_node-sass@4.14.1@node-sass/build’
    gyp ERR! build error
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack at ChildProcess.onExit (/root/cmdb/fiy-ui/node_modules/_node-gyp@3.8.0@node-gyp/lib/build.js:262:23)
    gyp ERR! stack at ChildProcess.emit (node:events:527:28)
    gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    gyp ERR! System Linux 3.10.0-957.el7.x86_64
    gyp ERR! command “/opt/node-v16.15.1-linux-x64/bin/node” “/root/cmdb/fiy-ui/node_modules/_node-gyp@3.8.0@node-gyp/bin/node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=”
    gyp ERR! cwd /root/cmdb/fiy-ui/node_modules/_node-sass@4.14.1@node-sass
    gyp ERR! node -v v16.15.1
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok
    Build failed with error code: 1
    [npminstall:runscript:error] node-sass@^4.14.1 scripts.postinstall run “node scripts/build.js” error: Error [RunScriptError]: Run “sh -c node scripts/build.js” error, exit code 1
    at ChildProcess. (/opt/node-v16.15.1-linux-x64/lib/node_modules/cnpm/node_modules/runscript/index.js:96:21)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
    stdio: [Object],
    exitcode: 1
    }
    ✖ Install fail! RunScriptError: post install error, please remove node_modules before retry!
    Run “sh -c node scripts/build.js” error, exit code 1
    RunScriptError: Run “sh -c node scripts/build.js” error, exit code 1
    at ChildProcess. (/opt/node-v16.15.1-linux-x64/lib/node_modules/cnpm/node_modules/runscript/index.js:96:21)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

    • 兰玉磊
      兰玉磊 2022年7月1日 11:21

      @王浩试试这个呢,npm uninstall node-sass && npm i -D sass –registry=https://registry.npmmirror.com

    • chen
      chen 2022年12月13日 17:20

      @王浩解决了吗,我一直安装失败,卸载后安装saas,前端启动失败

    • liu
      liu 2023年5月5日 16:02

      @chen怎么解决呢

  • 4019
    4019 2022年8月19日 16:23

    大佬,前后端分离部署后,登录界面无法获取验证码,显示服务器连接异常,请检查服务器!请问怎么解决呢

    • A
      A 2022年11月10日 21:01

      @4019大哥,你解决了吗,同样的问题

  • E=mc²
    E=mc² 2022年10月10日 11:18

    您好,统一搜索功能使用不了,提示“服务器连接异常,请检查服务器!”,日志如下,请问咋解决
    2022-10-10 11:17:05 file=middleware/permission.go:27 level=info msgID[93479350-8dc4-4b0f-b61f-8a28224b4e9b] info:admin method:GET path:/api/v1/cmdb/search
    2022/10/10 11:17:05 http: panic serving 10.0.61.13:54118: runtime error: invalid memory address or nil pointer dereference
    goroutine 71 [running]:
    net/http.(*conn).serve.func1()
    /usr/local/go/src/net/http/server.go:1850 +0xbf
    panic({0x15e1500, 0x3ea77a0})
    /usr/local/go/src/runtime/panic.go:890 +0x262
    fiy/common/middleware.CustomError.func1()
    /root/fiy/common/middleware/customerror.go:45 +0x43a
    panic({0x15e1500, 0x3ea77a0})
    /usr/local/go/src/runtime/panic.go:884 +0x212
    github.com/olivere/elastic/v7.(*Client).PerformRequest(0x0, {0x1b1eb30?, 0xc000112000}, {{0x188d48b, 0x4}, {0xc0006b1080, 0x1b}, 0xc0007fb050, {0x15d2760, 0xc0007fb0b0}, …})
    /root/go/pkg/mod/github.com/olivere/elastic/v7@v7.0.24/client.go:1312 +0xfd
    github.com/olivere/elastic/v7.(*SearchService).Do(0xc00245f2a0, {0x1b1eb30, 0xc000112000})
    /root/go/pkg/mod/github.com/olivere/elastic/v7@v7.0.24/search.go:627 +0x150
    fiy/pkg/es.EsClientType.Query({0xc0003a9065?}, {0x1535d20?, 0xc000781a80?}, 0x0, 0x1)
    /root/fiy/pkg/es/es.go:78 +0x3f0
    fiy/app/cmdb/apis/search.GetData(0x18bb8de?)
    /root/fiy/app/cmdb/apis/search/search.go:36 +0xdf
    github.com/gin-gonic/gin.(*Context).Next(…)
    /root/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161
    fiy/common/middleware.AuthCheckRole.func1(0xc00044e000)
    /root/fiy/common/middleware/permission.go:37 +0x5f0
    github.com/gin-gonic/gin.(*Context).Next(…)
    /root/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161
    fiy/pkg/jwtauth.(*GinJWTMiddleware).middlewareImpl(0xc00010cf00, 0xc00044e000)
    /root/fiy/pkg/jwtauth/jwtauth.go:408 +0x338
    fiy/app/cmdb/router.RegisterCmdbSearchRouter.func1(0xc00044e000?)
    /root/fiy/pkg/jwtauth/jwtauth.go:371 +0x25
    github.com/gin-gonic/gin.(*Context).Next(…)
    /root/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161
    fiy/common/middleware.Trace.func1(0xc00044e000)
    /root/fiy/common/middleware/trace.go:24 +0x179
    github.com/gin-gonic/gin.(*Context).Next(…)
    /root/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161
    fiy/common/middleware.Options(0xc00044e000)
    /root/fiy/common/middleware/header.go:24 +0x11a
    github.com/gin-gonic/gin.(*Context).Next(…)

    • 兰玉磊
      兰玉磊 2022年10月15日 00:42

      @E=mc²需要配合 es 一起使用。

    • astranagun
      astranagun 2023年1月31日 16:17

      @兰玉磊我也遇到这个问题,但是我es是好的,我用6.8.5的版本和7.17.8的版本ES都报这个错误。但是我ES是能正常使用的

    • 兰玉磊
      兰玉磊 2023年2月5日 23:31

      @astranagun配置文件中es配置完善了么,还有就是需要配置的 mysql 到 es 的同步,这个也 OK 么?

  • scott
    scott 2022年11月9日 14:17

    Demo进去不了啊

  • A
    A 2022年11月10日 19:20

    求助一下,npm install 报错,npm版本换了好几次
    root@localhost fiy-ui]# npm install
    npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
    npm WARN deprecated fsevents@2.1.3: “Please update to latest v2.3 or v2.2”
    npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

    > node-sass@4.14.1 install /data/fiy-ui/node_modules/node-sass
    > node scripts/install.js

    Unable to save binary /data/fiy-ui/node_modules/node-sass/vendor/linux-x64-83 : Error: EACCES: permission denied, mkdir ‘/data/fiy-ui/node_modules/node-sass/vendor’
    at Object.mkdirSync (fs.js:1014:3)
    at sync (/data/fiy-ui/node_modules/node-sass/node_modules/mkdirp/index.js:74:13)
    at Function.sync (/data/fiy-ui/node_modules/node-sass/node_modules/mkdirp/index.js:80:24)
    at checkAndDownloadBinary (/data/fiy-ui/node_modules/node-sass/scripts/install.js:114:11)
    at Object. (/data/fiy-ui/node_modules/node-sass/scripts/install.js:157:1)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
    errno: -13,
    syscall: ‘mkdir’,
    code: ‘EACCES’,
    path: ‘/data/fiy-ui/node_modules/node-sass/vendor’
    }

    > node-sass@4.14.1 postinstall /data/fiy-ui/node_modules/node-sass
    > node scripts/build.js

    Building: /data/node/bin/node /data/fiy-ui/node_modules/node-gyp/bin/node-gyp.js rebuild –verbose –libsass_ext= –libsass_cflags= –libsass_ldflags= –libsass_library=
    gyp info it worked if it ends with ok
    gyp verb cli [
    gyp verb cli ‘/data/node/bin/node’,
    gyp verb cli ‘/data/fiy-ui/node_modules/node-gyp/bin/node-gyp.js’,
    gyp verb cli ‘rebuild’,
    gyp verb cli ‘–verbose’,
    gyp verb cli ‘–libsass_ext=’,
    gyp verb cli ‘–libsass_cflags=’,
    gyp verb cli ‘–libsass_ldflags=’,
    gyp verb cli ‘–libsass_library=’
    gyp verb cli ]
    gyp info using node-gyp@3.8.0
    gyp info using node@14.21.1 | linux | x64
    gyp verb command rebuild []
    gyp verb command clean []
    gyp verb clean removing “build” directory
    gyp verb command configure []
    gyp verb check python checking for Python executable “python2” in the PATH
    gyp verb `which` succeeded python2 /usr/bin/python2
    gyp verb check python version `/usr/bin/python2 -c “import sys; print “2.7.5
    gyp verb check python version .%s.%s” % sys.version_info[:3];”` returned: %j
    gyp verb get node dir no –target version specified, falling back to host node version: 14.21.1
    gyp verb command install [ ‘14.21.1’ ]
    gyp verb install input version string “14.21.1”
    gyp verb install installing version: 14.21.1
    gyp verb install –ensure was passed, so won’t reinstall if already installed
    gyp verb install version not already installed, continuing with install 14.21.1
    gyp verb ensuring nodedir is created /root/.node-gyp/14.21.1
    gyp WARN EACCES user “root” does not have permission to access the dev dir “/root/.node-gyp/14.21.1”
    gyp WARN EACCES attempting to reinstall using temporary dev dir “/data/fiy-ui/node_modules/node-sass/.node-gyp”
    gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
    gyp verb command install [ ‘–node_gyp_internal_noretry’, ‘14.21.1’ ]
    gyp verb install input version string “14.21.1”
    gyp verb install installing version: 14.21.1
    gyp verb install –ensure was passed, so won’t reinstall if already installed
    gyp verb install version not already installed, continuing with install 14.21.1
    gyp verb ensuring nodedir is created /data/fiy-ui/node_modules/node-sass/.node-gyp/14.21.1
    gyp WARN install got an error, rolling back install
    gyp verb command remove [ ‘14.21.1’ ]
    gyp verb remove using node-gyp dir: /data/fiy-ui/node_modules/node-sass/.node-gyp
    gyp verb remove removing target version: 14.21.1
    gyp verb remove removing development files for version: 14.21.1
    gyp WARN install got an error, rolling back install
    gyp verb command remove [ ‘14.21.1’ ]
    gyp verb remove using node-gyp dir: /data/fiy-ui/node_modules/node-sass/.node-gyp
    gyp verb remove removing target version: 14.21.1
    gyp verb remove removing development files for version: 14.21.1
    gyp ERR! configure error
    gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/data/fiy-ui/node_modules/node-sass/.node-gyp’
    gyp ERR! System Linux 3.10.0-1160.76.1.el7.x86_64
    gyp ERR! command “/data/node/bin/node” “/data/fiy-ui/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=”
    gyp ERR! cwd /data/fiy-ui/node_modules/node-sass
    gyp ERR! node -v v14.21.1
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok
    Build failed with error code: 1
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”linux”,”arch”:”x64″})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”linux”,”arch”:”x64″})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/jest-haste-map/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”linux”,”arch”:”x64″})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”linux”,”arch”:”x64″})
    npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.18.9 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.
    npm WARN @babel/plugin-proposal-class-static-block@7.18.6 requires a peer of @babel/core@^7.12.0 but none is installed. You must install peer dependencies yourself.
    npm WARN @vue/cli-plugin-eslint@4.5.19 requires a peer of eslint@>= 1.6.0 =1.6.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN eslint-plugin-vue@6.2.2 requires a peer of eslint@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN The package vue-quill-editor is included as both a dev and production dependency.

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the node-sass@4.14.1 postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /root/.npm/_logs/2022-11-10T11_18_26_476Z-debug.log

  • A
    A 2022年11月11日 10:58

    磊哥,前后端分离部署后,登录界面无法获取验证码,显示服务器连接异常,请检查服务器!请问怎么解决呢

  • falconxb
    falconxb 2023年6月14日 14:09

    大神,前后端分离部署,后端启动服务报这个粗哦,如何解决呀

    warning config not found settings.ssl in the configuration
    2023-06-14 14:01:51 file=database/mysql_drive.go:46 level=info mysql connect success !
    2023-06-14 14:01:51 file=api/server.go:73 level=info starting api server
    [GIN-debug] [WARNING] Running in “debug” mode. Switch to “release” mode in production.
    – using env: export GIN_MODE=release
    – using code: gin.SetMode(gin.ReleaseMode)

    [GIN-debug] [WARNING] Running in “debug” mode. Switch to “release” mode in production.
    – using env: export GIN_MODE=release
    – using code: gin.SetMode(gin.ReleaseMode)

    2023-06-14 14:01:51 file=sync_cloud/start.go:161 level=info Start syncing cloud resource data…
    2023/06/14 14:01:51 logging.go:127: [default] [INFO] [SystemRuleManager] System rules loaded: map[inboundQPS:[{“metricType”:3,”triggerCount”:200,”strategy”:1}]]
    2023/06/14 14:01:51 websocket manage start
    [GIN-debug] GET / –> fiy/app/admin/apis/system.Index (9 handlers)
    [GIN-debug] GET /info –> fiy/common/middleware/handler.Ping (9 handlers)
    [GIN-debug] GET /static/*filepath –> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (9 handlers)
    [GIN-debug] HEAD /static/*filepath –> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (9 handlers)
    panic: html/template: pattern matches no files: `static/ui/index.html`

    goroutine 1 [running]:
    html/template.Must(…)
    /usr/lib/golang/src/html/template/template.go:368
    github.com/gin-gonic/gin.(*Engine).LoadHTMLGlob(0xc0003a8500, {0x18dbdd3, 0x14})
    /root/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/gin.go:185 +0x2fc
    fiy/common/router.sysStaticFileRouter(0xc0003a8500?, 0x0?)
    /root/fiy/common/router/sysrouter.go:46 +0x4c
    fiy/common/router.InitSysRouter(0xc0003a8500, 0x0?)
    /root/fiy/common/router/sysrouter.go:24 +0x4a
    fiy/common/router.InitRouter()
    /root/fiy/common/router/initrouter.go:44 +0x1d4
    fiy/cmd/api.run()
    /root/fiy/cmd/api/server.go:109 +0x202
    fiy/cmd/api.glob..func2(0x2cfed80?, {0x18c4eda?, 0x2?, 0x2?})
    /root/fiy/cmd/api/server.go:42 +0x17
    github.com/spf13/cobra.(*Command).execute(0x2cfed80, {0xc000052240, 0x2, 0x2})
    /root/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x67c
    github.com/spf13/cobra.(*Command).ExecuteC(0x2cfeae0)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x39d
    github.com/spf13/cobra.(*Command).Execute(…)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
    fiy/cmd.Execute()
    /root/fiy/cmd/cobra.go:49 +0x25
    main.main()
    /root/fiy/main.go:8 +0x17

  • limi
    limi 2023年10月30日 16:34

    现在项目不开源了吗,我怎么找不到源码了,我想看下模型是怎么设计的