filecat 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -201
- package/README.md +69 -71
- package/build/dist/859.bundle.js +1 -1
- package/build/dist/859.bundle.js.LICENSE.txt +1 -1
- package/build/dist/916.bundle.js +1 -1
- package/build/dist/943.bundle.js +1 -1
- package/build/dist/977.bundle.js +1 -1
- package/build/dist/bundle.js +1 -1
- package/build/dist/excalidraw-assets/vendor-677e88ca78c86bddf13d.js +1 -1
- package/build/dist/filerobot-image-editor.min.js +42445 -42445
- package/build/dist/rle.js +17867 -17867
- package/build/main.js +30 -30
- package/build/wintun-amd64.dll +0 -0
- package/env +16 -16
- package/package.json +153 -152
- package/shell/build.js +102 -101
- package/shell/config/.babelrc +10 -10
- package/shell/config/prebuild-file-path.js +17 -17
- package/shell/config/webpack.config.js +71 -71
- package/shell/config/webpack.docker.config.js +62 -62
- package/shell/config/webpack.npm.config.js +64 -62
- package/shell/config/webpack.pkg.config.js +62 -62
- package/shell/dev.js +51 -51
- package/shell/docker-build.sh +2 -2
- package/shell/filecat +1 -1
- package/shell/install.js +48 -48
- package/shell/restart.sh +29 -29
|
Binary file
|
package/env
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
#服务器端口
|
|
3
|
-
#server port
|
|
4
|
-
port=5567
|
|
5
|
-
# 文件夹起始地址 文件管理的默认地址,不填的话会是执行程序的目录
|
|
6
|
-
# The starting folder address, the default address for file management. If not specified, it will be the directory of the executing program.
|
|
7
|
-
#base_folder=D:\ 或者 /home/user
|
|
8
|
-
|
|
9
|
-
# 本地账号密码
|
|
10
|
-
username=admin
|
|
11
|
-
password=admin
|
|
12
|
-
|
|
13
|
-
# 该程序需要一个目录来存放数据,最好是空目录
|
|
14
|
-
# The program requires a directory to store data, preferably an empty directory.
|
|
15
|
-
#work_dir=D:\data 或者 /home
|
|
16
|
-
|
|
1
|
+
|
|
2
|
+
#服务器端口
|
|
3
|
+
#server port
|
|
4
|
+
port=5567
|
|
5
|
+
# 文件夹起始地址 文件管理的默认地址,不填的话会是执行程序的目录
|
|
6
|
+
# The starting folder address, the default address for file management. If not specified, it will be the directory of the executing program.
|
|
7
|
+
#base_folder=D:\ 或者 /home/user
|
|
8
|
+
|
|
9
|
+
# 本地账号密码
|
|
10
|
+
username=admin
|
|
11
|
+
password=admin
|
|
12
|
+
|
|
13
|
+
# 该程序需要一个目录来存放数据,最好是空目录
|
|
14
|
+
# The program requires a directory to store data, preferably an empty directory.
|
|
15
|
+
#work_dir=D:\data 或者 /home
|
|
16
|
+
|
package/package.json
CHANGED
|
@@ -1,152 +1,153 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "filecat",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "filecat 文件管理器",
|
|
5
|
-
"author": "xiaobaidadada",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "node --require ts-node/register ./shell/dev.js --env ./env",
|
|
8
|
-
"server-debug-js": "tsc && node build/server/main/server.js --env ./env",
|
|
9
|
-
"server-dev-inspect": "node --inspect=0.0.0.0:9001 --require ts-node/register ./shell/dev.js --env ./env",
|
|
10
|
-
"server-dev": "node --require ts-node/register ./src/main/server.ts --env ./env",
|
|
11
|
-
"webpack-dev": "npx webpack serve --mode development --config shell/config/webpack.config.js",
|
|
12
|
-
"generate-proto": "node --require ts-node/register ./src/common/proto/proto.generate.ts",
|
|
13
|
-
"hot-server-dev": "node --require ts-node/register ./src/main/piping.main.ts ",
|
|
14
|
-
"webpack-build": "npx webpack --config shell/config/webpack.config.js",
|
|
15
|
-
"i-dev": "npm i --omit=dev",
|
|
16
|
-
"build": "npm run npm-build",
|
|
17
|
-
"npm-build": "tsc && node shell/build.js npm",
|
|
18
|
-
"docker-build": "tsc && node shell/build.js docker",
|
|
19
|
-
"pkg-build": "tsc && node shell/build.js pkg",
|
|
20
|
-
"start": "node build/main.js",
|
|
21
|
-
"pkg-win-amd64": "npm run pkg-build && pkg . --no-dependencies --targets node18-win-x64 --output filecat-win.exe",
|
|
22
|
-
"pkg-linux-amd64": "npm run pkg-build && pkg . --no-dependencies --targets node18-linux-x64 --output filecat-linux"
|
|
23
|
-
},
|
|
24
|
-
"pkg": {
|
|
25
|
-
"assets": [
|
|
26
|
-
"build/**/**"
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
"bin": {
|
|
30
|
-
"filecat": "shell/filecat"
|
|
31
|
-
},
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "git@github.com:xiaobaidadada/filecat.git"
|
|
35
|
-
},
|
|
36
|
-
"homepage": "https://github.com/xiaobaidadada/filecat",
|
|
37
|
-
"bugs": {
|
|
38
|
-
"url": "https://github.com/xiaobaidadada/filecat/issues"
|
|
39
|
-
},
|
|
40
|
-
"license": "Apache-2.0",
|
|
41
|
-
"keywords": [
|
|
42
|
-
"文件服务器",
|
|
43
|
-
"linux管理",
|
|
44
|
-
"运维面板",
|
|
45
|
-
"远程桌面",
|
|
46
|
-
"浏览器代理",
|
|
47
|
-
"简洁",
|
|
48
|
-
"filebrowser",
|
|
49
|
-
"administrator",
|
|
50
|
-
"filemanager",
|
|
51
|
-
"cpu",
|
|
52
|
-
"docker",
|
|
53
|
-
"linux",
|
|
54
|
-
"rdp",
|
|
55
|
-
"rtsp",
|
|
56
|
-
"react",
|
|
57
|
-
"ssh",
|
|
58
|
-
"ftp",
|
|
59
|
-
"systeminfo",
|
|
60
|
-
"vpn",
|
|
61
|
-
"p2p",
|
|
62
|
-
"docker",
|
|
63
|
-
"ddns"
|
|
64
|
-
],
|
|
65
|
-
"files": [
|
|
66
|
-
"build/**/*",
|
|
67
|
-
"shell",
|
|
68
|
-
"env",
|
|
69
|
-
"LICENSE.txt",
|
|
70
|
-
"README.md",
|
|
71
|
-
"package.json"
|
|
72
|
-
],
|
|
73
|
-
"dependencies": {
|
|
74
|
-
"@xiaobaidadada/node-pty-prebuilt": "^1.0.4",
|
|
75
|
-
"@xiaobaidadada/node-tuntap2-wintun": "^1.0.6",
|
|
76
|
-
"
|
|
77
|
-
"node-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"@babel/
|
|
82
|
-
"@babel/
|
|
83
|
-
"@babel/preset-
|
|
84
|
-
"@babel/preset-
|
|
85
|
-
"@
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
88
|
-
"@xterm/addon-fit": "^0.10.0",
|
|
89
|
-
"@xterm/xterm": "^5.5.0",
|
|
90
|
-
"ace-builds": "^1.32.9",
|
|
91
|
-
"archiver": "^7.0.1",
|
|
92
|
-
"axios": "^1.7.7",
|
|
93
|
-
"babel-loader": "^9.1.3",
|
|
94
|
-
"chart.js": "^4.4.2",
|
|
95
|
-
"copy-webpack-plugin": "^12.0.2",
|
|
96
|
-
"css-loader": "^6.10.0",
|
|
97
|
-
"fluent-ffmpeg": "^2.1.3",
|
|
98
|
-
"flv.js": "^1.6.2",
|
|
99
|
-
"fs-extra": "^11.2.0",
|
|
100
|
-
"github-markdown-css": "^5.6.1",
|
|
101
|
-
"html-webpack-plugin": "^5.6.0",
|
|
102
|
-
"http-proxy-middleware": "^3.0.3",
|
|
103
|
-
"i18next": "^23.12.2",
|
|
104
|
-
"koa-proxies": "^0.12.4",
|
|
105
|
-
"listr2": "^8.2.1",
|
|
106
|
-
"lodash": "^4.17.21",
|
|
107
|
-
"markdown-it": "^14.1.0",
|
|
108
|
-
"markdown-it-emoji": "^3.0.0",
|
|
109
|
-
"markdown-it-footnote": "^4.0.0",
|
|
110
|
-
"markdown-it-sub": "^2.0.0",
|
|
111
|
-
"markdown-it-sup": "^2.0.0",
|
|
112
|
-
"markdown-it-task-lists": "^2.1.1",
|
|
113
|
-
"material-icons": "^1.13.12",
|
|
114
|
-
"mime-types": "^2.1.35",
|
|
115
|
-
"needle": "^3.3.1",
|
|
116
|
-
"node-forge": "^1.3.1",
|
|
117
|
-
"node-loader": "^2.1.0",
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"react
|
|
125
|
-
"react-
|
|
126
|
-
"react-
|
|
127
|
-
"react-
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"webpack
|
|
147
|
-
"webpack-
|
|
148
|
-
"webpack-
|
|
149
|
-
"webpack-
|
|
150
|
-
"
|
|
151
|
-
|
|
152
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "filecat",
|
|
3
|
+
"version": "1.0.14",
|
|
4
|
+
"description": "filecat 文件管理器",
|
|
5
|
+
"author": "xiaobaidadada",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "node --require ts-node/register ./shell/dev.js --env ./env",
|
|
8
|
+
"server-debug-js": "tsc && node build/server/main/server.js --env ./env",
|
|
9
|
+
"server-dev-inspect": "node --inspect=0.0.0.0:9001 --require ts-node/register ./shell/dev.js --env ./env",
|
|
10
|
+
"server-dev": "node --require ts-node/register ./src/main/server.ts --env ./env",
|
|
11
|
+
"webpack-dev": "npx webpack serve --mode development --config shell/config/webpack.config.js",
|
|
12
|
+
"generate-proto": "node --require ts-node/register ./src/common/proto/proto.generate.ts",
|
|
13
|
+
"hot-server-dev": "node --require ts-node/register ./src/main/piping.main.ts ",
|
|
14
|
+
"webpack-build": "npx webpack --config shell/config/webpack.config.js",
|
|
15
|
+
"i-dev": "npm i --omit=dev",
|
|
16
|
+
"build": "npm run npm-build",
|
|
17
|
+
"npm-build": "tsc && node shell/build.js npm",
|
|
18
|
+
"docker-build": "tsc && node shell/build.js docker",
|
|
19
|
+
"pkg-build": "tsc && node shell/build.js pkg",
|
|
20
|
+
"start": "node build/main.js",
|
|
21
|
+
"pkg-win-amd64": "npm run pkg-build && pkg . --no-dependencies --targets node18-win-x64 --output filecat-win.exe",
|
|
22
|
+
"pkg-linux-amd64": "npm run pkg-build && pkg . --no-dependencies --targets node18-linux-x64 --output filecat-linux"
|
|
23
|
+
},
|
|
24
|
+
"pkg": {
|
|
25
|
+
"assets": [
|
|
26
|
+
"build/**/**"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"bin": {
|
|
30
|
+
"filecat": "shell/filecat"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git@github.com:xiaobaidadada/filecat.git"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/xiaobaidadada/filecat",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/xiaobaidadada/filecat/issues"
|
|
39
|
+
},
|
|
40
|
+
"license": "Apache-2.0",
|
|
41
|
+
"keywords": [
|
|
42
|
+
"文件服务器",
|
|
43
|
+
"linux管理",
|
|
44
|
+
"运维面板",
|
|
45
|
+
"远程桌面",
|
|
46
|
+
"浏览器代理",
|
|
47
|
+
"简洁",
|
|
48
|
+
"filebrowser",
|
|
49
|
+
"administrator",
|
|
50
|
+
"filemanager",
|
|
51
|
+
"cpu",
|
|
52
|
+
"docker",
|
|
53
|
+
"linux",
|
|
54
|
+
"rdp",
|
|
55
|
+
"rtsp",
|
|
56
|
+
"react",
|
|
57
|
+
"ssh",
|
|
58
|
+
"ftp",
|
|
59
|
+
"systeminfo",
|
|
60
|
+
"vpn",
|
|
61
|
+
"p2p",
|
|
62
|
+
"docker",
|
|
63
|
+
"ddns"
|
|
64
|
+
],
|
|
65
|
+
"files": [
|
|
66
|
+
"build/**/*",
|
|
67
|
+
"shell",
|
|
68
|
+
"env",
|
|
69
|
+
"LICENSE.txt",
|
|
70
|
+
"README.md",
|
|
71
|
+
"package.json"
|
|
72
|
+
],
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"@xiaobaidadada/node-pty-prebuilt": "^1.0.4",
|
|
75
|
+
"@xiaobaidadada/node-tuntap2-wintun": "^1.0.6",
|
|
76
|
+
"@xiaobaidadada/ssh2-prebuilt": "^1.16.0",
|
|
77
|
+
"node-process-watcher": "^1.0.3"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@babel/core": "^7.24.3",
|
|
81
|
+
"@babel/plugin-proposal-decorators": "^7.24.1",
|
|
82
|
+
"@babel/preset-env": "^7.24.3",
|
|
83
|
+
"@babel/preset-react": "^7.24.1",
|
|
84
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
85
|
+
"@excalidraw/excalidraw": "^0.17.6",
|
|
86
|
+
"@koa/cors": "^5.0.0",
|
|
87
|
+
"@xiaobaidadada/prebuild": "^13.0.1-7",
|
|
88
|
+
"@xterm/addon-fit": "^0.10.0",
|
|
89
|
+
"@xterm/xterm": "^5.5.0",
|
|
90
|
+
"ace-builds": "^1.32.9",
|
|
91
|
+
"archiver": "^7.0.1",
|
|
92
|
+
"axios": "^1.7.7",
|
|
93
|
+
"babel-loader": "^9.1.3",
|
|
94
|
+
"chart.js": "^4.4.2",
|
|
95
|
+
"copy-webpack-plugin": "^12.0.2",
|
|
96
|
+
"css-loader": "^6.10.0",
|
|
97
|
+
"fluent-ffmpeg": "^2.1.3",
|
|
98
|
+
"flv.js": "^1.6.2",
|
|
99
|
+
"fs-extra": "^11.2.0",
|
|
100
|
+
"github-markdown-css": "^5.6.1",
|
|
101
|
+
"html-webpack-plugin": "^5.6.0",
|
|
102
|
+
"http-proxy-middleware": "^3.0.3",
|
|
103
|
+
"i18next": "^23.12.2",
|
|
104
|
+
"koa-proxies": "^0.12.4",
|
|
105
|
+
"listr2": "^8.2.1",
|
|
106
|
+
"lodash": "^4.17.21",
|
|
107
|
+
"markdown-it": "^14.1.0",
|
|
108
|
+
"markdown-it-emoji": "^3.0.0",
|
|
109
|
+
"markdown-it-footnote": "^4.0.0",
|
|
110
|
+
"markdown-it-sub": "^2.0.0",
|
|
111
|
+
"markdown-it-sup": "^2.0.0",
|
|
112
|
+
"markdown-it-task-lists": "^2.1.1",
|
|
113
|
+
"material-icons": "^1.13.12",
|
|
114
|
+
"mime-types": "^2.1.35",
|
|
115
|
+
"needle": "^3.3.1",
|
|
116
|
+
"node-forge": "^1.3.1",
|
|
117
|
+
"node-loader": "^2.1.0",
|
|
118
|
+
"node-unrar-js": "^2.0.2",
|
|
119
|
+
"normalize.css": "^8.0.1",
|
|
120
|
+
"noty": "^3.2.0-beta-deprecated",
|
|
121
|
+
"piping": "^1.0.0-rc.4",
|
|
122
|
+
"pkg": "^5.8.1",
|
|
123
|
+
"protobufjs-cli": "^1.1.3",
|
|
124
|
+
"react": "^18.3.1",
|
|
125
|
+
"react-ace": "^12.0.0",
|
|
126
|
+
"react-dom": "^18.3.1",
|
|
127
|
+
"react-i18next": "^15.0.0",
|
|
128
|
+
"react-router-dom": "^6.26.2",
|
|
129
|
+
"recoil": "^0.7.7",
|
|
130
|
+
"reflect-metadata": "^0.2.1",
|
|
131
|
+
"rimraf": "^5.0.5",
|
|
132
|
+
"routing-controllers": "^0.10.4",
|
|
133
|
+
"serialize-javascript": "^6.0.2",
|
|
134
|
+
"socket.io-parser": "^4.2.4",
|
|
135
|
+
"sshpk": "^1.18.0",
|
|
136
|
+
"style-loader": "^3.3.4",
|
|
137
|
+
"systeminformation": "^5.22.11",
|
|
138
|
+
"tar": "^7.4.3",
|
|
139
|
+
"tldts": "^6.1.20",
|
|
140
|
+
"ts-node": "^10.9.2",
|
|
141
|
+
"typedi": "^0.10.0",
|
|
142
|
+
"typescript": "^5.6.3",
|
|
143
|
+
"unzipper": "^0.12.3",
|
|
144
|
+
"video.js": "^8.17.2",
|
|
145
|
+
"videojs-hotkeys": "^0.2.28",
|
|
146
|
+
"webpack": "^5.96.1",
|
|
147
|
+
"webpack-bundle-analyzer": "^4.10.2",
|
|
148
|
+
"webpack-cli": "^5.1.4",
|
|
149
|
+
"webpack-dev-server": "^5.0.4",
|
|
150
|
+
"webpack-node-externals": "^3.0.0",
|
|
151
|
+
"ws": "^8.16.0"
|
|
152
|
+
}
|
|
153
|
+
}
|
package/shell/build.js
CHANGED
|
@@ -1,101 +1,102 @@
|
|
|
1
|
-
const {Listr} = require("listr2");
|
|
2
|
-
const webpack = require('webpack');
|
|
3
|
-
const os = require("os");
|
|
4
|
-
const config = require('./config/webpack.config.js');
|
|
5
|
-
const args = process.argv.slice(2); // slice to remove the first two default values
|
|
6
|
-
let serverConfig ;
|
|
7
|
-
if (args.length ===0 || args[0]==="npm") {
|
|
8
|
-
serverConfig = require('./config/webpack.npm.config.js');
|
|
9
|
-
} else if (args[0]==="pkg") {
|
|
10
|
-
serverConfig = require('./config/webpack.pkg.config.js');
|
|
11
|
-
} else if (args[0]==="docker") {
|
|
12
|
-
serverConfig = require('./config/webpack.docker.config.js');
|
|
13
|
-
}
|
|
14
|
-
const {copyFileSync} = require("fs");
|
|
15
|
-
const fs = require("fs");
|
|
16
|
-
const path = require("path");
|
|
17
|
-
const {rimraf} = require("rimraf");
|
|
18
|
-
const fse = require("fs-extra");
|
|
19
|
-
|
|
20
|
-
// 只能复制文件
|
|
21
|
-
function copyFiles(sourceDir,destDir) {
|
|
22
|
-
try {
|
|
23
|
-
const files = fs.readdirSync(sourceDir); // 获取源目录下的所有文件/文件夹
|
|
24
|
-
|
|
25
|
-
for (const file of files) {
|
|
26
|
-
const sourcePath = path.join(sourceDir, file);
|
|
27
|
-
const destPath = path.join(destDir, file);
|
|
28
|
-
const stat = fs.statSync(sourcePath); // 获取文件信息,判断是文件还是目录
|
|
29
|
-
if (stat.isDirectory()) {
|
|
30
|
-
// 如果是目录 暂时不做处理
|
|
31
|
-
} else {
|
|
32
|
-
// 如果是文件,则直接复制
|
|
33
|
-
fs.copyFileSync(sourcePath, destPath);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
console.log(`${sourceDir}:下所有文件复制完成!\n`);
|
|
37
|
-
} catch (err) {
|
|
38
|
-
console.error('复制文件时出错:', err);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const tasksLister = new Listr(
|
|
42
|
-
[
|
|
43
|
-
{
|
|
44
|
-
title: "构建服务端",
|
|
45
|
-
task: async () => {
|
|
46
|
-
return new Promise((res, rej) => {
|
|
47
|
-
webpack(serverConfig, (err, stats) => {
|
|
48
|
-
if (err || stats.hasErrors()) {
|
|
49
|
-
console.error(err || stats.toString());
|
|
50
|
-
rej(false);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "bin", "win-process.node"), path.join(__dirname, "..", "build", "win-process.node"))
|
|
54
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "bin", "linux-process.node"), path.join(__dirname, "..", "build", "linux-process.node"))
|
|
55
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "tun","ts","linux","linuxtun.node"), path.join(__dirname, "..", "build", "linuxtun.node"))
|
|
56
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "tun","ts","win","wintun.node"), path.join(__dirname, "..", "build", "wintun.node"))
|
|
57
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "wintun-amd64.dll"), path.join(__dirname, "..", "build", "wintun-amd64.dll"))
|
|
58
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "wintun-arm.dll"), path.join(__dirname, "..", "build", "wintun-arm.dll"))
|
|
59
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "wintun-arm64.dll"), path.join(__dirname, "..", "build", "wintun-arm64.dll"))
|
|
60
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "wintun-x86.dll"), path.join(__dirname, "..", "build", "wintun-x86.dll"))
|
|
61
|
-
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "bin", "ffmpeg"), path.join(__dirname, "..", "build", "ffmpeg"))
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
copyFileSync(path.join(__dirname, "..", "src", "web", "project",
|
|
87
|
-
copyFileSync(path.join(__dirname, "..", "src", "web", "
|
|
88
|
-
copyFileSync(path.join(__dirname, "..", "src", "web", "meta",
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
1
|
+
const {Listr} = require("listr2");
|
|
2
|
+
const webpack = require('webpack');
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const config = require('./config/webpack.config.js');
|
|
5
|
+
const args = process.argv.slice(2); // slice to remove the first two default values
|
|
6
|
+
let serverConfig ;
|
|
7
|
+
if (args.length ===0 || args[0]==="npm") {
|
|
8
|
+
serverConfig = require('./config/webpack.npm.config.js');
|
|
9
|
+
} else if (args[0]==="pkg") {
|
|
10
|
+
serverConfig = require('./config/webpack.pkg.config.js');
|
|
11
|
+
} else if (args[0]==="docker") {
|
|
12
|
+
serverConfig = require('./config/webpack.docker.config.js');
|
|
13
|
+
}
|
|
14
|
+
const {copyFileSync} = require("fs");
|
|
15
|
+
const fs = require("fs");
|
|
16
|
+
const path = require("path");
|
|
17
|
+
const {rimraf} = require("rimraf");
|
|
18
|
+
const fse = require("fs-extra");
|
|
19
|
+
|
|
20
|
+
// 只能复制文件
|
|
21
|
+
function copyFiles(sourceDir,destDir) {
|
|
22
|
+
try {
|
|
23
|
+
const files = fs.readdirSync(sourceDir); // 获取源目录下的所有文件/文件夹
|
|
24
|
+
|
|
25
|
+
for (const file of files) {
|
|
26
|
+
const sourcePath = path.join(sourceDir, file);
|
|
27
|
+
const destPath = path.join(destDir, file);
|
|
28
|
+
const stat = fs.statSync(sourcePath); // 获取文件信息,判断是文件还是目录
|
|
29
|
+
if (stat.isDirectory()) {
|
|
30
|
+
// 如果是目录 暂时不做处理
|
|
31
|
+
} else {
|
|
32
|
+
// 如果是文件,则直接复制
|
|
33
|
+
fs.copyFileSync(sourcePath, destPath);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
console.log(`${sourceDir}:下所有文件复制完成!\n`);
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.error('复制文件时出错:', err);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const tasksLister = new Listr(
|
|
42
|
+
[
|
|
43
|
+
{
|
|
44
|
+
title: "构建服务端",
|
|
45
|
+
task: async () => {
|
|
46
|
+
return new Promise((res, rej) => {
|
|
47
|
+
webpack(serverConfig, (err, stats) => {
|
|
48
|
+
if (err || stats.hasErrors()) {
|
|
49
|
+
console.error(err || stats.toString());
|
|
50
|
+
rej(false);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "bin", "win-process.node"), path.join(__dirname, "..", "build", "win-process.node"))
|
|
54
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "bin", "linux-process.node"), path.join(__dirname, "..", "build", "linux-process.node"))
|
|
55
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "tun","ts","linux","linuxtun.node"), path.join(__dirname, "..", "build", "linuxtun.node"))
|
|
56
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "tun","ts","win","wintun.node"), path.join(__dirname, "..", "build", "wintun.node"))
|
|
57
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "wintun-amd64.dll"), path.join(__dirname, "..", "build", "wintun-amd64.dll"))
|
|
58
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "wintun-arm.dll"), path.join(__dirname, "..", "build", "wintun-arm.dll"))
|
|
59
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "wintun-arm64.dll"), path.join(__dirname, "..", "build", "wintun-arm64.dll"))
|
|
60
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "net", "wintun-x86.dll"), path.join(__dirname, "..", "build", "wintun-x86.dll"))
|
|
61
|
+
// copyFileSync(path.join(__dirname, "..", "src", "main", "domain", "bin", "ffmpeg"), path.join(__dirname, "..", "build", "ffmpeg"))
|
|
62
|
+
if (args[0] !=="npm") {
|
|
63
|
+
copyFileSync(path.resolve("node_modules/node-unrar-js/esm/js/unrar.wasm"), path.join(__dirname, "..", "build", "unrar.wasm"))
|
|
64
|
+
}
|
|
65
|
+
// 因为不一定不是windows环境 所以都复制一下,发布npm 在windows环境下,不然没有这个dll
|
|
66
|
+
copyFiles(path.resolve("node_modules/@xiaobaidadada/node-tuntap2-wintun/wintun_dll"),path.join(__dirname, "..", "build"))
|
|
67
|
+
rimraf(path.join(__dirname,"..","build","server"));
|
|
68
|
+
res(true);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
title: "构建web",
|
|
77
|
+
task: async () => {
|
|
78
|
+
return new Promise((res, rej) => {
|
|
79
|
+
webpack(config, (err, stats) => {
|
|
80
|
+
if (err || stats.hasErrors()) {
|
|
81
|
+
console.error(err || stats.toString());
|
|
82
|
+
rej(false);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
fse.copySync(path.join(__dirname, "..", "src", "web", "meta", 'resources',"assets","excalidraw-assets"),path.join(__dirname, "..", "build", "dist","excalidraw-assets"));
|
|
86
|
+
copyFileSync(path.join(__dirname, "..", "src", "web", "project", 'component',"file","component","image","js","filerobot-image-editor.min.js"), path.join(__dirname, "..", "build", "dist","filerobot-image-editor.min.js"));
|
|
87
|
+
copyFileSync(path.join(__dirname, "..", "src", "web", "project", "component","toolbox","rdp","client","js","rle.js"), path.join(__dirname, "..", "build", "dist","rle.js"));
|
|
88
|
+
copyFileSync(path.join(__dirname, "..", "src", "web", "meta","resources","img","favicon-16x16.png"), path.join(__dirname, "..", "build", "dist","favicon-16x16.png"));
|
|
89
|
+
copyFileSync(path.join(__dirname, "..", "src", "web", "meta", "resources","img","favicon-32x32.png"), path.join(__dirname, "..", "build", "dist","favicon-32x32.png"));
|
|
90
|
+
// copyFileSync(path.join(__dirname, "..", "src", "web", "meta", "component","resources","img","svg.png"), path.join(__dirname, "..", "build", "dist","svg.png"))
|
|
91
|
+
res(true);
|
|
92
|
+
});
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
options: {persistentOutput: true},
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
{
|
|
99
|
+
exitOnError: false,
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
tasksLister.run();
|
package/shell/config/.babelrc
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
"@babel/preset-env",
|
|
4
|
-
"@babel/preset-typescript",
|
|
5
|
-
"@babel/preset-react"
|
|
6
|
-
],
|
|
7
|
-
"plugins": [
|
|
8
|
-
["@babel/plugin-proposal-decorators", { "legacy": true }]
|
|
9
|
-
]
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"presets": [
|
|
3
|
+
"@babel/preset-env",
|
|
4
|
+
"@babel/preset-typescript",
|
|
5
|
+
"@babel/preset-react"
|
|
6
|
+
],
|
|
7
|
+
"plugins": [
|
|
8
|
+
["@babel/plugin-proposal-decorators", { "legacy": true }]
|
|
9
|
+
]
|
|
10
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ptyPath = void 0;
|
|
4
|
-
var fs = require("fs");
|
|
5
|
-
var os = require("os");
|
|
6
|
-
var path = require("path");
|
|
7
|
-
function prebuildName() {
|
|
8
|
-
var tags = [];
|
|
9
|
-
tags.push(process.versions.hasOwnProperty('electron') ? 'electron' : 'node');
|
|
10
|
-
tags.push('abi' + process.versions.modules);
|
|
11
|
-
if (os.platform() === 'linux' && fs.existsSync('/etc/alpine-release')) {
|
|
12
|
-
tags.push('musl');
|
|
13
|
-
}
|
|
14
|
-
return tags.join('.') + '.node';
|
|
15
|
-
}
|
|
16
|
-
var pathToBuild = path.resolve(__dirname, "../prebuilds/".concat(os.platform(), "-").concat(os.arch(), "/").concat(prebuildName()));
|
|
17
|
-
exports.ptyPath = fs.existsSync(pathToBuild) ? pathToBuild : null;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ptyPath = void 0;
|
|
4
|
+
var fs = require("fs");
|
|
5
|
+
var os = require("os");
|
|
6
|
+
var path = require("path");
|
|
7
|
+
function prebuildName() {
|
|
8
|
+
var tags = [];
|
|
9
|
+
tags.push(process.versions.hasOwnProperty('electron') ? 'electron' : 'node');
|
|
10
|
+
tags.push('abi' + process.versions.modules);
|
|
11
|
+
if (os.platform() === 'linux' && fs.existsSync('/etc/alpine-release')) {
|
|
12
|
+
tags.push('musl');
|
|
13
|
+
}
|
|
14
|
+
return tags.join('.') + '.node';
|
|
15
|
+
}
|
|
16
|
+
var pathToBuild = path.resolve(__dirname, "../prebuilds/".concat(os.platform(), "-").concat(os.arch(), "/").concat(prebuildName()));
|
|
17
|
+
exports.ptyPath = fs.existsSync(pathToBuild) ? pathToBuild : null;
|
|
18
18
|
//# sourceMappingURL=prebuild-file-path.js.map
|