@underpostnet/underpost 2.97.0 → 2.97.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.
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.0)](https://socket.dev/npm/package/underpost/overview/2.97.0) [![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.97.1)](https://socket.dev/npm/package/underpost/overview/2.97.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.0
69
+ ## underpost ci/cd cli v2.97.1
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}') || true`);
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.0
1
+ ## underpost ci/cd cli v2.97.1
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> Crete deploy ID conf env files
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
@@ -940,11 +940,14 @@ Options:
940
940
  --nfs-build Builds an NFS root filesystem for a workflow id config architecture using QEMU emulation.
941
941
  --nfs-mount Mounts the NFS root filesystem for a workflow id config architecture.
942
942
  --nfs-unmount Unmounts the NFS root filesystem for a workflow id config architecture.
943
+ --nfs-build-server Builds the NFS server for a workflow id config architecture.
943
944
  --nfs-sh Copies QEMU emulation root entrypoint shell command to the clipboard.
944
945
  --cloud-init Sets the kernel parameters and sets the necessary seed users on the HTTP server.
945
946
  --cloud-init-update Updates cloud init for a workflow id config architecture.
946
947
  --ubuntu-tools-build Builds ubuntu tools for chroot environment.
947
948
  --ubuntu-tools-test Tests ubuntu tools in chroot environment.
949
+ --rocky-tools-build Builds rocky linux tools for chroot environment.
950
+ --rocky-tools-test Tests rocky linux tools in chroot environment.
948
951
  --bootcmd <bootcmd-list> Comma-separated list of boot commands to execute.
949
952
  --runcmd <runcmd-list> Comma-separated list of run commands to execute.
950
953
  --logs <log-id> Displays logs for log id: dhcp, cloud, machine, cloud-config.
package/conf.js CHANGED
@@ -65,6 +65,7 @@ const DefaultConf = /**/ {
65
65
  '500',
66
66
  'Pagination',
67
67
  'windowGetDimensions',
68
+ 'SearchBox',
68
69
  ],
69
70
  default: [
70
71
  'MenuDefault',
@@ -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.0
20
+ image: localhost/rockylinux9-underpost:v2.97.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.0
103
+ image: localhost/rockylinux9-underpost:v2.97.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.0
21
+ image: localhost/rockylinux9-underpost:v2.97.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.0
106
+ image: localhost/rockylinux9-underpost:v2.97.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.0",
5
+ "version": "2.97.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",
@@ -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}" || true
28
+ umount "${MOUNT_POINT}"
29
29
  fi
30
30
  if [ -n "${NBD_DEV}" ] && [ -b "${NBD_DEV}" ]; then
31
- qemu-nbd -d "${NBD_DEV}" || true
31
+ qemu-nbd -d "${NBD_DEV}"
32
32
  fi
33
33
  if [ -d "${MOUNT_POINT}" ]; then
34
- rmdir "${MOUNT_POINT}" || true
34
+ rmdir "${MOUNT_POINT}"
35
35
  fi
36
36
  }
37
37
 
@@ -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 || true
40
- dnf -y autoremove || true
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" || true
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 -- || true
56
- find /var/tmp -mindepth 1 -mtime +"$TMP_AGE_DAYS" -print0 2>/dev/null | xargs -0r rm -rf -- || true
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 -- || true
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 || true
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 || true
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 || true
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 || true
88
- docker system prune -a --volumes -f || true
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 || true
94
- podman system prune -a -f || true
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 || true
101
- flatpak repair || true
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 || true
108
+ pip3 cache purge
109
109
  elif command -v pip >/dev/null 2>&1; then
110
- pip cache purge || true
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 || true
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 || true)
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 || true
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 || true
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" || true
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}' || true
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:"
@@ -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' || true
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 || true
19
+ sudo grep -E "(EE|WW|NVIDIA|nouveau|amdgpu)" /var/log/Xorg.0.log
@@ -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 || true
80
+ dig -x "$IP" +short
81
81
 
82
82
  echo "
83
83
  -- WHOIS --"
84
- whois "$IP" | sed -n '1,80p' || true
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 || true
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 || true
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 || true
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 || true
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" || true
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" || true
110
- dig +short AAAA "$TARGET" || true
111
- dig +short MX "$TARGET" || true
112
- dig +short TXT "$TARGET" || true
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}" || true)
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 || true
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
@@ -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 || true
43
- dnf config-manager --set-enabled crb >/dev/null 2>&1 || true
44
- dnf config-manager --set-enabled powertools >/dev/null 2>&1 || true
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 || true
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 || true
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 || true
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' || true
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 || true
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 || true
196
- python3 -m pip install tomli meson || true
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 || true
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" || true
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 || true
245
+ systemctl status libvirtd --no-pager
246
246
 
247
247
  cat <<'EOF'
248
248
 
@@ -126,8 +126,8 @@ sudo dnf -y update
126
126
 
127
127
  # Cleanup
128
128
  echo "[+] Cleanup: remove unnecessary packages and old metadata"
129
- sudo dnf -y autoremove || true
130
- sudo dnf clean all || true
129
+ sudo dnf -y autoremove
130
+ sudo dnf clean all
131
131
 
132
132
  cat <<EOF
133
133
 
@@ -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 || true
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 || true
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 || true
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 || true
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 || true
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/' || true)
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/' || true)
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 || true)"; then
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/ || true
139
- sudo update-ca-trust extract || true
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" || true
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
@@ -11,6 +11,7 @@ const DocumentSchema = new Schema(
11
11
  location: { type: String },
12
12
  title: { type: String },
13
13
  tags: [{ type: String }],
14
+ isPublic: { type: Boolean, default: false },
14
15
  fileId: {
15
16
  type: Schema.Types.ObjectId,
16
17
  ref: 'File',
@@ -59,7 +60,12 @@ const DocumentDto = {
59
60
  return {
60
61
  path: 'userId',
61
62
  model: 'User',
62
- select: '_id email username',
63
+ select: '_id email username profileImageId',
64
+ populate: {
65
+ path: 'profileImageId',
66
+ model: 'File',
67
+ select: '_id name mimetype',
68
+ },
63
69
  };
64
70
  },
65
71
  },
@@ -67,6 +73,29 @@ const DocumentDto = {
67
73
  if (!document.share || !document.share.copyShareLinkEvent) return 0;
68
74
  return document.share.copyShareLinkEvent.reduce((total, event) => total + (event.count || 0), 0);
69
75
  },
76
+ /**
77
+ * Filter 'public' tag from tags array
78
+ * The 'public' tag is internal and should not be rendered to users
79
+ * @param {string[]} tags - Array of tags
80
+ * @returns {string[]} - Filtered tags without 'public'
81
+ */
82
+ filterPublicTag: (tags) => {
83
+ if (!tags || !Array.isArray(tags)) return [];
84
+ return tags.filter((tag) => tag !== 'public');
85
+ },
86
+ /**
87
+ * Extract isPublic boolean from tags array and return cleaned tags
88
+ * @param {string[]} tags - Array of tags potentially containing 'public'
89
+ * @returns {{ isPublic: boolean, tags: string[] }} - Object with isPublic flag and cleaned tags
90
+ */
91
+ extractPublicFromTags: (tags) => {
92
+ if (!tags || !Array.isArray(tags)) {
93
+ return { isPublic: false, tags: [] };
94
+ }
95
+ const hasPublicTag = tags.includes('public');
96
+ const cleanedTags = tags.filter((tag) => tag !== 'public');
97
+ return { isPublic: hasPublicTag, tags: cleanedTags };
98
+ },
70
99
  };
71
100
 
72
101
  export { DocumentSchema, DocumentModel, ProviderSchema, DocumentDto };
@@ -9,6 +9,7 @@ const DocumentRouter = (options) => {
9
9
  const authMiddleware = options.authMiddleware;
10
10
  router.post(`/:id`, authMiddleware, async (req, res) => await DocumentController.post(req, res, options));
11
11
  router.post(`/`, authMiddleware, async (req, res) => await DocumentController.post(req, res, options));
12
+ router.get(`/public/high`, async (req, res) => await DocumentController.get(req, res, options));
12
13
  router.get(`/public`, async (req, res) => await DocumentController.get(req, res, options));
13
14
  router.get(`/:id`, authMiddleware, async (req, res) => await DocumentController.get(req, res, options));
14
15
  router.get(`/`, authMiddleware, async (req, res) => await DocumentController.get(req, res, options));