@underpostnet/underpost 2.97.0 → 2.97.5
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/README.md +2 -2
- package/baremetal/commission-workflows.json +33 -3
- package/bin/deploy.js +1 -1
- package/cli.md +7 -2
- package/conf.js +3 -0
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
- package/package.json +1 -1
- package/packer/scripts/fuse-tar-root +3 -3
- package/scripts/disk-clean.sh +23 -23
- package/scripts/gpu-diag.sh +2 -2
- package/scripts/ip-info.sh +11 -11
- package/scripts/maas-upload-boot-resource.sh +1 -1
- package/scripts/nvim.sh +1 -1
- package/scripts/packer-setup.sh +13 -13
- package/scripts/rocky-setup.sh +2 -2
- package/scripts/rpmfusion-ffmpeg-setup.sh +4 -4
- package/scripts/ssl.sh +7 -7
- package/src/api/core/core.service.js +0 -5
- package/src/api/default/default.service.js +7 -5
- package/src/api/document/document.model.js +30 -1
- package/src/api/document/document.router.js +6 -0
- package/src/api/document/document.service.js +423 -51
- package/src/api/file/file.model.js +112 -4
- package/src/api/file/file.ref.json +42 -0
- package/src/api/file/file.service.js +380 -32
- package/src/api/user/user.model.js +38 -1
- package/src/api/user/user.router.js +96 -63
- package/src/api/user/user.service.js +81 -48
- package/src/cli/baremetal.js +689 -329
- package/src/cli/cluster.js +50 -52
- package/src/cli/db.js +424 -166
- package/src/cli/deploy.js +1 -1
- package/src/cli/index.js +12 -1
- package/src/cli/lxd.js +3 -3
- package/src/cli/repository.js +1 -1
- package/src/cli/run.js +2 -1
- package/src/cli/ssh.js +10 -10
- package/src/client/components/core/Account.js +327 -36
- package/src/client/components/core/AgGrid.js +3 -0
- package/src/client/components/core/Auth.js +9 -3
- package/src/client/components/core/Chat.js +2 -2
- package/src/client/components/core/Content.js +159 -78
- package/src/client/components/core/Css.js +16 -2
- package/src/client/components/core/CssCore.js +16 -12
- package/src/client/components/core/FileExplorer.js +115 -8
- package/src/client/components/core/Input.js +204 -11
- package/src/client/components/core/LogIn.js +42 -20
- package/src/client/components/core/Modal.js +257 -177
- package/src/client/components/core/Panel.js +324 -27
- package/src/client/components/core/PanelForm.js +280 -73
- package/src/client/components/core/PublicProfile.js +888 -0
- package/src/client/components/core/Router.js +117 -15
- package/src/client/components/core/SearchBox.js +1117 -0
- package/src/client/components/core/SignUp.js +26 -7
- package/src/client/components/core/SocketIo.js +6 -3
- package/src/client/components/core/Translate.js +98 -0
- package/src/client/components/core/Validator.js +15 -0
- package/src/client/components/core/windowGetDimensions.js +6 -6
- package/src/client/components/default/MenuDefault.js +59 -12
- package/src/client/components/default/RoutesDefault.js +1 -0
- package/src/client/services/core/core.service.js +163 -1
- package/src/client/services/default/default.management.js +451 -64
- package/src/client/services/default/default.service.js +13 -6
- package/src/client/services/document/document.service.js +23 -0
- package/src/client/services/file/file.service.js +43 -16
- package/src/client/services/user/user.service.js +13 -9
- package/src/db/DataBaseProvider.js +1 -1
- package/src/db/mongo/MongooseDB.js +1 -1
- package/src/index.js +1 -1
- package/src/mailer/MailerProvider.js +4 -4
- package/src/runtime/express/Express.js +2 -1
- package/src/runtime/lampp/Lampp.js +2 -2
- package/src/server/auth.js +3 -6
- package/src/server/data-query.js +449 -0
- package/src/server/dns.js +4 -4
- package/src/server/object-layer.js +0 -3
- package/src/ws/IoInterface.js +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- badges -->
|
|
20
20
|
|
|
21
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.97.5) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
22
22
|
|
|
23
23
|
<!-- end-badges -->
|
|
24
24
|
|
|
@@ -66,7 +66,7 @@ Run dev client server
|
|
|
66
66
|
npm run dev
|
|
67
67
|
```
|
|
68
68
|
<!-- -->
|
|
69
|
-
## underpost ci/cd cli v2.97.
|
|
69
|
+
## underpost ci/cd cli v2.97.5
|
|
70
70
|
|
|
71
71
|
### Usage: `underpost [options] [command]`
|
|
72
72
|
```
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"rpi4mbarm64-iso-ram": {
|
|
3
3
|
"type": "iso-ram",
|
|
4
|
+
"osIdLike": "debian ubuntu",
|
|
5
|
+
"isoUrl": "https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.3-live-server-arm64.iso",
|
|
4
6
|
"tftpPrefix": "rpi4mb",
|
|
5
7
|
"bootstrapHttpServerPort": 8888,
|
|
6
|
-
"isoUrl": "",
|
|
7
8
|
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 ISO-RAM commissioning (ARM64)",
|
|
8
9
|
"networkInterfaceName": "enabcm6e4ei0",
|
|
9
10
|
"chronyc": {
|
|
@@ -28,7 +29,8 @@
|
|
|
28
29
|
}
|
|
29
30
|
},
|
|
30
31
|
"rpi4mbarm64-chroot": {
|
|
31
|
-
"type": "chroot",
|
|
32
|
+
"type": "chroot-debootstrap",
|
|
33
|
+
"osIdLike": "debian ubuntu",
|
|
32
34
|
"tftpPrefix": "rpi4mb",
|
|
33
35
|
"bootstrapHttpServerPort": 8888,
|
|
34
36
|
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 CHROOT commissioning (ARM64)",
|
|
@@ -62,9 +64,10 @@
|
|
|
62
64
|
},
|
|
63
65
|
"rpi4mbarm64-iso-nfs": {
|
|
64
66
|
"type": "iso-nfs",
|
|
67
|
+
"osIdLike": "debian ubuntu",
|
|
68
|
+
"isoUrl": "https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.3-live-server-arm64.iso",
|
|
65
69
|
"tftpPrefix": "rpi4mb",
|
|
66
70
|
"bootstrapHttpServerPort": 8888,
|
|
67
|
-
"isoUrl": "",
|
|
68
71
|
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 ISO-NFS commissioning (ARM64)",
|
|
69
72
|
"networkInterfaceName": "enabcm6e4ei0",
|
|
70
73
|
"chronyc": {
|
|
@@ -87,5 +90,32 @@
|
|
|
87
90
|
"keyboard": {
|
|
88
91
|
"layout": "es"
|
|
89
92
|
}
|
|
93
|
+
},
|
|
94
|
+
"rpi4mbarm64-chroot-rocky9": {
|
|
95
|
+
"type": "chroot-container",
|
|
96
|
+
"osIdLike": "rhel centos fedora",
|
|
97
|
+
"tftpPrefix": "rpi4mb",
|
|
98
|
+
"bootstrapHttpServerPort": 8888,
|
|
99
|
+
"menuentryStr": "UNDERPOST.NET Rocky9 Container CHROOT NFS (ARM64)",
|
|
100
|
+
"networkInterfaceName": "eth0",
|
|
101
|
+
"firmwares": [
|
|
102
|
+
{
|
|
103
|
+
"url": "https://github.com/pftf/RPi4/releases/download/v1.41/RPi4_UEFI_Firmware_v1.41.zip",
|
|
104
|
+
"gateway": "192.168.1.1",
|
|
105
|
+
"subnet": "255.255.255.0"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"chronyc": {
|
|
109
|
+
"timezone": "America/Santiago",
|
|
110
|
+
"chronyConfPath": "/etc/chrony/chrony.conf"
|
|
111
|
+
},
|
|
112
|
+
"container": {
|
|
113
|
+
"image": "quay.io/rockylinux/rockylinux:9",
|
|
114
|
+
"architecture": "arm64",
|
|
115
|
+
"packages": ["kernel", "chrony", "kbd", "glibc-langpack-en", "glibc-langpack-es", "tzdata"]
|
|
116
|
+
},
|
|
117
|
+
"keyboard": {
|
|
118
|
+
"layout": "es"
|
|
119
|
+
}
|
|
90
120
|
}
|
|
91
121
|
}
|
package/bin/deploy.js
CHANGED
|
@@ -658,7 +658,7 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
658
658
|
|
|
659
659
|
// Remove PostgreSQL 17 packages and repo
|
|
660
660
|
shellExec(`sudo dnf remove -y postgresql17 postgresql17-server postgresql17-contrib`);
|
|
661
|
-
shellExec(`sudo rpm -e pgdg-redhat-repo-$(rpm -q pgdg-redhat-repo --qf '%{VERSION}-%{RELEASE}')
|
|
661
|
+
shellExec(`sudo rpm -e pgdg-redhat-repo-$(rpm -q pgdg-redhat-repo --qf '%{VERSION}-%{RELEASE}')`);
|
|
662
662
|
shellExec(`sudo rm -f /etc/yum.repos.d/pgdg-redhat-*.repo`);
|
|
663
663
|
|
|
664
664
|
// Clean up data, logs, config, and the postgres user
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.97.
|
|
1
|
+
## underpost ci/cd cli v2.97.5
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -51,7 +51,7 @@ Arguments:
|
|
|
51
51
|
app-name The name of the new project.
|
|
52
52
|
|
|
53
53
|
Options:
|
|
54
|
-
--deploy-id <deploy-id>
|
|
54
|
+
--deploy-id <deploy-id> Create deploy ID conf env files
|
|
55
55
|
--sub-conf <sub-conf> Create sub conf env files
|
|
56
56
|
--cluster Create deploy ID cluster files and sync to
|
|
57
57
|
current cluster
|
|
@@ -589,6 +589,8 @@ Options:
|
|
|
589
589
|
--paths <paths> Comma-separated list of paths to filter database operations.
|
|
590
590
|
--ns <ns-name> Kubernetes namespace context for database operations (defaults to "default").
|
|
591
591
|
--macro-rollback-export <n-commits-reset> Exports a macro rollback script that reverts the last n commits (Git integration required).
|
|
592
|
+
--clean-fs-collection Cleans orphaned File documents from collections that are not referenced by any models.
|
|
593
|
+
--clean-fs-dry-run Dry run mode - shows what would be deleted without actually deleting (use with --clean-fs-collection).
|
|
592
594
|
--dev Sets the development cli context
|
|
593
595
|
--kubeadm Enables the kubeadm context for database operations.
|
|
594
596
|
--kind Enables the kind context for database operations.
|
|
@@ -940,11 +942,14 @@ Options:
|
|
|
940
942
|
--nfs-build Builds an NFS root filesystem for a workflow id config architecture using QEMU emulation.
|
|
941
943
|
--nfs-mount Mounts the NFS root filesystem for a workflow id config architecture.
|
|
942
944
|
--nfs-unmount Unmounts the NFS root filesystem for a workflow id config architecture.
|
|
945
|
+
--nfs-build-server Builds the NFS server for a workflow id config architecture.
|
|
943
946
|
--nfs-sh Copies QEMU emulation root entrypoint shell command to the clipboard.
|
|
944
947
|
--cloud-init Sets the kernel parameters and sets the necessary seed users on the HTTP server.
|
|
945
948
|
--cloud-init-update Updates cloud init for a workflow id config architecture.
|
|
946
949
|
--ubuntu-tools-build Builds ubuntu tools for chroot environment.
|
|
947
950
|
--ubuntu-tools-test Tests ubuntu tools in chroot environment.
|
|
951
|
+
--rocky-tools-build Builds rocky linux tools for chroot environment.
|
|
952
|
+
--rocky-tools-test Tests rocky linux tools in chroot environment.
|
|
948
953
|
--bootcmd <bootcmd-list> Comma-separated list of boot commands to execute.
|
|
949
954
|
--runcmd <runcmd-list> Comma-separated list of run commands to execute.
|
|
950
955
|
--logs <log-id> Displays logs for log id: dhcp, cloud, machine, cloud-config.
|
package/conf.js
CHANGED
|
@@ -39,6 +39,7 @@ const DefaultConf = /**/ {
|
|
|
39
39
|
'LogOut',
|
|
40
40
|
'Router',
|
|
41
41
|
'Account',
|
|
42
|
+
'PublicProfile',
|
|
42
43
|
'Auth',
|
|
43
44
|
'FullScreen',
|
|
44
45
|
'RichText',
|
|
@@ -65,6 +66,7 @@ const DefaultConf = /**/ {
|
|
|
65
66
|
'500',
|
|
66
67
|
'Pagination',
|
|
67
68
|
'windowGetDimensions',
|
|
69
|
+
'SearchBox',
|
|
68
70
|
],
|
|
69
71
|
default: [
|
|
70
72
|
'MenuDefault',
|
|
@@ -90,6 +92,7 @@ const DefaultConf = /**/ {
|
|
|
90
92
|
{ path: '/account', client: 'Default', ssr: 'Default' },
|
|
91
93
|
{ path: '/docs', client: 'Default', ssr: 'Default' },
|
|
92
94
|
{ path: '/recover', client: 'Default', ssr: 'Default' },
|
|
95
|
+
{ path: '/u', client: 'Default', ssr: 'Default' },
|
|
93
96
|
{ path: '/default-management', client: 'Default', ssr: 'Default' },
|
|
94
97
|
{ client: 'Default', ssr: 'Default', path: '/404', title: '404 Not Found' },
|
|
95
98
|
{ client: 'Default', ssr: 'Default', path: '/500', title: '500 Server Error' },
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.97.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.97.5
|
|
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.97.
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.97.5
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -18,7 +18,7 @@ spec:
|
|
|
18
18
|
spec:
|
|
19
19
|
containers:
|
|
20
20
|
- name: dd-test-development-blue
|
|
21
|
-
image: localhost/rockylinux9-underpost:v2.97.
|
|
21
|
+
image: localhost/rockylinux9-underpost:v2.97.5
|
|
22
22
|
|
|
23
23
|
command:
|
|
24
24
|
- /bin/sh
|
|
@@ -103,7 +103,7 @@ spec:
|
|
|
103
103
|
spec:
|
|
104
104
|
containers:
|
|
105
105
|
- name: dd-test-development-green
|
|
106
|
-
image: localhost/rockylinux9-underpost:v2.97.
|
|
106
|
+
image: localhost/rockylinux9-underpost:v2.97.5
|
|
107
107
|
|
|
108
108
|
command:
|
|
109
109
|
- /bin/sh
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "@underpostnet/underpost",
|
|
5
|
-
"version": "2.97.
|
|
5
|
+
"version": "2.97.5",
|
|
6
6
|
"description": "pwa api rest template",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
@@ -25,13 +25,13 @@ MOUNT_POINT=$(mktemp -d /tmp/packer-maas-mount.XXXXXX)
|
|
|
25
25
|
cleanup() {
|
|
26
26
|
echo "Cleaning up..."
|
|
27
27
|
if mountpoint -q "${MOUNT_POINT}"; then
|
|
28
|
-
umount "${MOUNT_POINT}"
|
|
28
|
+
umount "${MOUNT_POINT}"
|
|
29
29
|
fi
|
|
30
30
|
if [ -n "${NBD_DEV}" ] && [ -b "${NBD_DEV}" ]; then
|
|
31
|
-
qemu-nbd -d "${NBD_DEV}"
|
|
31
|
+
qemu-nbd -d "${NBD_DEV}"
|
|
32
32
|
fi
|
|
33
33
|
if [ -d "${MOUNT_POINT}" ]; then
|
|
34
|
-
rmdir "${MOUNT_POINT}"
|
|
34
|
+
rmdir "${MOUNT_POINT}"
|
|
35
35
|
fi
|
|
36
36
|
}
|
|
37
37
|
|
package/scripts/disk-clean.sh
CHANGED
|
@@ -36,12 +36,12 @@ du -xh --max-depth=1 / | sort -rh | head -n 20
|
|
|
36
36
|
|
|
37
37
|
# 1) DNF cleanup
|
|
38
38
|
log "Cleaning DNF caches and removing orphaned packages..."
|
|
39
|
-
dnf -y clean all
|
|
40
|
-
dnf -y autoremove
|
|
39
|
+
dnf -y clean all
|
|
40
|
+
dnf -y autoremove
|
|
41
41
|
|
|
42
42
|
# 2) Journal logs vacuum
|
|
43
43
|
log "Vacuuming systemd journal to keep ${VACUUM_SIZE}..."
|
|
44
|
-
journalctl --vacuum-size="$VACUUM_SIZE"
|
|
44
|
+
journalctl --vacuum-size="$VACUUM_SIZE"
|
|
45
45
|
|
|
46
46
|
# 3) Truncate very large logs in /var/log (safer than delete)
|
|
47
47
|
log "Truncating logs in /var/log larger than ${LARGE_LOG_SIZE} (keeps zero-sized file so services don't break)..."
|
|
@@ -52,12 +52,12 @@ done
|
|
|
52
52
|
|
|
53
53
|
# 4) Clean /tmp and /var/tmp older than TMP_AGE_DAYS
|
|
54
54
|
log "Removing files older than ${TMP_AGE_DAYS} days from /tmp and /var/tmp..."
|
|
55
|
-
find /tmp -mindepth 1 -mtime +"$TMP_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -rf --
|
|
56
|
-
find /var/tmp -mindepth 1 -mtime +"$TMP_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -rf --
|
|
55
|
+
find /tmp -mindepth 1 -mtime +"$TMP_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -rf --
|
|
56
|
+
find /var/tmp -mindepth 1 -mtime +"$TMP_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -rf --
|
|
57
57
|
|
|
58
58
|
# 5) Clean /var/cache older than CACHE_AGE_DAYS (but not all cache immediately)
|
|
59
59
|
log "Removing entries in /var/cache older than ${CACHE_AGE_DAYS} days..."
|
|
60
|
-
find /var/cache -mindepth 1 -mtime +"$CACHE_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -rf --
|
|
60
|
+
find /var/cache -mindepth 1 -mtime +"$CACHE_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -rf --
|
|
61
61
|
|
|
62
62
|
# 6) Clean user caches (~/.cache) and Downloads older than CACHE_AGE_DAYS
|
|
63
63
|
log "Cleaning user caches and old downloads (home dirs)..."
|
|
@@ -69,60 +69,60 @@ for homedir in /home/* /root; do
|
|
|
69
69
|
|
|
70
70
|
if [ -d "$usercache" ]; then
|
|
71
71
|
log "Removing contents of $usercache"
|
|
72
|
-
rm -rf "${usercache:?}/"* 2>/dev/null
|
|
72
|
+
rm -rf "${usercache:?}/"* 2>/dev/null
|
|
73
73
|
fi
|
|
74
74
|
if [ -d "$userdownloads" ]; then
|
|
75
75
|
log "Removing files older than ${CACHE_AGE_DAYS} days from $userdownloads"
|
|
76
|
-
find "$userdownloads" -type f -mtime +"$CACHE_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -f -- 2>/dev/null
|
|
76
|
+
find "$userdownloads" -type f -mtime +"$CACHE_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -f -- 2>/dev/null
|
|
77
77
|
fi
|
|
78
78
|
if [ -d "$usertrash" ]; then
|
|
79
79
|
log "Emptying trash in $usertrash"
|
|
80
|
-
rm -rf "${usertrash:?}/"* 2>/dev/null
|
|
80
|
+
rm -rf "${usertrash:?}/"* 2>/dev/null
|
|
81
81
|
fi
|
|
82
82
|
done
|
|
83
83
|
|
|
84
84
|
# 7) Docker / Podman cleanup (if present)
|
|
85
85
|
if command -v docker >/dev/null 2>&1; then
|
|
86
86
|
log "Docker detected: pruning images/containers/volumes (aggressive)..."
|
|
87
|
-
docker system df
|
|
88
|
-
docker system prune -a --volumes -f
|
|
87
|
+
docker system df
|
|
88
|
+
docker system prune -a --volumes -f
|
|
89
89
|
fi
|
|
90
90
|
|
|
91
91
|
if command -v podman >/dev/null 2>&1; then
|
|
92
92
|
log "Podman detected: pruning images/containers (aggressive)..."
|
|
93
|
-
podman system df
|
|
94
|
-
podman system prune -a -f
|
|
93
|
+
podman system df
|
|
94
|
+
podman system prune -a -f
|
|
95
95
|
fi
|
|
96
96
|
|
|
97
97
|
# 8) Flatpak unused runtimes/apps (if present)
|
|
98
98
|
if command -v flatpak >/dev/null 2>&1; then
|
|
99
99
|
log "Flatpak detected: trying to uninstall unused runtimes/apps..."
|
|
100
|
-
flatpak uninstall --unused -y || flatpak uninstall --unused
|
|
101
|
-
flatpak repair
|
|
100
|
+
flatpak uninstall --unused -y || flatpak uninstall --unused
|
|
101
|
+
flatpak repair
|
|
102
102
|
fi
|
|
103
103
|
|
|
104
104
|
# 9) Python Pip cleanup
|
|
105
105
|
if command -v pip3 >/dev/null 2>&1 || command -v pip >/dev/null 2>&1; then
|
|
106
106
|
log "Python Pip detected: cleaning cache..."
|
|
107
107
|
if command -v pip3 >/dev/null 2>&1; then
|
|
108
|
-
pip3 cache purge
|
|
108
|
+
pip3 cache purge
|
|
109
109
|
elif command -v pip >/dev/null 2>&1; then
|
|
110
|
-
pip cache purge
|
|
110
|
+
pip cache purge
|
|
111
111
|
fi
|
|
112
112
|
fi
|
|
113
113
|
|
|
114
114
|
# 10) Conda cleanup
|
|
115
115
|
if command -v conda >/dev/null 2>&1; then
|
|
116
116
|
log "Conda detected: cleaning all..."
|
|
117
|
-
conda clean --all -y
|
|
117
|
+
conda clean --all -y
|
|
118
118
|
fi
|
|
119
119
|
|
|
120
120
|
# 11) Remove old kernels but keep the last KEEP_KERNELS (safe)
|
|
121
121
|
log "Removing old kernels, keeping the last $KEEP_KERNELS kernels..."
|
|
122
|
-
OLD_KERNELS=$(dnf repoquery --installonly --latest-limit=-$KEEP_KERNELS -q 2>/dev/null
|
|
122
|
+
OLD_KERNELS=$(dnf repoquery --installonly --latest-limit=-$KEEP_KERNELS -q 2>/dev/null)
|
|
123
123
|
if [ -n "$OLD_KERNELS" ]; then
|
|
124
124
|
log "Old kernels to remove: $OLD_KERNELS"
|
|
125
|
-
dnf -y remove $OLD_KERNELS
|
|
125
|
+
dnf -y remove $OLD_KERNELS
|
|
126
126
|
else
|
|
127
127
|
log "No old kernels found by DNF repoquery. Only $KEEP_KERNELS or fewer are currently installed."
|
|
128
128
|
fi
|
|
@@ -130,14 +130,14 @@ fi
|
|
|
130
130
|
# 12) /opt review and removal (ON by default now)
|
|
131
131
|
if [ -d /opt ]; then
|
|
132
132
|
log "/opt usage (top entries):"
|
|
133
|
-
du -sh /opt/* 2>/dev/null | sort -h | head -n 20
|
|
133
|
+
du -sh /opt/* 2>/dev/null | sort -h | head -n 20
|
|
134
134
|
|
|
135
135
|
if [ "$REMOVE_OPT" = "1" ]; then
|
|
136
136
|
OPT_TARGETS=(/opt/local-path-provisioner)
|
|
137
137
|
for t in "${OPT_TARGETS[@]}"; do
|
|
138
138
|
if [ -d "$t" ]; then
|
|
139
139
|
log "Removing $t as REMOVE_OPT=1"
|
|
140
|
-
rm -rf "$t"
|
|
140
|
+
rm -rf "$t"
|
|
141
141
|
fi
|
|
142
142
|
done
|
|
143
143
|
else
|
|
@@ -147,7 +147,7 @@ fi
|
|
|
147
147
|
|
|
148
148
|
# 13) Find large files > 100MB (report only)
|
|
149
149
|
log "Listing files larger than 100MB (report only):"
|
|
150
|
-
find / -xdev -type f -size +100M -printf '%s\t%p\n' 2>/dev/null | sort -nr | head -n 50 | awk '{printf "%.1fMB\t%s\n",$1/1024/1024,$2}'
|
|
150
|
+
find / -xdev -type f -size +100M -printf '%s\t%p\n' 2>/dev/null | sort -nr | head -n 50 | awk '{printf "%.1fMB\t%s\n",$1/1024/1024,$2}'
|
|
151
151
|
|
|
152
152
|
# Final disk usage
|
|
153
153
|
log "Disk usage after cleanup:"
|
package/scripts/gpu-diag.sh
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
sudo lspci -nnk | egrep -i 'vga|3d' -A3
|
|
3
3
|
|
|
4
4
|
# modules loaded relevant
|
|
5
|
-
lsmod | egrep 'nvidia|nouveau|amdgpu'
|
|
5
|
+
lsmod | egrep 'nvidia|nouveau|amdgpu'
|
|
6
6
|
|
|
7
7
|
# if exists nvidia tool
|
|
8
8
|
nvidia-smi 2>/dev/null || echo "nvidia-smi not found"
|
|
@@ -16,4 +16,4 @@ journalctl -b _COMM=gdm --no-pager | tail -n 200
|
|
|
16
16
|
journalctl -b _COMM=Xorg --no-pager | tail -n 200
|
|
17
17
|
|
|
18
18
|
# X log (if exists)
|
|
19
|
-
sudo grep -E "(EE|WW|NVIDIA|nouveau|amdgpu)" /var/log/Xorg.0.log
|
|
19
|
+
sudo grep -E "(EE|WW|NVIDIA|nouveau|amdgpu)" /var/log/Xorg.0.log
|
package/scripts/ip-info.sh
CHANGED
|
@@ -77,39 +77,39 @@ for IP in "${IPS[@]}"; do
|
|
|
77
77
|
" "$TARGET" "$IP"
|
|
78
78
|
|
|
79
79
|
echo "-- REVERSE DNS --"
|
|
80
|
-
dig -x "$IP" +short
|
|
80
|
+
dig -x "$IP" +short
|
|
81
81
|
|
|
82
82
|
echo "
|
|
83
83
|
-- WHOIS --"
|
|
84
|
-
whois "$IP" | sed -n '1,80p'
|
|
84
|
+
whois "$IP" | sed -n '1,80p'
|
|
85
85
|
|
|
86
86
|
echo "
|
|
87
87
|
-- IPINFO (ipinfo.io) --"
|
|
88
|
-
curl -sS "https://ipinfo.io/$IP/json" | format
|
|
88
|
+
curl -sS "https://ipinfo.io/$IP/json" | format
|
|
89
89
|
|
|
90
90
|
echo "
|
|
91
91
|
-- IP-API (ip-api.com) --"
|
|
92
|
-
curl -sS "http://ip-api.com/json/$IP?fields=status,message,country,regionName,city,zip,lat,lon,timezone,isp,org,as,query" | format
|
|
92
|
+
curl -sS "http://ip-api.com/json/$IP?fields=status,message,country,regionName,city,zip,lat,lon,timezone,isp,org,as,query" | format
|
|
93
93
|
|
|
94
94
|
echo "
|
|
95
95
|
-- IPWHOIS (ipwhois.app) --"
|
|
96
|
-
curl -sS "https://ipwhois.app/json/$IP" | format
|
|
96
|
+
curl -sS "https://ipwhois.app/json/$IP" | format
|
|
97
97
|
|
|
98
98
|
echo "
|
|
99
99
|
-- GEOPLUGIN --"
|
|
100
|
-
curl -sS "http://www.geoplugin.net/json.gp?ip=$IP" | format
|
|
100
|
+
curl -sS "http://www.geoplugin.net/json.gp?ip=$IP" | format
|
|
101
101
|
|
|
102
102
|
echo "
|
|
103
103
|
-- TRACEROUTE --"
|
|
104
|
-
traceroute -m 20 "$IP"
|
|
104
|
+
traceroute -m 20 "$IP"
|
|
105
105
|
|
|
106
106
|
if [[ "$TARGET" =~ [A-Za-z] ]]; then
|
|
107
107
|
echo "
|
|
108
108
|
-- DNS RECORDS for $TARGET --"
|
|
109
|
-
dig +short A "$TARGET"
|
|
110
|
-
dig +short AAAA "$TARGET"
|
|
111
|
-
dig +short MX "$TARGET"
|
|
112
|
-
dig +short TXT "$TARGET"
|
|
109
|
+
dig +short A "$TARGET"
|
|
110
|
+
dig +short AAAA "$TARGET"
|
|
111
|
+
dig +short MX "$TARGET"
|
|
112
|
+
dig +short TXT "$TARGET"
|
|
113
113
|
fi
|
|
114
114
|
|
|
115
115
|
echo "
|
|
@@ -33,7 +33,7 @@ if ! command -v jq &> /dev/null; then
|
|
|
33
33
|
fi
|
|
34
34
|
|
|
35
35
|
# Get MAAS API URL and credentials from profile
|
|
36
|
-
MAAS_INFO=$(maas list | grep "^${PROFILE}"
|
|
36
|
+
MAAS_INFO=$(maas list | grep "^${PROFILE}")
|
|
37
37
|
if [ -z "$MAAS_INFO" ]; then
|
|
38
38
|
echo "Error: MAAS profile '${PROFILE}' not found"
|
|
39
39
|
echo "Available profiles:"
|
package/scripts/nvim.sh
CHANGED
|
@@ -80,7 +80,7 @@ autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NvimTreeToggle | winc
|
|
|
80
80
|
EOF
|
|
81
81
|
|
|
82
82
|
# Fix permissions in case something was left owned by root (happens if you used sudo on these paths before)
|
|
83
|
-
sudo chown -R "$USER":"$USER" ~/.config/nvim ~/.local/share/nvim 2>/dev/null
|
|
83
|
+
sudo chown -R "$USER":"$USER" ~/.config/nvim ~/.local/share/nvim 2>/dev/null
|
|
84
84
|
|
|
85
85
|
# Install plugins automatically (non-interactive)
|
|
86
86
|
nvim +PlugInstall +qall
|
package/scripts/packer-setup.sh
CHANGED
|
@@ -39,13 +39,13 @@ print "Distro detected: $PRETTY_NAME"
|
|
|
39
39
|
# Enable helpful repos and install helpers
|
|
40
40
|
print "Installing dnf-plugins-core and enabling CRB/PowerTools (if available)"
|
|
41
41
|
set +e
|
|
42
|
-
dnf install -y dnf-plugins-core >/dev/null 2>&1
|
|
43
|
-
dnf config-manager --set-enabled crb >/dev/null 2>&1
|
|
44
|
-
dnf config-manager --set-enabled powertools >/dev/null 2>&1
|
|
42
|
+
dnf install -y dnf-plugins-core >/dev/null 2>&1
|
|
43
|
+
dnf config-manager --set-enabled crb >/dev/null 2>&1
|
|
44
|
+
dnf config-manager --set-enabled powertools >/dev/null 2>&1
|
|
45
45
|
# EPEL
|
|
46
46
|
if ! rpm -q epel-release >/dev/null 2>&1; then
|
|
47
47
|
print "Installing epel-release"
|
|
48
|
-
dnf install -y epel-release
|
|
48
|
+
dnf install -y epel-release
|
|
49
49
|
fi
|
|
50
50
|
set -e
|
|
51
51
|
|
|
@@ -86,7 +86,7 @@ done
|
|
|
86
86
|
|
|
87
87
|
print "Enabling and starting libvirtd"
|
|
88
88
|
systemctl enable --now libvirtd || err "Failed to enable/start libvirtd"
|
|
89
|
-
systemctl status libvirtd --no-pager
|
|
89
|
+
systemctl status libvirtd --no-pager
|
|
90
90
|
|
|
91
91
|
# 3) Install NBD and filesystem tools required for MAAS image creation
|
|
92
92
|
print "Installing NBD and filesystem tooling: libnbd, nbdkit, e2fsprogs, kmod packages (best-effort)"
|
|
@@ -125,7 +125,7 @@ if command -v podman >/dev/null 2>&1; then
|
|
|
125
125
|
fi
|
|
126
126
|
done
|
|
127
127
|
|
|
128
|
-
podman rm "$CONTAINER_ID" >/dev/null 2>&1
|
|
128
|
+
podman rm "$CONTAINER_ID" >/dev/null 2>&1
|
|
129
129
|
fi
|
|
130
130
|
else
|
|
131
131
|
print "podman not available. Install podman to register binfmt for container/chroot convenience."
|
|
@@ -181,8 +181,8 @@ else
|
|
|
181
181
|
print "qemu-system-aarch64 now available after package install"
|
|
182
182
|
else
|
|
183
183
|
print "Compiling QEMU with aarch64-softmmu target. Installing build deps..."
|
|
184
|
-
dnf groupinstall -y 'Development Tools'
|
|
185
|
-
dnf install -y git libaio-devel libgcrypt-devel libfdt-devel glib2-devel zlib-devel pixman-devel libseccomp-devel libusb1-devel openssl-devel bison flex python3 python3-pip ninja-build
|
|
184
|
+
dnf groupinstall -y 'Development Tools'
|
|
185
|
+
dnf install -y git libaio-devel libgcrypt-devel libfdt-devel glib2-devel zlib-devel pixman-devel libseccomp-devel libusb1-devel openssl-devel bison flex python3 python3-pip ninja-build
|
|
186
186
|
|
|
187
187
|
# Enforce libslirp-devel for user networking
|
|
188
188
|
if ! dnf install -y libslirp-devel; then
|
|
@@ -192,8 +192,8 @@ else
|
|
|
192
192
|
|
|
193
193
|
# Install required Python packages for QEMU build
|
|
194
194
|
print "Installing Python dependencies for QEMU build"
|
|
195
|
-
python3 -m pip install --upgrade pip
|
|
196
|
-
python3 -m pip install tomli meson
|
|
195
|
+
python3 -m pip install --upgrade pip
|
|
196
|
+
python3 -m pip install tomli meson
|
|
197
197
|
|
|
198
198
|
TMPDIR=$(mktemp -d)
|
|
199
199
|
print "Cloning QEMU source to $TMPDIR/qemu"
|
|
@@ -209,7 +209,7 @@ else
|
|
|
209
209
|
make install || err "QEMU install failed"
|
|
210
210
|
# Update PATH to include /usr/local/bin where QEMU was installed
|
|
211
211
|
export PATH="/usr/local/bin:$PATH"
|
|
212
|
-
hash -r
|
|
212
|
+
hash -r
|
|
213
213
|
else
|
|
214
214
|
err "QEMU build (make) failed"
|
|
215
215
|
fi
|
|
@@ -224,7 +224,7 @@ else
|
|
|
224
224
|
fi
|
|
225
225
|
|
|
226
226
|
cd /
|
|
227
|
-
rm -rf "$TMPDIR"
|
|
227
|
+
rm -rf "$TMPDIR"
|
|
228
228
|
print "Removed build directory $TMPDIR"
|
|
229
229
|
fi
|
|
230
230
|
fi
|
|
@@ -242,7 +242,7 @@ else
|
|
|
242
242
|
fi
|
|
243
243
|
if command -v qemu-aarch64-static >/dev/null 2>&1; then print "qemu-aarch64-static: $(command -v qemu-aarch64-static)"; else print "qemu-aarch64-static: NOT INSTALLED"; fi
|
|
244
244
|
print "libvirtd status:"
|
|
245
|
-
systemctl status libvirtd --no-pager
|
|
245
|
+
systemctl status libvirtd --no-pager
|
|
246
246
|
|
|
247
247
|
cat <<'EOF'
|
|
248
248
|
|
package/scripts/rocky-setup.sh
CHANGED
|
@@ -9,19 +9,19 @@ if [ "${EUID:-$(id -u)}" -ne 0 ]; then
|
|
|
9
9
|
fi
|
|
10
10
|
|
|
11
11
|
echo "1) Ensure dnf-plugins-core is available (for config-manager)"
|
|
12
|
-
dnf -y install dnf-plugins-core
|
|
12
|
+
dnf -y install dnf-plugins-core
|
|
13
13
|
|
|
14
14
|
echo "2) Enable CodeReady / CRB (needed for some deps, e.g. ladspa)"
|
|
15
15
|
# On RHEL you'd use subscription-manager; on CentOS/Rocky/Alma use config-manager
|
|
16
|
-
dnf config-manager --set-enabled crb
|
|
16
|
+
dnf config-manager --set-enabled crb
|
|
17
17
|
|
|
18
18
|
echo "3) Install EPEL release (required by some ffmpeg deps)"
|
|
19
|
-
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
|
|
19
|
+
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
|
|
20
20
|
|
|
21
21
|
echo "4) Add RPM Fusion (free + nonfree) repositories"
|
|
22
22
|
# Using mirrors.rpmfusion.org recommended links
|
|
23
23
|
dnf -y install https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm \
|
|
24
|
-
https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-9.noarch.rpm
|
|
24
|
+
https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-9.noarch.rpm
|
|
25
25
|
|
|
26
26
|
echo "5) Refresh metadata and update system"
|
|
27
27
|
dnf -y makecache
|
package/scripts/ssl.sh
CHANGED
|
@@ -48,7 +48,7 @@ info "Outputs: $CERT_FILE, $KEY_FILE, $FULLCHAIN_FILE, $ROOT_PEM"
|
|
|
48
48
|
|
|
49
49
|
# Install prerequisites
|
|
50
50
|
if ! command -v dnf >/dev/null 2>&1; then err "dnf not found. This script expects RHEL/Rocky with dnf."; exit 1; fi
|
|
51
|
-
sudo dnf install -y curl nss-tools ca-certificates
|
|
51
|
+
sudo dnf install -y curl nss-tools ca-certificates
|
|
52
52
|
|
|
53
53
|
# Download and install mkcert binary (no 'go install')
|
|
54
54
|
download_mkcert_binary() {
|
|
@@ -60,10 +60,10 @@ download_mkcert_binary() {
|
|
|
60
60
|
esac
|
|
61
61
|
info "Searching mkcert release for $ARCH_STR"
|
|
62
62
|
ASSET_URL=$(curl -sS "https://api.github.com/repos/FiloSottile/mkcert/releases/latest" | \
|
|
63
|
-
grep -E '"browser_download_url":' | grep -i "$ARCH_STR" | head -n1 | sed -E 's/.*"(https:[^"]+)".*/\1/'
|
|
63
|
+
grep -E '"browser_download_url":' | grep -i "$ARCH_STR" | head -n1 | sed -E 's/.*"(https:[^"]+)".*/\1/')
|
|
64
64
|
if [[ -z "$ASSET_URL" ]]; then
|
|
65
65
|
ASSET_URL=$(curl -sS "https://api.github.com/repos/FiloSottile/mkcert/releases/latest" | \
|
|
66
|
-
grep -E '"browser_download_url":' | grep -i 'linux' | grep -i 'amd64' | head -n1 | sed -E 's/.*"(https:[^"]+)".*/\1/'
|
|
66
|
+
grep -E '"browser_download_url":' | grep -i 'linux' | grep -i 'amd64' | head -n1 | sed -E 's/.*"(https:[^"]+)".*/\1/')
|
|
67
67
|
fi
|
|
68
68
|
if [[ -z "$ASSET_URL" ]]; then err "Could not find mkcert asset for your arch"; return 1; fi
|
|
69
69
|
TMP_BIN="$(mktemp -u /tmp/mkcert.XXXXXX)"
|
|
@@ -93,7 +93,7 @@ use_mkcert() {
|
|
|
93
93
|
info "Generating cert+key with mkcert"
|
|
94
94
|
if ! "$MKCERT_BIN" -cert-file "$CERT_FILE" -key-file "$KEY_FILE" "${MK_ARGS[@]}"; then err "mkcert failed to generate"; return 1; fi
|
|
95
95
|
# copy root CA from mkcert CAROOT into TARGET_DIR
|
|
96
|
-
if ROOT_FROM_MKCERT="$($MKCERT_BIN -CAROOT 2>/dev/null
|
|
96
|
+
if ROOT_FROM_MKCERT="$($MKCERT_BIN -CAROOT 2>/dev/null)"; then
|
|
97
97
|
if [[ -f "$ROOT_FROM_MKCERT/rootCA.pem" ]]; then
|
|
98
98
|
cp "$ROOT_FROM_MKCERT/rootCA.pem" "$ROOT_PEM"
|
|
99
99
|
info "Copied mkcert root CA to $ROOT_PEM"
|
|
@@ -135,11 +135,11 @@ use_openssl() {
|
|
|
135
135
|
mv -f "$CSR_KEY" "$KEY_FILE"
|
|
136
136
|
# create fullchain: leaf + root
|
|
137
137
|
cat "$CERT_FILE" "$ROOT_PEM" > "$FULLCHAIN_FILE"
|
|
138
|
-
sudo cp "$ROOT_PEM" /etc/pki/ca-trust/source/anchors/
|
|
139
|
-
sudo update-ca-trust extract
|
|
138
|
+
sudo cp "$ROOT_PEM" /etc/pki/ca-trust/source/anchors/
|
|
139
|
+
sudo update-ca-trust extract
|
|
140
140
|
if command -v certutil >/dev/null 2>&1; then
|
|
141
141
|
mkdir -p "$HOME/.pki/nssdb"
|
|
142
|
-
certutil -d sql:$HOME/.pki/nssdb -A -t "CT,C,C" -n "Local Dev Root CA" -i "$ROOT_PEM"
|
|
142
|
+
certutil -d sql:$HOME/.pki/nssdb -A -t "CT,C,C" -n "Local Dev Root CA" -i "$ROOT_PEM"
|
|
143
143
|
fi
|
|
144
144
|
info "OpenSSL created cert, key and fullchain"
|
|
145
145
|
return 0
|
|
@@ -8,11 +8,6 @@ const CoreService = {
|
|
|
8
8
|
post: async (req, res, options) => {
|
|
9
9
|
/** @type {import('./core.model.js').CoreModel} */
|
|
10
10
|
const Core = DataBaseProvider.instance[`${options.host}${options.path}`].mongoose.models.Core;
|
|
11
|
-
if (req.path.startsWith('/sh')) {
|
|
12
|
-
if (req.body.stdout) return shellExec(req.body.sh, { stdout: true });
|
|
13
|
-
shellExec(req.body.sh, { async: true });
|
|
14
|
-
return 'Command "' + req.body.sh + '" running';
|
|
15
|
-
}
|
|
16
11
|
return await new Core(req.body).save();
|
|
17
12
|
},
|
|
18
13
|
get: async (req, res, options) => {
|