electerm
maintainer zxp19821005
· 0 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The npm install runs in the build phase on the project's own source from GitHub, using locked dependencies via package-lock.json; the external registry use (npmmirror.com) is a mirror optimization for users in China and does not introduce untrusted code execution.
Triggered rules
LOW
AI review downgraded a static finding
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The npm install runs in the build phase on the project's own source from GitHub, using locked dependencies via package-lock.json; the external registry use (npmmirror.com) is a mirror optimization for users in China and does not introduce untrusted code execution.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
npm/yarn/pnpm install of an undeclared external package
npm_install_external
Runs `npm/yarn/pnpm install <package>` for a package not in source=(), pulling unpinned, unreviewed code at build time. Severity downgraded: the package declares/looks like a Node.js consumer, where build-time installs are expected.
-
PKGBUILD:90
NODE_ENV=development npm add -D node-gyp --legacy-peer-deps
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2
# Contributor: Zaoqi
3
pkgname=electerm
4
pkgver=3.15.186
5
_electronversion=41
6
_nodeversion=24
7
pkgrel=1
8
pkgdesc="Terminal/ssh/telnet/serialport/sftp client.(Use system-wide electron)"
9
arch=(
10
'aarch64'
11
'armv7h'
12
'x86_64'
13
)
14
url="https://electerm.html5beta.com/"
15
_ghurl="https://github.com/electerm/electerm"
16
license=('MIT')
17
conflicts=("${pkgname}")
18
depends=(
19
"electron${_electronversion}"
20
'python'
21
'nodejs'
22
)
23
makedepends=(
24
'npm'
25
'nvm'
26
'gendesk'
27
'python-setuptools'
28
'curl'
29
'git'
30
'jq'
31
)
32
source=(
33
"${pkgname}-${pkgver}::git+${_ghurl}#tag=v${pkgver}"
34
"${pkgname}.sh"
35
)
36
sha256sums=('c55ea96a4894d84f65863a4802337abe2d601fb5d8dbe426eac4e4d53733ad42'
37
'a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d')
38
_ensure_local_nvm() {
39
local NVM_DIR="${srcdir}/.nvm"
40
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
41
nvm install "${_nodeversion}"
42
nvm use "${_nodeversion}"
43
}
44
_get_app_dir() {
45
find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1
46
}
47
_set_build_env() {
48
export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
49
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
50
export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
51
export HOME="${srcdir}/.electron-gyp"
52
export NPM_CONFIG_CACHE="${srcdir}/.npm_cache"
53
export NPM_CONFIG_MAXSOCKETS=32
54
if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then
55
{
56
export NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
57
export NODEJS_ORG_MIRROR="https://npmmirror.com/mirrors/node"
58
export ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
59
export ELECTRON_BUILDER_BINARIES_MIRROR="https://npmmirror.com/mirrors/electron-builder-binaries/"
60
}
61
find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} +
62
fi
63
}
64
_get_electron_version() {
65
_elec_ver=$(find "${srcdir}" -maxdepth 5 -name "package.json" ! -path "*/node_modules/*" \
66
-exec grep -l '"electron"' {} + | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null | head -1)
67
[[ -z "${_elec_ver}" ]] && return 1
68
echo -e "The electron version is: \033[1;31m${_elec_ver%%.*}\033[0m"
69
}
70
prepare() {
71
cd "${srcdir}/${pkgname}-${pkgver}"
72
_get_electron_version
73
sed -i -e "
74
s/@electronversion@/${_electronversion}/g
75
s/@appname@/${pkgname}/g
76
s/@runname@/app.asar/g
77
s/@cfgdirname@/${pkgname}/g
78
s/@options@/env ELECTRON_OZONE_PLATFORM_HINT=auto/g
79
" "${srcdir}/${pkgname}.sh"
80
gendesk -q -f -n \
81
--pkgname="${pkgname}" \
82
--pkgdesc="${pkgdesc}" \
83
--categories="System" \
84
--name="${pkgname}" \
85
--exec="${pkgname} %U"
86
_set_build_env
87
_ensure_local_nvm
88
sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json
89
NODE_ENV=development npm install --legacy-peer-deps
90
NODE_ENV=development npm add -D node-gyp --legacy-peer-deps
91
}
92
build() {
93
cd "${srcdir}/${pkgname}-${pkgver}"
94
_set_build_env
95
_ensure_local_nvm
96
local _app_dir=$(_get_app_dir)
97
NODE_ENV=production npm run clean
98
NODE_ENV=production npm run compile
99
NODE_ENV=production npm run prepare-file
100
WORKFLOW_NAME=linux-pkgbuild \
101
NODE_ENV=production npm exec -c "electron-builder --linux dir --publish never -c.electronDist=${ELECTRON_DIST} --config build/electron-builder.json"
102
rm -rf "${_app_dir}/resources/app.asar.unpacked/node_modules/@serialport/bindings-cpp/prebuilds/"{android-*,darwin-*,win32-*}
103
rm -rf "${_app_dir}/resources/app.asar.unpacked/node_modules/font-list/libs/"{darwin,win32}
104
case "${CARCH}" in
105
aarch64)
106
rm -rf "${_app_dir}/resources/app.asar.unpacked/node_modules/@serialport/bindings-cpp/prebuilds/"{linux-arm,linux-x64}
107
;;
108
armv7h)
109
rm -rf "${_app_dir}/resources/app.asar.unpacked/node_modules/@serialport/bindings-cpp/prebuilds/"{linux-arm64,linux-x64}
110
;;
111
x86_64)
112
rm -rf "${_app_dir}/resources/app.asar.unpacked/node_modules/@serialport/bindings-cpp/prebuilds/"linux-arm*
113
;;
114
esac
115
}
116
package() {
117
install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
118
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname}"
119
local _app_dir=$(_get_app_dir)
120
cp -a "${_app_dir}/resources/"* "${pkgdir}/usr/lib/${pkgname}/"
121
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/node_modules/@${pkgname}/${pkgname}-resource/build-res/appx/StoreLogo.png" \
122
"${pkgdir}/usr/share/pixmaps/${pkgname}.png"
123
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/${pkgname}.desktop" -t "${pkgdir}/usr/share/applications"
124
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
125
}
126
Changes since previous scan
--- PKGBUILD @ 2026-07-31 00:14+++ PKGBUILD @ 2026-08-03 00:08@@ -1,7 +1,7 @@ # Maintainer: zxp19821005 <zxp19821005 at 163 dot com> # Contributor: Zaoqi pkgname=electerm-pkgver=3.15.171+pkgver=3.15.186 _electronversion=41 _nodeversion=24 pkgrel=1@@ -33,7 +33,7 @@ "${pkgname}-${pkgver}::git+${_ghurl}#tag=v${pkgver}" "${pkgname}.sh" )-sha256sums=('55253ca639d1fe68d422c06971eb212f028e1771f9f9e4ab355d69818abc0d3e'+sha256sums=('c55ea96a4894d84f65863a4802337abe2d601fb5d8dbe426eac4e4d53733ad42' 'a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d') _ensure_local_nvm() { local NVM_DIR="${srcdir}/.nvm"Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 07:17:22 | MEDIUM | 1 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 03:34:02 | MEDIUM | 1 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 15:20:42 | MEDIUM | 1 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 03:15:42 | MEDIUM | 1 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |