alpaca-electron-git
maintainer zxp19821005
· 0 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The npx command is used to run electron-packager on the project's own source code during build, which is a standard and legitimate use; no untrusted remote code is executed.
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-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 90%): The npx command is used to run electron-packager on the project's own source code during build, which is a standard and legitimate use; no untrusted remote code is executed.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
npx/bunx/deno executes a remote package
remote_code_tool
`npx`/`bunx`/`pnpm dlx`/`deno run <url>` downloads AND runs a remote package at build time — the moral equivalent of piping a download into a shell. Severity downgraded: Node.js consumer context.
-
PKGBUILD:83
NODE_ENV=production npx electron-packager . --overwrite --platform=linux --icon=icon/png/128x128.png --prune=true --out=./release
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2
pkgname=alpaca-electron-git
3
_pkgname="Alpaca Electron"
4
pkgver=1.0.6.r3.g04bad63
5
_electronversion=13
6
_nodeversion=16
7
pkgrel=1
8
pkgdesc="The simplest way to run Alpaca (and other LLaMA-based local LLMs) on your own computer.(Use system-wide electron)"
9
arch=(
10
'aarch64'
11
'x86_64'
12
)
13
url="https://github.com/ItsPi3141/alpaca-electron"
14
license=('MIT')
15
provides=("${pkgname%-git}=${pkgver%.r*}")
16
conflicts=("${pkgname%-git}")
17
depends=(
18
"electron${_electronversion}"
19
'python'
20
'nodejs'
21
)
22
makedepends=(
23
'npm'
24
'git'
25
'nvm'
26
'gendesk'
27
'curl'
28
)
29
options=(
30
'!strip'
31
'!emptydirs'
32
)
33
source=(
34
"${pkgname%-git}.git::git+${url}.git"
35
"${pkgname%-git}.sh")
36
sha256sums=('SKIP'
37
'291f50480f5a61bc9c68db7d44cd0412071128706baa868a9cb854f8779a1980')
38
pkgver() {
39
cd "${srcdir}/${pkgname%-git}.git"
40
set -o pipefail
41
git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
42
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
43
}
44
_ensure_local_nvm() {
45
local NVM_DIR="${srcdir}/.nvm"
46
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
47
nvm install "${_nodeversion}"
48
nvm use "${_nodeversion}"
49
}
50
prepare() {
51
cd "${srcdir}/${pkgname%-git}.git"
52
sed -i -e "
53
s/@electronversion@/${_electronversion}/g
54
s/@appname@/${pkgname%-git}/g
55
s/@runname@/app/g
56
s/@cfgdirname@/${_pkgname}/g
57
s/@options@//g
58
" "${srcdir}/${pkgname%-git}.sh"
59
_ensure_local_nvm
60
gendesk -q -f -n --pkgname="${pkgname%-git}" --pkgdesc="${pkgdesc}" --categories="Utility" --name="${_pkgname}" --exec="${pkgname%-git} %U"
61
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
62
export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
63
HOME="${srcdir}/.electron-gyp"
64
{
65
echo -e '\n'
66
#echo 'build_from_source=true'
67
echo "cache=${srcdir}/.npm_cache"
68
echo "maxsockets=10"
69
} >> .npmrc
70
if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then
71
{
72
echo 'registry=https://registry.npmmirror.com'
73
echo 'electron_mirror=https://registry.npmmirror.com/-/binary/electron/'
74
echo 'electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/'
75
} >> .npmrc
76
find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} +
77
fi
78
NODE_ENV=development npm install --leagcy-peer-deps
79
}
80
build() {
81
cd "${srcdir}/${pkgname%-git}.git"
82
NODE_ENV=production npm run rebuild-linux
83
NODE_ENV=production npx electron-packager . --overwrite --platform=linux --icon=icon/png/128x128.png --prune=true --out=./release
84
}
85
package() {
86
install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
87
install -Dm644 "${srcdir}/${pkgname%-git}.git/release/${_pkgname}-linux-"*/swiftshader/* -t "${pkgdir}/usr/lib/${pkgname%-git}/swiftshader"
88
cp -Pr --no-preserve=ownership "${srcdir}/${pkgname%-git}.git/release/${_pkgname}-linux-"*/resources/app "${pkgdir}/usr/lib/${pkgname%-git}"
89
_icon_sizes=(16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 1024x1024)
90
for _icons in "${_icon_sizes[@]}";do
91
install -Dm644 "${srcdir}/${pkgname%-git}.git/icon/png/${_icons}.png" \
92
"${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-git}.png"
93
done
94
install -Dm644 "${srcdir}/${pkgname%-git}.git/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
95
install -Dm644 "${srcdir}/${pkgname%-git}.git/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
96
}
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 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 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 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |
| 2026-07-16 00:05:41 | LOW | 2 |
| 2026-07-15 00:09:25 | LOW | 2 |