@underpostnet/underpost 2.97.5 → 2.98.1

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.
Files changed (34) hide show
  1. package/.vscode/settings.json +7 -8
  2. package/README.md +2 -2
  3. package/bin/build.js +21 -5
  4. package/bin/deploy.js +1 -0
  5. package/bin/file.js +2 -1
  6. package/bin/util.js +0 -17
  7. package/cli.md +2 -2
  8. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  9. package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
  10. package/package.json +2 -4
  11. package/scripts/rocky-pwa.sh +200 -0
  12. package/scripts/rocky-setup.sh +12 -39
  13. package/src/api/document/document.model.js +1 -1
  14. package/src/api/document/document.service.js +88 -98
  15. package/src/cli/cluster.js +5 -9
  16. package/src/cli/repository.js +9 -9
  17. package/src/cli/run.js +108 -106
  18. package/src/client/components/core/Auth.js +2 -0
  19. package/src/client/components/core/Content.js +52 -4
  20. package/src/client/components/core/Css.js +30 -0
  21. package/src/client/components/core/FileExplorer.js +699 -42
  22. package/src/client/components/core/Input.js +3 -1
  23. package/src/client/components/core/Panel.js +93 -23
  24. package/src/client/components/core/PanelForm.js +1 -0
  25. package/src/client/components/core/Responsive.js +15 -7
  26. package/src/client/components/core/SearchBox.js +0 -110
  27. package/src/client/components/core/Translate.js +58 -0
  28. package/src/client/services/default/default.management.js +327 -148
  29. package/src/client/sw/default.sw.js +107 -184
  30. package/src/index.js +58 -20
  31. package/src/client/components/core/ObjectLayerEngine.js +0 -1520
  32. package/src/client/components/core/ObjectLayerEngineModal.js +0 -1245
  33. package/src/client/components/core/ObjectLayerEngineViewer.js +0 -880
  34. package/src/server/object-layer.js +0 -335
@@ -4,10 +4,10 @@
4
4
  "explorer.compactFolders": false,
5
5
  "javascript.preferences.importModuleSpecifierEnding": "js",
6
6
  "[javascript]": {
7
- "editor.defaultFormatter": "esbenp.prettier-vscode"
7
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
8
8
  },
9
9
  "[python]": {
10
- "editor.defaultFormatter": "ms-python.python"
10
+ "editor.defaultFormatter": "ms-python.python",
11
11
  },
12
12
  "cSpell.words": [
13
13
  "adminer",
@@ -40,7 +40,6 @@
40
40
  "htmls",
41
41
  "inet",
42
42
  "inlt",
43
- "ipfs",
44
43
  "Itemledger",
45
44
  "jsonld",
46
45
  "lampp",
@@ -72,16 +71,16 @@
72
71
  "webroot",
73
72
  "xampp",
74
73
  "xfwd",
75
- "youtu"
74
+ "youtu",
76
75
  ],
77
76
  "[php]": {
78
- "editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
77
+ "editor.defaultFormatter": "bmewburn.vscode-intelephense-client",
79
78
  },
80
79
  "[xml]": {
81
- "editor.defaultFormatter": "redhat.vscode-xml"
80
+ "editor.defaultFormatter": "redhat.vscode-xml",
82
81
  },
83
82
 
84
83
  "files.watcherExclude": {
85
- "**/target": true
86
- }
84
+ "**/target": true,
85
+ },
87
86
  }
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  <!-- badges -->
20
20
 
