如何部署Flyve MDM Dashboard?

Linux基础

1 基础知识

1.1 软件的作用

– Flyve MDM仪表板是一个集中的移动设备管理工具
– Flyve MDM仪表板需要与GLPI的Flyve MDM插件配合使用

1.2 软件的功能

– 控制和监控安全策略
– 配置和部署你的移动设备
– 安装和卸载远程应用程序
– 远程发送文件到所有终端
– 用户的账号配置
– 创建所有公司的终端库存(移动设备的库存)
– 部署和监控蓝牙和Wi-Fi连接
– 启用和禁用摄像头
– 激活终端的实时地理位置定位
– 丢失或被盗情况下,部分或全部删除你的数据

2 最佳实践

2.1 环境准备

由于“Flyve MDM Dashboard”与“GLPI的Flyve MDM插件”是配合关系,故你需先完成如下向导的配置,才能继续,
https://www.cmdschool.org/archives/6481

2.2 准备工作

2.2.1 安装辅助工具

yum install -y unzip wget git

2.2.2 配置防火墙

firewall-cmd --permanent --add-port=3000/tcp
firewall-cmd --reload
firewall-cmd --list-all

2.2.3 部署npm环境

如果你尚未部署nodejs环境,请根据如下链接部署nodejs环境
https://www.cmdschool.org/archives/7208

2.2.4 安装yarn

su - nodejs
npm install --global yarn

2.2.5 下载源代码

su - nodejs
cd ~
wget https://codeload.github.com/flyve-mdm/web-mdm-dashboard/zip/greenkeeper/%40hint/formatter-codeframe-pin-2.0.0 -O web-mdm-dashboard-greenkeeper-hint-formatter-codeframe-pin-2.0.0.zip

注:本章的要求是使用2.0.0版本

2.2.6 解压软件包

su - nodejs
cd ~
unzip web-mdm-dashboard-greenkeeper-hint-formatter-codeframe-pin-2.0.0.zip

2.2.7 重命名目录

su - nodejs
cd ~
mv web-mdm-dashboard-greenkeeper-hint-formatter-codeframe-pin-2.0.0 web-mdm-dashboard

2.3 配置软件包

2.3.1 安装依赖的软件包

su - nodejs
cd ~/web-mdm-dashboard
npm install

2.3.2 建立生产脚本

su - nodejs
cd ~/web-mdm-dashboard
yarn build

或使用如下命令亦可,

su - nodejs
cd ~/web-mdm-dashboard
npm run-script build

如果遇到以下错误提示,

yarn run v1.17.3
$ yarn lint && NODE_PATH=./src react-scripts build && node ./ci/scripts/create_htaccess.js
$ yarn eslint src --fix
$ /var/lib/nodejs/web-mdm-dashboard/node_modules/.bin/eslint src --fix

/var/lib/nodejs/web-mdm-dashboard/src/setupTests.js
  4:8  error  Unable to resolve path to module '../public/config'  import/no-unresolved

✖ 1 problem (1 error, 0 warnings)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

此错误是由于建立生产脚本需要准备配置文件,请使用如下命令创建,

cp public/config.example.js public/config.js

从范例文件复制之后,请使用如下命令定义该文件,

vim public/config.js

请修改如下参数,

window.appConfig = {
  glpiApiLink: 'http://glpi.cmdschool.org/apirest.php/',
  appName: 'MDM Dashboard',
  bugsnag: 'http://glpi.cmdschool.org/apirest.php/',
  release: {
    lastCommit: 'your_last_commit',
    currentVersion: 'current_version_of_the_application',
    buildNumber: 'the_last_build_number',
    buildUrl: 'build_url',
  },
}

注:“glpiApiLink”请在之前的GLPI系统中单击【Setup】->【General】->【API】,然后取“URL of the API”的配置

2.3.3 测试脚本

su - nodejs
cd ~/web-mdm-dashboard
npm test

如果你遇到如下错误,

Error: ENOSPC: System limit for number of file watchers reached, watch '/var/lib/nodejs/web-mdm-dashboard/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/f1/18'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1258:11)
    at NodeWatcher.watchdir (/var/lib/nodejs/web-mdm-dashboard/node_modules/sane/src/node_watcher.js:175:20)
    at Walker. (/var/lib/nodejs/web-mdm-dashboard/node_modules/sane/src/common.js:116:12)
    at Walker.emit (events.js:198:13)
    at /var/lib/nodejs/web-mdm-dashboard/node_modules/walker/lib/walker.js:69:16
    at go$readdir$cb (/var/lib/nodejs/web-mdm-dashboard/node_modules/graceful-fs/graceful-fs.js:187:14)
    at FSReqWrap.args [as oncomplete] (fs.js:140:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! Test failed.  See above for more details.

请通过如下命令解决,

sysctl -w fs.inotify.max_user_watches=524288
echo 'fs.inotify.max_user_watches = 524288' >> /etc/sysctl.d/100-nodejs.conf

2.3.4 测试脚本的运行

su - nodejs
cd ~/web-mdm-dashboard
npm start

运行命令后,我们建议你使用如下命令确认服务运行,

netstat -antp | grep node

可见如下显示,

tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      7751/node

2.3.5 测试软件运行

http://glpi.cmdschool.org:3000

注:
– 由于“Flyve MDM Dashboard”是通过“GLPI的Flyve MDM插件”的API整合,故管理账号来源于GLPI
– GLPI的默认账号和密码都是“glpi”
– 由于本章的重点是部署,故使用请参阅《入门教程

2.4 生产环境部署Dashboard

2.4.1 部署代码

scp -r /var/lib/nodejs/web-mdm-dashboard/build/ /var/www/glpi/dashboard
chown apache:apache -R /var/www/glpi/dashboard/
chmod 775 -R /var/www/glpi/dashboard/

2.4.2 测试运行

http://glpi.cmdschool.org/dashboard

参阅文档
======================

使用文档
————
http://flyve.org/web-mdm-dashboard/howtos/getting-started

安装文档
————–
http://flyve.org/web-mdm-dashboard/howtos/installation

软件的下载
————-
https://github.com/flyve-mdm/web-mdm-dashboard/archive/develop.zip
https://github.com/flyve-mdm/web-mdm-dashboard/releases

软件首页
————-
http://flyve.org/web-mdm-dashboard/

软件github
————–
https://github.com/flyve-mdm/web-mdm-dashboard

npm install yarn
——————
https://yarnpkg.com/en/docs/install#alternatives-stable

问题的修复方法
—————–
https://stackoverflow.com/questions/55763428/react-native-error-enospc-system-limit-for-number-of-file-watchers-reached

客户端下载
————–
https://github.com/flyve-mdm/android-mdm-agent/releases
http://flyve.org/android-mdm-agent/howtos/installation

部署dashboard
————–
https://www.youtube.com/watch?v=pLrqr-hHyno

没有评论

发表回复

Linux基础
如何熟悉Linux的PAM模块

1 PAM的简介 1.1 PAM的概念 – PAM即Pluggable Authenti …

Linux基础
如何配置RHEL 8.x OpenSSH客户端登录自动过期?

1 前言 一个问题,一篇文章,一出故事。 基于服务器安全,笔者需要让OpenSSH客户端在10分钟内 …

Linux基础
如何安装部署SentinelOne EDR?

1 基础知识 1.1 软件公司介绍 SentinelOne,Inc.是一家在纽约证券交易所上市的美国 …