underpost 2.8.885 → 2.81.0
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/.env.production +3 -0
- package/.github/workflows/ghpkg.ci.yml +1 -1
- package/.github/workflows/npmpkg.ci.yml +1 -1
- package/.github/workflows/publish.ci.yml +5 -5
- package/.github/workflows/pwa-microservices-template-page.cd.yml +1 -1
- package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
- package/.vscode/zed.keymap.json +17 -0
- package/.vscode/zed.settings.json +20 -0
- package/CHANGELOG.md +145 -1
- package/Dockerfile +20 -3
- package/README.md +6 -6
- package/bin/build.js +18 -9
- package/bin/deploy.js +130 -195
- package/bin/zed.js +20 -0
- package/cli.md +13 -7
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +50 -50
- package/manifests/deployment/dd-test-development/proxy.yaml +4 -4
- package/manifests/lxd/underpost-setup.sh +5 -5
- package/package.json +3 -4
- package/{manifests/maas → scripts}/ssh-cluster-info.sh +1 -1
- package/scripts/ssl.sh +164 -0
- package/src/cli/baremetal.js +8 -8
- package/src/cli/cloud-init.js +1 -1
- package/src/cli/cluster.js +15 -4
- package/src/cli/cron.js +1 -1
- package/src/cli/db.js +2 -1
- package/src/cli/deploy.js +65 -14
- package/src/cli/fs.js +2 -2
- package/src/cli/image.js +19 -2
- package/src/cli/index.js +11 -4
- package/src/cli/monitor.js +34 -1
- package/src/cli/repository.js +42 -1
- package/src/cli/run.js +396 -86
- package/src/cli/script.js +32 -0
- package/src/cli/secrets.js +34 -0
- package/src/cli/test.js +42 -1
- package/src/client/components/core/Css.js +0 -8
- package/src/client/components/core/windowGetDimensions.js +229 -162
- package/src/index.js +2 -2
- package/src/mailer/MailerProvider.js +1 -0
- package/src/runtime/express/Dockerfile +41 -0
- package/src/runtime/express/Express.js +12 -4
- package/src/runtime/lampp/Dockerfile +1 -1
- package/src/server/backup.js +20 -0
- package/src/server/client-build-live.js +12 -10
- package/src/server/client-build.js +136 -91
- package/src/server/client-dev-server.js +16 -2
- package/src/server/client-icons.js +19 -0
- package/src/server/conf.js +495 -69
- package/src/server/dns.js +169 -46
- package/src/server/downloader.js +65 -24
- package/src/server/object-layer.js +260 -162
- package/src/server/peer.js +2 -8
- package/src/server/proxy.js +93 -76
- package/src/server/runtime.js +15 -16
- package/src/server/ssr.js +4 -4
- package/src/server/tls.js +251 -0
- package/src/server/valkey.js +11 -10
- package/src/ws/IoInterface.js +2 -1
- package/src/ws/IoServer.js +2 -1
- package/src/ws/core/core.ws.connection.js +1 -1
- package/src/ws/core/core.ws.emit.js +1 -1
- package/src/ws/core/core.ws.server.js +1 -1
- package/manifests/maas/lxd-preseed.yaml +0 -32
- package/src/server/ssl.js +0 -108
- /package/{manifests/maas → scripts}/device-scan.sh +0 -0
- /package/{manifests/maas → scripts}/gpu-diag.sh +0 -0
- /package/{manifests/maas → scripts}/maas-setup.sh +0 -0
- /package/{manifests/maas → scripts}/nat-iptables.sh +0 -0
- /package/{manifests/maas → scripts}/nvim.sh +0 -0
- /package/{manifests/maas → scripts}/snap-clean.sh +0 -0
package/bin/deploy.js
CHANGED
|
@@ -27,7 +27,7 @@ import { buildClient } from '../src/server/client-build.js';
|
|
|
27
27
|
import { DefaultConf } from '../conf.js';
|
|
28
28
|
import colors from 'colors';
|
|
29
29
|
import { program } from '../src/cli/index.js';
|
|
30
|
-
import { getLocalIPv4Address
|
|
30
|
+
import Dns, { getLocalIPv4Address } from '../src/server/dns.js';
|
|
31
31
|
import { timer } from '../src/client/components/core/CommonJs.js';
|
|
32
32
|
|
|
33
33
|
colors.enable();
|
|
@@ -124,8 +124,12 @@ try {
|
|
|
124
124
|
case 'conf': {
|
|
125
125
|
let subConf = process.argv[5] ?? '';
|
|
126
126
|
|
|
127
|
-
if (!['current', 'clean'].includes(process.argv[3]))
|
|
128
|
-
|
|
127
|
+
if (!['current', 'clean', 'root'].includes(process.argv[3])) {
|
|
128
|
+
const path = fs.existsSync(`./engine-private/replica/${process.argv[3]}`)
|
|
129
|
+
? `./engine-private/replica/${process.argv[3]}/.env.${process.argv[4]}`
|
|
130
|
+
: `./engine-private/conf/${process.argv[3]}/.env.${process.argv[4]}`;
|
|
131
|
+
dotenv.config({ path, override: true });
|
|
132
|
+
}
|
|
129
133
|
|
|
130
134
|
loadConf(process.argv[3], subConf);
|
|
131
135
|
break;
|
|
@@ -253,25 +257,33 @@ try {
|
|
|
253
257
|
{ env: 'development', port: 4000 },
|
|
254
258
|
{ env: 'test', port: 5000 },
|
|
255
259
|
];
|
|
256
|
-
let
|
|
257
|
-
const singleReplicaHosts = [];
|
|
260
|
+
let portOffset = 0;
|
|
258
261
|
for (const deployIdObj of dataDeploy) {
|
|
259
|
-
const { deployId
|
|
260
|
-
if (replicaHost && !singleReplicaHosts.includes(replicaHost)) singleReplicaHosts.push(replicaHost);
|
|
262
|
+
const { deployId } = deployIdObj;
|
|
261
263
|
const baseConfPath = fs.existsSync(`./engine-private/replica/${deployId}`)
|
|
262
264
|
? `./engine-private/replica`
|
|
263
265
|
: `./engine-private/conf`;
|
|
264
266
|
for (const envInstanceObj of dataEnv) {
|
|
265
267
|
const envPath = `${baseConfPath}/${deployId}/.env.${envInstanceObj.env}`;
|
|
266
268
|
const envObj = dotenv.parse(fs.readFileSync(envPath, 'utf8'));
|
|
267
|
-
envObj.PORT = envInstanceObj.port +
|
|
269
|
+
envObj.PORT = `${envInstanceObj.port + portOffset}`;
|
|
268
270
|
|
|
269
271
|
writeEnv(envPath, envObj);
|
|
270
272
|
}
|
|
271
273
|
const serverConf = loadReplicas(
|
|
274
|
+
deployId,
|
|
272
275
|
JSON.parse(fs.readFileSync(`${baseConfPath}/${deployId}/conf.server.json`, 'utf8')),
|
|
273
276
|
);
|
|
274
|
-
for (const host of Object.keys(serverConf))
|
|
277
|
+
for (const host of Object.keys(serverConf)) {
|
|
278
|
+
for (const path of Object.keys(serverConf[host])) {
|
|
279
|
+
if (serverConf[host][path].singleReplica) {
|
|
280
|
+
portOffset--;
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
portOffset++;
|
|
284
|
+
if (serverConf[host][path].peer) portOffset++;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
275
287
|
}
|
|
276
288
|
break;
|
|
277
289
|
|
|
@@ -280,6 +292,7 @@ try {
|
|
|
280
292
|
const host = process.argv[4];
|
|
281
293
|
const path = process.argv[5];
|
|
282
294
|
const serverConf = loadReplicas(
|
|
295
|
+
deployId,
|
|
283
296
|
JSON.parse(fs.readFileSync(`./engine-private/conf/${deployId}/conf.server.json`, 'utf8')),
|
|
284
297
|
);
|
|
285
298
|
|
|
@@ -430,11 +443,11 @@ try {
|
|
|
430
443
|
'utf8',
|
|
431
444
|
);
|
|
432
445
|
|
|
433
|
-
if (fs.existsSync(`./.github/workflows/docker-image.yml`))
|
|
446
|
+
if (fs.existsSync(`./.github/workflows/docker-image.ci.yml`))
|
|
434
447
|
fs.writeFileSync(
|
|
435
|
-
`./.github/workflows/docker-image.yml`,
|
|
448
|
+
`./.github/workflows/docker-image.ci.yml`,
|
|
436
449
|
fs
|
|
437
|
-
.readFileSync(`./.github/workflows/docker-image.yml`, 'utf8')
|
|
450
|
+
.readFileSync(`./.github/workflows/docker-image.ci.yml`, 'utf8')
|
|
438
451
|
.replaceAll(`underpost-engine:v${version}`, `underpost-engine:v${newVersion}`),
|
|
439
452
|
'utf8',
|
|
440
453
|
);
|
|
@@ -472,10 +485,19 @@ try {
|
|
|
472
485
|
break;
|
|
473
486
|
}
|
|
474
487
|
|
|
488
|
+
case 'private': {
|
|
489
|
+
shellExec(`node bin/deploy sync-deploy-envs`);
|
|
490
|
+
shellExec(`node bin/build dd conf`);
|
|
491
|
+
shellExec(`cd ./engine-private && git add . && node ../bin cmt . build`);
|
|
492
|
+
shellExec(`cd ./engine-private && node ../bin push . ${process.env.GITHUB_USERNAME}/engine-private`);
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
|
|
475
496
|
case 'version-deploy': {
|
|
476
497
|
shellExec(
|
|
477
498
|
`underpost secret underpost --create-from-file /home/dd/engine/engine-private/conf/dd-cron/.env.production`,
|
|
478
499
|
);
|
|
500
|
+
shellExec(`node bin/deploy sync-deploy-envs`);
|
|
479
501
|
shellExec(`node bin/build dd conf`);
|
|
480
502
|
shellExec(`git add . && cd ./engine-private && git add .`);
|
|
481
503
|
shellExec(`node bin cmt . ci package-pwa-microservices-template`);
|
|
@@ -557,10 +579,10 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
557
579
|
`${key}`.toUpperCase().match('MAC')
|
|
558
580
|
? 'changethis'
|
|
559
581
|
: isNaN(parseFloat(privateEnv[key]))
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
582
|
+
? `${privateEnv[key]}`.match(`@`)
|
|
583
|
+
? 'admin@default.net'
|
|
584
|
+
: 'changethis'
|
|
585
|
+
: privateEnv[key];
|
|
564
586
|
}
|
|
565
587
|
return env;
|
|
566
588
|
};
|
|
@@ -647,7 +669,7 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
647
669
|
// generate + import + start
|
|
648
670
|
// node bin/deploy ssh root@<host> <password>
|
|
649
671
|
|
|
650
|
-
const host = process.argv[3] ?? `root@${await
|
|
672
|
+
const host = process.argv[3] ?? `root@${await Dns.getPublicIp()}`;
|
|
651
673
|
const domain = host.split('@')[1];
|
|
652
674
|
const user = 'root'; // host.split('@')[0];
|
|
653
675
|
const password = process.argv[4] ?? '';
|
|
@@ -923,82 +945,6 @@ EOF`);
|
|
|
923
945
|
break;
|
|
924
946
|
}
|
|
925
947
|
|
|
926
|
-
case 'nfs': {
|
|
927
|
-
// Daemon RPC NFSv3. ports:
|
|
928
|
-
|
|
929
|
-
// 2049 (TCP/UDP) – nfsd standard port.
|
|
930
|
-
// 111 (TCP/UDP) – rpcbind/portmapper.
|
|
931
|
-
// 20048 (TCP/UDP) – rpc.mountd.
|
|
932
|
-
// 32765 (TCP/UDP) – rpc.statd.
|
|
933
|
-
// 32766 (TCP/UDP) – lockd (NLM).
|
|
934
|
-
|
|
935
|
-
// Configure export and permissions:
|
|
936
|
-
// /etc/exports
|
|
937
|
-
|
|
938
|
-
// Configure ports:
|
|
939
|
-
// /etc/nfs.conf
|
|
940
|
-
|
|
941
|
-
fs.writeFileSync(
|
|
942
|
-
`/etc/nfs.conf`,
|
|
943
|
-
`
|
|
944
|
-
[mountd]
|
|
945
|
-
port = 20048
|
|
946
|
-
|
|
947
|
-
[statd]
|
|
948
|
-
port = 32765
|
|
949
|
-
outgoing-port = 32765
|
|
950
|
-
|
|
951
|
-
[nfsd]
|
|
952
|
-
rdma=y
|
|
953
|
-
rdma-port=20049
|
|
954
|
-
|
|
955
|
-
[lockd]
|
|
956
|
-
port = 32766
|
|
957
|
-
udp-port = 32766
|
|
958
|
-
`,
|
|
959
|
-
'utf8',
|
|
960
|
-
);
|
|
961
|
-
|
|
962
|
-
// Client users have read-only access to resources and are identified as anonymous on the server.
|
|
963
|
-
// /share ip-client(ro,all_squash)
|
|
964
|
-
|
|
965
|
-
// Client users can modify resources and keep their UID on the server. Only root is identified as anonymous.
|
|
966
|
-
// /share ip-client(rw)
|
|
967
|
-
|
|
968
|
-
// Users on client workstation 1 can modify resources, while those on client workstation 2 have read-only access.
|
|
969
|
-
// UIDs are kept on the server, and only root is identified as anonymous.
|
|
970
|
-
// /share ip-client1(rw) ip-client2(ro)
|
|
971
|
-
|
|
972
|
-
// Client1 users can modify resources. Their UID is changed to 1001 and their GID to 100 on the server.
|
|
973
|
-
// /share ip-client(rw,all_squash,anonuid=1001,anongid=100)
|
|
974
|
-
|
|
975
|
-
// sudo dnf install nfs-utils
|
|
976
|
-
// sudo systemctl enable --now rpcbind // RPC map service
|
|
977
|
-
// sudo systemctl enable --now nfs-server // nfs domains nfsd
|
|
978
|
-
|
|
979
|
-
// Update exports:
|
|
980
|
-
// shellExec(`sudo exportfs -a -r`);
|
|
981
|
-
// shellExec(`sudo exportfs -v`);
|
|
982
|
-
|
|
983
|
-
// Active nfs
|
|
984
|
-
shellExec(`sudo exportfs -s`);
|
|
985
|
-
|
|
986
|
-
shellExec(`sudo exportfs -rav`);
|
|
987
|
-
|
|
988
|
-
// Rocky enable virt_use_nfs
|
|
989
|
-
// sudo setsebool -P virt_use_nfs 1
|
|
990
|
-
|
|
991
|
-
// Disable share:
|
|
992
|
-
// sudo exportfs -u <client-ip>:${process.env.NFS_EXPORT_PATH}/rpi4mb
|
|
993
|
-
|
|
994
|
-
// Nfs client:
|
|
995
|
-
// mount -t nfs <server-ip>:/server-mnt /mnt
|
|
996
|
-
// umount /mnt
|
|
997
|
-
|
|
998
|
-
shellExec(`sudo systemctl restart nfs-server`);
|
|
999
|
-
break;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
948
|
case 'mount': {
|
|
1003
949
|
const mounts = shellExec(`mount`).split(`\n`);
|
|
1004
950
|
console.table(
|
|
@@ -1029,102 +975,6 @@ udp-port = 32766
|
|
|
1029
975
|
break;
|
|
1030
976
|
}
|
|
1031
977
|
|
|
1032
|
-
case 'maas-ports': {
|
|
1033
|
-
// Configure firewall:
|
|
1034
|
-
|
|
1035
|
-
// systemctl stop firewalld
|
|
1036
|
-
// systemctl mask firewalld
|
|
1037
|
-
|
|
1038
|
-
// ufw disable
|
|
1039
|
-
// ufw enable
|
|
1040
|
-
|
|
1041
|
-
// sudo snap install ufw
|
|
1042
|
-
// const ports = ['80', '443', '22', '3000-3100'];
|
|
1043
|
-
const ports = [
|
|
1044
|
-
'43',
|
|
1045
|
-
'53',
|
|
1046
|
-
'60',
|
|
1047
|
-
'66',
|
|
1048
|
-
'67',
|
|
1049
|
-
'69',
|
|
1050
|
-
'4011',
|
|
1051
|
-
'111',
|
|
1052
|
-
'2049',
|
|
1053
|
-
'20048',
|
|
1054
|
-
'20049',
|
|
1055
|
-
'32765',
|
|
1056
|
-
'32766',
|
|
1057
|
-
'5248',
|
|
1058
|
-
'5240',
|
|
1059
|
-
];
|
|
1060
|
-
for (const port of ports) {
|
|
1061
|
-
shellExec(`ufw allow ${port}/tcp`);
|
|
1062
|
-
shellExec(`ufw allow ${port}/udp`);
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
shellExec(`sudo systemctl mask firewalld`);
|
|
1066
|
-
|
|
1067
|
-
break;
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
case 'iptables': {
|
|
1071
|
-
shellExec(`sudo systemctl enable nftables`);
|
|
1072
|
-
shellExec(`sudo systemctl restart nftables`);
|
|
1073
|
-
|
|
1074
|
-
shellExec(`sudo tee /etc/nftables.conf <<EOF
|
|
1075
|
-
table inet filter {
|
|
1076
|
-
chain input {
|
|
1077
|
-
type filter hook input priority 0;
|
|
1078
|
-
policy drop;
|
|
1079
|
-
tcp dport 22 accept
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
EOF`);
|
|
1083
|
-
shellExec(`sudo nft -f /etc/nftables.conf`);
|
|
1084
|
-
|
|
1085
|
-
// sudo systemctl stop nftables
|
|
1086
|
-
// sudo systemctl disable nftables
|
|
1087
|
-
|
|
1088
|
-
break;
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
case 'rpi4': {
|
|
1092
|
-
// Rpi4 Run Bootloader:
|
|
1093
|
-
|
|
1094
|
-
// 1) create boot.conf
|
|
1095
|
-
|
|
1096
|
-
// 2) Run lite RPiOs from rpi-imager
|
|
1097
|
-
// with boot.conf files in root disk path
|
|
1098
|
-
|
|
1099
|
-
// 3) cd /boot/firmware && sudo rpi-eeprom-config --apply boot.conf
|
|
1100
|
-
|
|
1101
|
-
// 4) sudo reboot
|
|
1102
|
-
|
|
1103
|
-
// 5) check: 'vcgencmd bootloader_version'
|
|
1104
|
-
// 6) check: 'vcgencmd bootloader_config'
|
|
1105
|
-
|
|
1106
|
-
// 7) shutdown and restart without sd card
|
|
1107
|
-
|
|
1108
|
-
// sudo apt update
|
|
1109
|
-
// sudo apt install git
|
|
1110
|
-
|
|
1111
|
-
break;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
case 'blue': {
|
|
1115
|
-
// lsusb | grep blue -i
|
|
1116
|
-
// rfkill list
|
|
1117
|
-
// sudo service bluetooth start
|
|
1118
|
-
// bluetoothctl show
|
|
1119
|
-
// sudo rfkill unblock bluetooth
|
|
1120
|
-
// dmesg | grep -i bluetooth
|
|
1121
|
-
// journalctl -u bluetooth -f
|
|
1122
|
-
// sudo dnf update bluez bluez-libs bluez-utils
|
|
1123
|
-
// sudo rmmod btusb
|
|
1124
|
-
// sudo modprobe btusb
|
|
1125
|
-
break;
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
978
|
case 'fastapi-models': {
|
|
1129
979
|
shellExec(`chmod +x ../full-stack-fastapi-template/backend/initial_data.sh`);
|
|
1130
980
|
shellExec(`../full-stack-fastapi-template/backend/initial_data.sh`);
|
|
@@ -1379,13 +1229,98 @@ nvidia/gpu-operator \
|
|
|
1379
1229
|
break;
|
|
1380
1230
|
}
|
|
1381
1231
|
|
|
1382
|
-
case '
|
|
1383
|
-
|
|
1232
|
+
case 'udpate-version-files': {
|
|
1233
|
+
const oldNpmVersion = process.argv[3];
|
|
1234
|
+
const oldNodeVersion = process.argv[4];
|
|
1235
|
+
const oldNodeMajorVersion = oldNodeVersion.split('.')[0];
|
|
1236
|
+
const nodeVersion = shellExec(`node --version`, { stdout: true }).trim().replace('v', '');
|
|
1237
|
+
const newNodeMajorVersion = nodeVersion.split('.')[0];
|
|
1238
|
+
const npmVersion = shellExec(`npm --version`, { stdout: true }).trim();
|
|
1239
|
+
|
|
1240
|
+
fs.writeFileSync(
|
|
1241
|
+
`README.md`,
|
|
1242
|
+
fs
|
|
1243
|
+
.readFileSync(`README.md`, 'utf8')
|
|
1244
|
+
.replaceAll(oldNodeVersion, nodeVersion)
|
|
1245
|
+
.replaceAll(oldNpmVersion, npmVersion),
|
|
1246
|
+
);
|
|
1247
|
+
fs.writeFileSync(
|
|
1248
|
+
`manifests/lxd/underpost-setup.sh`,
|
|
1249
|
+
fs
|
|
1250
|
+
.readFileSync(`manifests/lxd/underpost-setup.sh`, 'utf8')
|
|
1251
|
+
.replaceAll(oldNodeVersion, nodeVersion)
|
|
1252
|
+
.replaceAll(oldNpmVersion, npmVersion),
|
|
1253
|
+
);
|
|
1254
|
+
fs.writeFileSync(
|
|
1255
|
+
`src/client/public/nexodev/docs/references/Getting started.md`,
|
|
1256
|
+
fs
|
|
1257
|
+
.readFileSync(`src/client/public/nexodev/docs/references/Getting started.md`, 'utf8')
|
|
1258
|
+
.replaceAll(oldNodeVersion, nodeVersion)
|
|
1259
|
+
.replaceAll(oldNpmVersion, npmVersion),
|
|
1260
|
+
);
|
|
1261
|
+
|
|
1262
|
+
const workflowFiles = [
|
|
1263
|
+
`./.github/workflows/coverall.ci.yml`,
|
|
1264
|
+
|
|
1265
|
+
`./.github/workflows/engine-core.ci.yml`,
|
|
1266
|
+
|
|
1267
|
+
`./.github/workflows/engine-cyberia.ci.yml`,
|
|
1268
|
+
|
|
1269
|
+
`./.github/workflows/engine-lampp.ci.yml`,
|
|
1270
|
+
|
|
1271
|
+
`./.github/workflows/engine-test.ci.yml`,
|
|
1272
|
+
|
|
1273
|
+
`./.github/workflows/ghpkg.ci.yml`,
|
|
1274
|
+
|
|
1275
|
+
`./.github/workflows/npmpkg.ci.yml`,
|
|
1276
|
+
|
|
1277
|
+
`./.github/workflows/publish.ci.yml`,
|
|
1278
|
+
|
|
1279
|
+
`./.github/workflows/pwa-microservices-template-page.cd.yml`,
|
|
1280
|
+
|
|
1281
|
+
`./.github/workflows/pwa-microservices-template-test.ci.yml`,
|
|
1282
|
+
|
|
1283
|
+
`./.github/workflows/test-api-rest.cd.yml`,
|
|
1284
|
+
|
|
1285
|
+
`./src/runtime/lampp/Dockerfile`,
|
|
1286
|
+
|
|
1287
|
+
`./Dockerfile`,
|
|
1288
|
+
];
|
|
1289
|
+
|
|
1290
|
+
workflowFiles.forEach((file) => {
|
|
1291
|
+
fs.writeFileSync(
|
|
1292
|
+
file,
|
|
1293
|
+
fs
|
|
1294
|
+
.readFileSync(file, 'utf8')
|
|
1295
|
+
.replaceAll(oldNodeMajorVersion + '.x', newNodeMajorVersion + '.x')
|
|
1296
|
+
.replaceAll(oldNodeVersion, nodeVersion)
|
|
1297
|
+
.replaceAll(oldNpmVersion, npmVersion),
|
|
1298
|
+
);
|
|
1299
|
+
});
|
|
1300
|
+
pbcopy(`nvm alias default v${nodeVersion}`);
|
|
1301
|
+
break;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
case 'tls': {
|
|
1305
|
+
fs.mkdirSync(`./engine-private/ssl/localhost`, { recursive: true });
|
|
1306
|
+
const targetDir = `./engine-private/ssl/localhost`;
|
|
1307
|
+
const domains = ['localhost', '127.0.0.1', '::1'];
|
|
1308
|
+
shellExec(`chmod +x ./scripts/ssl.sh`);
|
|
1309
|
+
shellExec(`./scripts/ssl.sh ${targetDir} "${domains.join(' ')}"`);
|
|
1310
|
+
break;
|
|
1311
|
+
}
|
|
1384
1312
|
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1313
|
+
case 'sync-deploy-envs': {
|
|
1314
|
+
const envObj = dotenv.parse(fs.readFileSync(`./engine-private/conf/dd-cron/.env.production`));
|
|
1315
|
+
for (const deployId of ['dd-cron'].concat(
|
|
1316
|
+
fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8').split(','),
|
|
1317
|
+
)) {
|
|
1318
|
+
for (const env of ['production', 'development', 'test']) {
|
|
1319
|
+
const _envObj = dotenv.parse(fs.readFileSync(`./engine-private/conf/${deployId}/.env.${env}`, 'utf8'));
|
|
1320
|
+
_envObj.GITHUB_TOKEN = envObj.GITHUB_TOKEN;
|
|
1321
|
+
writeEnv(`./engine-private/conf/${deployId}/.env.${env}`, _envObj);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1389
1324
|
break;
|
|
1390
1325
|
}
|
|
1391
1326
|
}
|
package/bin/zed.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { shellExec } from '../src/server/process.js';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { loggerFactory } from '../src/server/logger.js';
|
|
4
|
+
|
|
5
|
+
const logger = loggerFactory(import.meta);
|
|
6
|
+
|
|
7
|
+
fs.copyFileSync(`./.vscode/zed.settings.json`, `/root/.config/zed/settings.json`);
|
|
8
|
+
fs.copyFileSync(`./.vscode/zed.keymap.json`, `/root/.config/zed/keymap.json`);
|
|
9
|
+
|
|
10
|
+
shellExec(`ZED_ALLOW_ROOT=true zed ${process.argv[2] ? process.argv[2] : '.'}`);
|
|
11
|
+
|
|
12
|
+
logger.info('Connect copilot device', 'https://github.com/login/device');
|
|
13
|
+
logger.info('Comments', 'Ctrl shift 7');
|
|
14
|
+
logger.info('Unfold', 'Ctrl K + Ctrl J');
|
|
15
|
+
logger.info('Fold', 'Ctrl K + Ctrl 0');
|
|
16
|
+
logger.info('Command Palette', 'Ctrl Shift P');
|
|
17
|
+
logger.info('Open File', 'Ctrl P');
|
|
18
|
+
logger.info('Find in Files', 'Ctrl Shift F');
|
|
19
|
+
logger.info('Go to Line', 'Ctrl G');
|
|
20
|
+
logger.info('New file', 'Ctrl N');
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.
|
|
1
|
+
## underpost ci/cd cli v2.81.0
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -11,7 +11,7 @@ Commands:
|
|
|
11
11
|
start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
|
|
12
12
|
clone [options] <uri> Clones a specified GitHub repository into the current directory.
|
|
13
13
|
pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
|
|
14
|
-
cmt [options]
|
|
14
|
+
cmt [options] [path] [commit-type] [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
|
|
15
15
|
push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
|
|
16
16
|
env [deploy-id] [env] [subConf] Sets environment variables and configurations related to a specific deployment ID.
|
|
17
17
|
config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
|
|
@@ -117,7 +117,7 @@ Options:
|
|
|
117
117
|
|
|
118
118
|
### `cmt` :
|
|
119
119
|
```
|
|
120
|
-
Usage: underpost cmt [options]
|
|
120
|
+
Usage: underpost cmt [options] [path] [commit-type] [module-tag] [message]
|
|
121
121
|
|
|
122
122
|
Manages commits to a GitHub repository, supporting various commit types and
|
|
123
123
|
options.
|
|
@@ -131,6 +131,8 @@ Arguments:
|
|
|
131
131
|
message Optional: Provides an additional custom message for the commit.
|
|
132
132
|
|
|
133
133
|
Options:
|
|
134
|
+
--log Shows commit history from the specified number of latest n path
|
|
135
|
+
commits.
|
|
134
136
|
--empty Allows committing with empty files.
|
|
135
137
|
--copy Copies the generated commit message to the clipboard.
|
|
136
138
|
--info Displays information about available commit types.
|
|
@@ -166,7 +168,7 @@ ID.
|
|
|
166
168
|
|
|
167
169
|
Arguments:
|
|
168
170
|
deploy-id The deployment configuration ID. Use 'clean' to restore default
|
|
169
|
-
environment settings.
|
|
171
|
+
environment settings. Use 'root' to load underpost root env. Use
|
|
170
172
|
'current' to get plain current deploy Id.
|
|
171
173
|
env Optional: The environment to set (e.g., "production",
|
|
172
174
|
"development"). Defaults to "production".
|
|
@@ -311,8 +313,10 @@ Options:
|
|
|
311
313
|
--traffic <traffic-versions> A comma-separated list of custom deployment
|
|
312
314
|
traffic weights.
|
|
313
315
|
--disable-update-deployment Disables updates to deployments.
|
|
314
|
-
--
|
|
315
|
-
|
|
316
|
+
--disable-update-proxy Disables updates to proxies.
|
|
317
|
+
--status Retrieves current network traffic data from
|
|
318
|
+
resource deployments and the host machine
|
|
319
|
+
network configuration.
|
|
316
320
|
--kubeadm Enables the kubeadm context for deployment
|
|
317
321
|
operations.
|
|
318
322
|
--etc-hosts Enables the etc-hosts context for
|
|
@@ -370,6 +374,7 @@ Options:
|
|
|
370
374
|
environment secrets.
|
|
371
375
|
--reset Performs a build without using the
|
|
372
376
|
cache.
|
|
377
|
+
--dev Use development mode.
|
|
373
378
|
--k3s-load Loads the image into a K3s cluster.
|
|
374
379
|
-h, --help display help for command
|
|
375
380
|
|
|
@@ -389,6 +394,7 @@ Options:
|
|
|
389
394
|
--kubeadm-load Imports the pulled image into a Kubeadm cluster.
|
|
390
395
|
--version Sets a custom version for the base images.
|
|
391
396
|
--k3s-load Loads the image into a K3s cluster.
|
|
397
|
+
--dev Use development mode.
|
|
392
398
|
-h, --help display help for command
|
|
393
399
|
|
|
394
400
|
```
|
|
@@ -607,7 +613,7 @@ Options:
|
|
|
607
613
|
Runs a script from the specified path.
|
|
608
614
|
|
|
609
615
|
Arguments:
|
|
610
|
-
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, cyberia-ide, engine-ide, template-deploy, clean, pull, release-deploy, ssh-deploy, ide,
|
|
616
|
+
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, dev-hosts-expose, dev-hosts-restore, cyberia-ide, engine-ide, cluster-build, template-deploy, clean, pull, release-deploy, ssh-deploy, ide, sync, ls-deployments, monitor, db-client, promote, metrics, cluster, deploy, sync-replica, tf-vae-test, deploy-job.
|
|
611
617
|
path The absolute or relative directory path where the script is located.
|
|
612
618
|
|
|
613
619
|
Options:
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.81.0
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -100,7 +100,7 @@ spec:
|
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
102
|
- name: dd-default-development-green
|
|
103
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.81.0
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-test-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.81.0
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "96294Ki"
|
|
@@ -49,41 +49,41 @@ spec:
|
|
|
49
49
|
selector:
|
|
50
50
|
app: dd-test-development-blue
|
|
51
51
|
ports:
|
|
52
|
-
- name: 'tcp-
|
|
52
|
+
- name: 'tcp-4041'
|
|
53
53
|
protocol: TCP
|
|
54
|
-
port:
|
|
55
|
-
targetPort:
|
|
56
|
-
- name: 'udp-
|
|
54
|
+
port: 4041
|
|
55
|
+
targetPort: 4041
|
|
56
|
+
- name: 'udp-4041'
|
|
57
57
|
protocol: UDP
|
|
58
|
-
port:
|
|
59
|
-
targetPort:
|
|
58
|
+
port: 4041
|
|
59
|
+
targetPort: 4041
|
|
60
60
|
|
|
61
|
-
- name: 'tcp-
|
|
61
|
+
- name: 'tcp-4042'
|
|
62
62
|
protocol: TCP
|
|
63
|
-
port:
|
|
64
|
-
targetPort:
|
|
65
|
-
- name: 'udp-
|
|
63
|
+
port: 4042
|
|
64
|
+
targetPort: 4042
|
|
65
|
+
- name: 'udp-4042'
|
|
66
66
|
protocol: UDP
|
|
67
|
-
port:
|
|
68
|
-
targetPort:
|
|
67
|
+
port: 4042
|
|
68
|
+
targetPort: 4042
|
|
69
69
|
|
|
70
|
-
- name: 'tcp-
|
|
70
|
+
- name: 'tcp-4043'
|
|
71
71
|
protocol: TCP
|
|
72
|
-
port:
|
|
73
|
-
targetPort:
|
|
74
|
-
- name: 'udp-
|
|
72
|
+
port: 4043
|
|
73
|
+
targetPort: 4043
|
|
74
|
+
- name: 'udp-4043'
|
|
75
75
|
protocol: UDP
|
|
76
|
-
port:
|
|
77
|
-
targetPort:
|
|
76
|
+
port: 4043
|
|
77
|
+
targetPort: 4043
|
|
78
78
|
|
|
79
|
-
- name: 'tcp-
|
|
79
|
+
- name: 'tcp-4044'
|
|
80
80
|
protocol: TCP
|
|
81
|
-
port:
|
|
82
|
-
targetPort:
|
|
83
|
-
- name: 'udp-
|
|
81
|
+
port: 4044
|
|
82
|
+
targetPort: 4044
|
|
83
|
+
- name: 'udp-4044'
|
|
84
84
|
protocol: UDP
|
|
85
|
-
port:
|
|
86
|
-
targetPort:
|
|
85
|
+
port: 4044
|
|
86
|
+
targetPort: 4044
|
|
87
87
|
type: LoadBalancer
|
|
88
88
|
---
|
|
89
89
|
apiVersion: apps/v1
|
|
@@ -104,7 +104,7 @@ spec:
|
|
|
104
104
|
spec:
|
|
105
105
|
containers:
|
|
106
106
|
- name: dd-test-development-green
|
|
107
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
107
|
+
image: localhost/rockylinux9-underpost:v2.81.0
|
|
108
108
|
# resources:
|
|
109
109
|
# requests:
|
|
110
110
|
# memory: "96294Ki"
|
|
@@ -136,39 +136,39 @@ spec:
|
|
|
136
136
|
selector:
|
|
137
137
|
app: dd-test-development-green
|
|
138
138
|
ports:
|
|
139
|
-
- name: 'tcp-
|
|
139
|
+
- name: 'tcp-4041'
|
|
140
140
|
protocol: TCP
|
|
141
|
-
port:
|
|
142
|
-
targetPort:
|
|
143
|
-
- name: 'udp-
|
|
141
|
+
port: 4041
|
|
142
|
+
targetPort: 4041
|
|
143
|
+
- name: 'udp-4041'
|
|
144
144
|
protocol: UDP
|
|
145
|
-
port:
|
|
146
|
-
targetPort:
|
|
145
|
+
port: 4041
|
|
146
|
+
targetPort: 4041
|
|
147
147
|
|
|
148
|
-
- name: 'tcp-
|
|
148
|
+
- name: 'tcp-4042'
|
|
149
149
|
protocol: TCP
|
|
150
|
-
port:
|
|
151
|
-
targetPort:
|
|
152
|
-
- name: 'udp-
|
|
150
|
+
port: 4042
|
|
151
|
+
targetPort: 4042
|
|
152
|
+
- name: 'udp-4042'
|
|
153
153
|
protocol: UDP
|
|
154
|
-
port:
|
|
155
|
-
targetPort:
|
|
154
|
+
port: 4042
|
|
155
|
+
targetPort: 4042
|
|
156
156
|
|
|
157
|
-
- name: 'tcp-
|
|
157
|
+
- name: 'tcp-4043'
|
|
158
158
|
protocol: TCP
|
|
159
|
-
port:
|
|
160
|
-
targetPort:
|
|
161
|
-
- name: 'udp-
|
|
159
|
+
port: 4043
|
|
160
|
+
targetPort: 4043
|
|
161
|
+
- name: 'udp-4043'
|
|
162
162
|
protocol: UDP
|
|
163
|
-
port:
|
|
164
|
-
targetPort:
|
|
163
|
+
port: 4043
|
|
164
|
+
targetPort: 4043
|
|
165
165
|
|
|
166
|
-
- name: 'tcp-
|
|
166
|
+
- name: 'tcp-4044'
|
|
167
167
|
protocol: TCP
|
|
168
|
-
port:
|
|
169
|
-
targetPort:
|
|
170
|
-
- name: 'udp-
|
|
168
|
+
port: 4044
|
|
169
|
+
targetPort: 4044
|
|
170
|
+
- name: 'udp-4044'
|
|
171
171
|
protocol: UDP
|
|
172
|
-
port:
|
|
173
|
-
targetPort:
|
|
172
|
+
port: 4044
|
|
173
|
+
targetPort: 4044
|
|
174
174
|
type: LoadBalancer
|