21
- [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.97.5)](https://socket.dev/npm/package/underpost/overview/2.97.5) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
21
+ [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.98.1)](https://socket.dev/npm/package/underpost/overview/2.98.1) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](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.5
69
+ ## underpost ci/cd cli v2.98.1
70
70
 
71
71
  ### Usage: `underpost [options] [command]`
72
72
  ```
package/bin/build.js CHANGED
@@ -159,6 +159,7 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
159
159
  recursive: true,
160
160
  });
161
161
 
162
+ const originPackageJson = JSON.parse(fs.readFileSync(`./package.json`, 'utf8'));
162
163
  const packageJson = JSON.parse(fs.readFileSync(`${basePath}/package.json`, 'utf8'));
163
164
  packageJson.name = repoName.replace('engine-', '');
164
165
 
@@ -171,16 +172,31 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
171
172
  );
172
173
  delete packageJson.bin.underpost;
173
174
  packageJson.bin.cyberia = 'bin/index.js';
174
- packageJson.keywords = ['cyberia', 'object-layer', 'game-engine', 'assets-management', 'web3'];
175
+ packageJson.keywords = [
176
+ 'cyberia',
177
+ 'object-layer',
178
+ 'game-engine',
179
+ 'assets-management',
180
+ 'web3',
181
+ 'atlas-sprite-sheet',
182
+ ];
175
183
  packageJson.description = 'Cyberia Engine - Object Layer and Assets Management Microservice';
184
+ packageJson.dependencies = originPackageJson.dependencies;
185
+ packageJson.dependencies['maxrects-packer'] = '^2.7.3';
186
+ packageJson.dependencies['pngjs'] = '^7.0.0';
187
+ packageJson.dependencies['jimp'] = '^1.6.0';
188
+ packageJson.dependencies['sharp'] = '^0.32.5';
176
189
  fs.writeFileSync(`${basePath}/bin/index.js`, fs.readFileSync(`./bin/cyberia.js`, 'utf8'), 'utf8');
177
190
  fs.copyFileSync(`./src/api/object-layer/README.md`, `${basePath}/README.md`);
178
191
  fs.copySync(`./hardhat`, `${basePath}/hardhat`);
179
192
  fs.copySync(`./hardhat/white-paper.md`, `${basePath}/white-paper.md`);
180
- fs.copySync(
181
- `./src/client/ssr/pages/CyberiaServerMetrics.js`,
182
- `${basePath}/src/client/ssr/pages/CyberiaServerMetrics.js`,
183
- );
193
+ for (const path of [
194
+ '/src/client/ssr/pages/CyberiaServerMetrics.js',
195
+ '/src/server/object-layer.js',
196
+ '/src/server/atlas-sprite-sheet-generator.js',
197
+ ])
198
+ fs.copySync(`.${path}`, `${basePath}${path}`);
199
+
184
200
  default:
185
201
  break;
186
202
  }
package/bin/deploy.js CHANGED
@@ -462,6 +462,7 @@ try {
462
462
  `./engine-private/conf/${deployId}/build/development/proxy.yaml`,
463
463
  `./manifests/deployment/${deployId}-development/proxy.yaml`,
464
464
  );
465
+ shellExec(`node bin new --dev --default-conf --deploy-id ${deployId}`);
465
466
  }
466
467
  shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
467
468
  shellExec(`node bin new --deploy-id dd-default`);
package/bin/file.js CHANGED
@@ -99,9 +99,10 @@ try {
99
99
  './manifests/deployment/dd-cyberia-development',
100
100
  './manifests/deployment/dd-core-development',
101
101
  './manifests/deployment/dd-template-development',
102
+ './src/server/object-layer.js',
103
+ './src/server/atlas-sprite-sheet-generator.js',
102
104
  'bin/web3.js',
103
105
  'bin/cyberia.js',
104
- 'bin/cyberia0.js',
105
106
  ]) {
106
107
  if (fs.existsSync(deletePath)) fs.removeSync('../pwa-microservices-template/' + deletePath);
107
108
  }
package/bin/util.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import fs from 'fs-extra';
2
- import si from 'systeminformation';
3
2
  import * as dir from 'path';
4
3
 
5
4
  import { loggerFactory } from '../src/server/logger.js';
@@ -19,22 +18,6 @@ try {
19
18
  console.log(fs.readFileSync(process.argv[3], 'utf8'));
20
19
  break;
21
20
 
22
- case 'system-info':
23
- await (async () => {
24
- for (const infoKey of Object.keys(si)) {
25
- if (typeof si[infoKey] === 'function') {
26
- // 'dockerInfo', 'vboxInfo'
27
- if (!['osInfo', 'graphics', 'cpu'].includes(infoKey)) continue;
28
- try {
29
- const infoInstance = await si[infoKey]();
30
- logger.info(infoKey, infoInstance);
31
- } catch (error) {
32
- logger.info('Not valid info function', infoKey);
33
- }
34
- }
35
- }
36
- })();
37
- break;
38
21
  case 'delete-empty-folder':
39
22
  function cleanEmptyFoldersRecursively(folder) {
40
23
  if (!fs.existsSync(folder)) {
package/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v2.97.5
1
+ ## underpost ci/cd cli v2.98.1
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
4
  ```
@@ -802,7 +802,7 @@ Options:
802
802
  Runs specified scripts using various runners.
803
803
 
804
804
  Arguments:
805
- runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, metadata, svc-ls, svc-rm, ssh-cluster-info, dev-hosts-expose, dev-hosts-restore, cluster-build, template-deploy, template-deploy-image, clean, pull, release-deploy, ssh-deploy, ide, sync, stop, ssh-deploy-stop, tz, cron, get-proxy, instance-promote, instance, ls-deployments, host-update, dd-container, ip-info, monitor, db-client, git-conf, promote, metrics, cluster, deploy, disk-clean, disk-usage, dev, service, sh, log, ps, ptls, release-cmt, deploy-test, sync-replica, tf-vae-test, deploy-job.
805
+ runner-id The runner ID to run. Options: dev-cluster, metadata, svc-ls, svc-rm, ssh-cluster-info, dev-hosts-expose, dev-hosts-restore, cluster-build, template-deploy, template-deploy-image, clean, pull, release-deploy, ssh-deploy, ide, sync, stop, ssh-deploy-stop, tz, cron, get-proxy, instance-promote, instance, ls-deployments, host-update, dd-container, ip-info, monitor, db-client, git-conf, promote, metrics, cluster, deploy, disk-clean, disk-usage, dev, service, sh, log, ps, ptls, release-cmt, deploy-test, sync-replica, tf-vae-test, spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, deploy-job.
806
806
  path The input value, identifier, or path for the operation.
807
807
 
808
808
  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.97.5
20
+ image: localhost/rockylinux9-underpost:v2.98.1
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.5
103
+ image: localhost/rockylinux9-underpost:v2.98.1
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.5
21
+ image: localhost/rockylinux9-underpost:v2.98.1
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.5
106
+ image: localhost/rockylinux9-underpost:v2.98.1
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",
5
+ "version": "2.98.1",
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",
@@ -72,6 +72,7 @@
72
72
  "express-fileupload": "^1.4.3",
73
73
  "express-rate-limit": "^8.1.0",
74
74
  "express-slow-down": "^3.0.0",
75
+ "fast-json-stable-stringify": "^2.1.0",
75
76
  "favicons": "^7.2.0",
76
77
  "fs-extra": "^11.1.1",
77
78
  "fullcalendar": "^6.1.15",
@@ -80,7 +81,6 @@
80
81
  "http-proxy-middleware": "^2.0.6",
81
82
  "ignore-walk": "^6.0.4",
82
83
  "iovalkey": "^0.2.1",
83
- "jimp": "^1.6.0",
84
84
  "json-colorizer": "^2.2.2",
85
85
  "jsonwebtoken": "^9.0.2",
86
86
  "mariadb": "^3.2.2",
@@ -95,7 +95,6 @@
95
95
  "prom-client": "^15.1.2",
96
96
  "read": "^2.1.0",
97
97
  "rrule": "^2.8.1",
98
- "sharp": "^0.32.5",
99
98
  "shelljs": "^0.8.5",
100
99
  "sitemap": "^7.1.1",
101
100
  "socket.io": "^4.8.0",
@@ -103,7 +102,6 @@
103
102
  "split-file": "^2.3.0",
104
103
  "swagger-autogen": "^2.23.7",
105
104
  "swagger-ui-express": "^5.0.0",
106
- "systeminformation": "^5.23.7",
107
105
  "uglify-js": "^3.17.4",
108
106
  "validator": "^13.11.0",
109
107
  "vanilla-jsoneditor": "^2.3.2",
@@ -0,0 +1,200 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # rocky-pwa.sh
5
+ # Purpose: Build and install a PWA as a native application on Rocky Linux (RHEL).
6
+ # Usage: sudo ./rocky-pwa.sh <URL> <APP_NAME>
7
+
8
+ if [[ $EUID -ne 0 ]]; then
9
+ echo "ERROR: This script must be run as root." >&2
10
+ exit 1
11
+ fi
12
+
13
+ if [[ $# -lt 2 ]]; then
14
+ echo "Usage: $0 <URL> <APP_NAME>"
15
+ echo "Example: $0 'https://underpost.net' 'Underpost'"
16
+ exit 1
17
+ fi
18
+
19
+ TARGET_URL="$1"
20
+ RAW_NAME="$2"
21
+ # Sanitize name for filesystem (My App -> My_App)
22
+ APP_NAME="${RAW_NAME// /_}"
23
+ DEST_DIR="/opt/$APP_NAME"
24
+
25
+ echo ">>> Starting PWA installation for '$APP_NAME' ($TARGET_URL)"
26
+
27
+ # ------------------------------------------------------------------------------
28
+ # 1. Install Dependencies
29
+ # ------------------------------------------------------------------------------
30
+ echo ">>> Installing system dependencies..."
31
+ # Common Electron/Nativefier requirements
32
+ dnf install -y nodejs desktop-file-utils libXScrnSaver libX11 libXrandr \
33
+ alsa-lib atk at-spi2-core cups-libs wget curl grep \
34
+ || echo "Warning: specific package install failed, proceeding in case they exist..."
35
+
36
+ # ------------------------------------------------------------------------------
37
+ # 2. Install/Update Nativefier
38
+ # ------------------------------------------------------------------------------
39
+ if ! command -v nativefier &> /dev/null; then
40
+ echo ">>> Installing nativefier..."
41
+ npm install -g nativefier || echo "Warning: Global install had issues. Attempting to run via npx..."
42
+ fi
43
+
44
+ # ------------------------------------------------------------------------------
45
+ # 3. Build Application
46
+ # ------------------------------------------------------------------------------
47
+ BUILD_TMP=$(mktemp -d)
48
+ trap 'rm -rf "$BUILD_TMP"' EXIT
49
+
50
+ echo ">>> Building application in temporary directory..."
51
+ cd "$BUILD_TMP"
52
+
53
+ # --single-instance: Only allow one window
54
+ # --internal-urls ".*": Don't open links in external browser (keep user inside app)
55
+ npx --yes nativefier --name "$APP_NAME" \
56
+ --platform linux \
57
+ --arch x64 \
58
+ --single-instance \
59
+ --internal-urls ".*" \
60
+ "$TARGET_URL"
61
+
62
+ # ------------------------------------------------------------------------------
63
+ # 4. Install to /opt
64
+ # ------------------------------------------------------------------------------
65
+ # Nativefier creates a folder named like "Underpost-linux-x64"
66
+ BUILT_FOLDER=$(find . -maxdepth 1 -type d -name "*-linux-x64" | head -n 1)
67
+
68
+ if [[ -z "$BUILT_FOLDER" ]]; then
69
+ echo "ERROR: Build failed. No output directory found."
70
+ exit 1
71
+ fi
72
+
73
+ echo ">>> Installing to $DEST_DIR..."
74
+ rm -rf "$DEST_DIR"
75
+ mv "$BUILT_FOLDER" "$DEST_DIR"
76
+
77
+ # Fix ownership
78
+ chown -R root:root "$DEST_DIR"
79
+ chmod -R 755 "$DEST_DIR"
80
+
81
+ # ------------------------------------------------------------------------------
82
+ # 5. Locate Executable & Fix Nested Structure
83
+ # ------------------------------------------------------------------------------
84
+ # Sometimes Nativefier nests: /opt/App/App-linux-x64/App
85
+ # We want: /opt/App/App
86
+ # Check if the DEST_DIR contains only one folder which is also named *-linux-x64
87
+ NESTED_DIR=$(find "$DEST_DIR" -mindepth 1 -maxdepth 1 -type d -name "*-linux-x64" | head -n 1)
88
+
89
+ if [[ -n "$NESTED_DIR" ]]; then
90
+ echo ">>> Flattening nested directory structure..."
91
+ # Move contents up
92
+ mv "$NESTED_DIR"/* "$DEST_DIR/"
93
+ rmdir "$NESTED_DIR"
94
+ fi
95
+
96
+ # Find the binary
97
+ EXECUTABLE="$DEST_DIR/$APP_NAME"
98
+ if [[ ! -f "$EXECUTABLE" ]]; then
99
+ # Try finding any executable file that isn't a library or helper
100
+ EXECUTABLE=$(find "$DEST_DIR" -maxdepth 2 -type f -executable ! -name "*.so*" ! -name "chrome_sandbox" ! -name "*.sh" | head -n 1)
101
+ fi
102
+
103
+ if [[ -z "$EXECUTABLE" || ! -f "$EXECUTABLE" ]]; then
104
+ echo "ERROR: Could not locate executable file in $DEST_DIR"
105
+ exit 1
106
+ fi
107
+
108
+ echo ">>> Found binary: $EXECUTABLE"
109
+
110
+ # ------------------------------------------------------------------------------
111
+ # 6. System Integration (Symlink, Icon, Desktop File)
112
+ # ------------------------------------------------------------------------------
113
+ BIN_LINK="/usr/local/bin/$APP_NAME"
114
+ echo ">>> Creating symlink at $BIN_LINK..."
115
+ ln -sf "$EXECUTABLE" "$BIN_LINK"
116
+
117
+ # Handle Icon
118
+ ICON_DEST="/usr/share/pixmaps/$APP_NAME.png"
119
+ FOUND_ICON=""
120
+
121
+ # 1. Look in resources
122
+ if [[ -f "$DEST_DIR/resources/app/icon.png" ]]; then
123
+ FOUND_ICON="$DEST_DIR/resources/app/icon.png"
124
+ elif [[ -f "$DEST_DIR/resources/app/icon.ico" ]]; then
125
+ FOUND_ICON="$DEST_DIR/resources/app/icon.ico"
126
+ fi
127
+
128
+ # 2. If not found, try to download from PWA manifest (Simplified)
129
+ if [[ -z "$FOUND_ICON" ]]; then
130
+ echo ">>> Icon not found in build. Attempting to fetch from website..."
131
+ # Simple heuristic: try to grab apple-touch-icon or shortcut icon
132
+ ICON_URL=$(curl -sL "$TARGET_URL" | grep -oP 'rel="(apple-touch-icon|icon|shortcut icon)" href="\K[^"]+' | head -n 1)
133
+
134
+ if [[ -n "$ICON_URL" ]]; then
135
+ # Handle relative URLs
136
+ if [[ "$ICON_URL" != http* ]]; then
137
+ # Remove trailing slash from base if present and leading slash from path
138
+ BASE_URL="${TARGET_URL%/}"
139
+ PATH_URL="${ICON_URL#/}"
140
+ ICON_URL="$BASE_URL/$PATH_URL"
141
+ fi
142
+
143
+ echo ">>> Downloading icon from $ICON_URL..."
144
+ wget -q -O "$BUILD_TMP/downloaded_icon" "$ICON_URL" || true
145
+ if [[ -s "$BUILD_TMP/downloaded_icon" ]]; then
146
+ FOUND_ICON="$BUILD_TMP/downloaded_icon"
147
+ fi
148
+ fi
149
+ fi
150
+
151
+ if [[ -n "$FOUND_ICON" ]]; then
152
+ cp "$FOUND_ICON" "$ICON_DEST"
153
+ chmod 644 "$ICON_DEST"
154
+ echo ">>> Icon installed to $ICON_DEST"
155
+ else
156
+ echo ">>> WARNING: No icon found. Desktop entry will use generic icon."
157
+ fi
158
+
159
+ # Desktop File
160
+ DESKTOP_FILE="/usr/share/applications/$APP_NAME.desktop"
161
+ echo ">>> Creating desktop entry at $DESKTOP_FILE..."
162
+
163
+ cat > "$DESKTOP_FILE" <<EOF
164
+ [Desktop Entry]
165
+ Name=$RAW_NAME
166
+ Exec=$BIN_LINK %U
167
+ Icon=$APP_NAME
168
+ Type=Application
169
+ StartupNotify=true
170
+ Categories=Network;Web;
171
+ Terminal=false
172
+ StartupWMClass=$APP_NAME
173
+ EOF
174
+
175
+ # Update cache
176
+ if command -v update-desktop-database &> /dev/null; then
177
+ update-desktop-database /usr/share/applications || true
178
+ fi
179
+
180
+ # ------------------------------------------------------------------------------
181
+ # 7. Create /bin wrapper with --no-sandbox flag
182
+ # ------------------------------------------------------------------------------
183
+ BIN_WRAPPER="/bin/$APP_NAME"
184
+ echo ">>> Creating wrapper script at $BIN_WRAPPER..."
185
+
186
+ cat > "$BIN_WRAPPER" <<EOF
187
+ #!/usr/bin/env bash
188
+ exec '$DEST_DIR/$APP_NAME' --no-sandbox "\$@"
189
+ EOF
190
+
191
+ chmod 755 "$BIN_WRAPPER"
192
+ echo ">>> Wrapper script created: $BIN_WRAPPER"
193
+
194
+ echo "------------------------------------------------------"
195
+ echo " Installation Complete!"
196
+ echo " App Name: $RAW_NAME"
197
+ echo " Command: $APP_NAME"
198
+ echo " Location: $DEST_DIR"
199
+ echo " Wrapper: $BIN_WRAPPER"
200
+ echo "------------------------------------------------------"
@@ -1,13 +1,11 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
-
5
4
  # Script to install a recommended base package set on Rocky Linux.
6
5
  # Usage examples:
7
- # sudo ./scripts/rocky-setup.sh # interactive (will prompt about Development Tools)
8
- # sudo ./scripts/rocky-setup.sh --install-dev # non-interactive: install Development Tools
6
+ # sudo ./scripts/rocky-setup.sh # install base packages
7
+ # sudo ./scripts/rocky-setup.sh --install-dev # install base packages + Development Tools
9
8
  # INSTALL_DEV=1 sudo ./scripts/rocky-setup.sh # same as --install-dev
10
- # sudo ./scripts/rocky-setup.sh --yes # skip prompts and assume defaults
11
9
 
12
10
  PACKAGES=(
13
11
  dnf-plugins-core
@@ -39,7 +37,6 @@ PACKAGES=(
39
37
 
40
38
  # Defaults
41
39
  INSTALL_DEV=0
42
- ASSUME_YES=0
43
40
 
44
41
  # Parse CLI args (simple)
45
42
  while [[ $# -gt 0 ]]; do
@@ -52,10 +49,6 @@ while [[ $# -gt 0 ]]; do
52
49
  INSTALL_DEV=0
53
50
  shift
54
51
  ;;
55
- --yes|-y|--assume-yes)
56
- ASSUME_YES=1
57
- shift
58
- ;;
59
52
  --help|-h)
60
53
  cat <<EOF
61
54
  Usage: sudo ./scripts/rocky-setup.sh [options]
@@ -63,7 +56,6 @@ Usage: sudo ./scripts/rocky-setup.sh [options]
63
56
  Options:
64
57
  --install-dev, --yes-dev Install Development Tools group (gcc, make, etc.)
65
58
  --no-install-dev Explicitly skip Development Tools
66
- --yes, -y, --assume-yes Assume defaults / non-interactive
67
59
  --help, -h Show this help and exit
68
60
 
69
61
  You can also set the environment variable INSTALL_DEV=1 to enable development tools.
@@ -82,52 +74,34 @@ if [[ "${INSTALL_DEV:-}" =~ ^(1|y|yes|true)$ ]]; then
82
74
  INSTALL_DEV=1
83
75
  fi
84
76
 
85
- # Helper: prompt unless ASSUME_YES
86
- prompt_install_dev() {
87
- if [[ $ASSUME_YES -eq 1 ]]; then
88
- return 1 # means do NOT prompt (we treat ASSUME_YES as 'no' for optional install unless INSTALL_DEV set)
89
- fi
90
-
91
- read -r -p "Do you want to install the 'Development Tools' group (gcc, make, etc.)? [y/N]: " answer
92
- if [[ "${answer,,}" == "y" || "${answer,,}" == "yes" ]]; then
93
- return 0
94
- fi
95
- return 1
96
- }
97
-
98
77
  # Refresh cache and install basic packages
99
78
  echo "[+] Refreshing DNF cache..."
100
- sudo dnf makecache --refresh
79
+ dnf makecache --refresh -y
101
80
 
102
81
  echo "[+] Installing dnf-plugins-core and epel-release (if not present)..."
103
- sudo dnf -y install dnf-plugins-core epel-release
82
+ dnf install dnf-plugins-core epel-release -y
104
83
 
105
84
  echo "[+] Refreshing DNF cache after enabling repositories..."
106
- sudo dnf makecache --refresh
85
+ dnf makecache --refresh -y
107
86
 
108
87
  echo "[+] Installing base packages: ${#PACKAGES[@]} packages"
109
- sudo dnf -y install "${PACKAGES[@]}"
88
+ dnf install "${PACKAGES[@]}" -y
110
89
 
111
90
  # Decide on Development Tools
112
91
  if [[ $INSTALL_DEV -eq 1 ]]; then
113
- echo "[+] Installing Development Tools (requested)..."
114
- sudo dnf -y groupinstall "Development Tools"
92
+ echo "[+] Installing Development Tools..."
93
+ dnf groupinstall "Development Tools" -y
115
94
  else
116
- if prompt_install_dev; then
117
- echo "[+] Installing Development Tools (prompt confirmed)..."
118
- sudo dnf -y groupinstall "Development Tools"
119
- else
120
- echo "[+] Skipping Development Tools. To auto-enable, run with --install-dev or set INSTALL_DEV=1"
121
- fi
95
+ echo "[+] Skipping Development Tools. To enable, run with --install-dev or set INSTALL_DEV=1"
122
96
  fi
123
97
 
124
98
  echo "[+] Updating all packages to latest versions..."
125
- sudo dnf -y update
99
+ dnf update -y --skip-broken --nobest
126
100
 
127
101
  # Cleanup
128
102
  echo "[+] Cleanup: remove unnecessary packages and old metadata"
129
- sudo dnf -y autoremove
130
- sudo dnf clean all
103
+ dnf autoremove -y
104
+ dnf clean all
131
105
 
132
106
  cat <<EOF
133
107
 
@@ -139,7 +113,6 @@ Installation complete.
139
113
  Examples:
140
114
  sudo ./scripts/rocky-setup.sh --install-dev
141
115
  INSTALL_DEV=1 sudo ./scripts/rocky-setup.sh
142
- sudo ./scripts/rocky-setup.sh --yes
143
116
 
144
117
  Customize PACKAGES=(...) inside this script according to your needs (docker, podman, kube, mssql-tools, etc.).
145
118
  EOF
@@ -60,7 +60,7 @@ const DocumentDto = {
60
60
  return {
61
61
  path: 'userId',
62
62
  model: 'User',
63
- select: '_id email username profileImageId role briefDescription',
63
+ select: '_id role username profileImageId briefDescription',
64
64
  populate: {
65
65
  path: 'profileImageId',
66
66
  model: 'File',