9router-webui-plasma-git

maintainer Pakrohk · 0 votes · scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged The package builds from the project's own GitHub source, uses standard build tools (bun), and installs a systemd user service for local execution; the only concerns are SKIP'd checksum and low AUR votes, but no malicious or unverifiable remote code execution is present.

Triggered rules

LOW Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

LOW AI review llm_review

An AI model (qwen/qwen3-235b-a22b-2507) reviewed this and agrees it is LOW (confidence 95%): The package builds from the project's own GitHub source, uses standard build tools (bun), and installs a systemd user service for local execution; the only concerns are SKIP'd checksum and low AUR votes, but no malicious or unverifiable remote code execution is present.

PKGBUILD

1# Maintainer: pakrohk <pakrohk@gmail.com>
2pkgname=9router-webui-plasma-git
3pkgver=0.0.0
4pkgrel=2
5pkgdesc="9Router - AI model router with WebUI. Built with Bun, optimized for KDE Plasma desktop (systemd user service)"
6arch=('x86_64' 'aarch64')
7url="https://github.com/decolua/9router"
8license=('MIT')
9depends=('bun' 'curl' 'rsync' 'libnotify' 'systemd')
10makedepends=('git' 'python' 'make' 'gcc')
11source=("$pkgname::git+https://github.com/decolua/9router.git")
12sha256sums=('SKIP')
13options=('!strip')
14
15# ==================== VERSIONING (AUR STANDARD) ====================
16pkgver() {
17 cd "$srcdir/$pkgname"
18 # Generate version from git tags: v0.1.0 -> 0.1.0.r12.g78a26cc
19 git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
20}
21# ==================================================================
22
23build() {
24 cd "$srcdir/$pkgname"
25 bun install
26 bun run build
27}
28
29package() {
30 cd "$srcdir/$pkgname"
31
32 # 1. Install built files to /usr/lib/9router
33 install -dm755 "$pkgdir/usr/lib/9router"
34 cp -r . "$pkgdir/usr/lib/9router/"
35
36 # 2. Remove unnecessary files
37 rm -rf "$pkgdir/usr/lib/9router/"{.git,.env.example,*.log}
38
39 # 3. Install production dependencies with Bun
40 cd "$pkgdir/usr/lib/9router"
41 bun install --production
42
43 # 4. Main launcher script (systemd user service + Plasma integration)
44 install -Dm755 /dev/stdin "$pkgdir/usr/bin/9router" <<'EOF'
45#!/bin/bash
46# 9Router Launcher - Built with Bun, Optimized for Plasma Desktop
47
48PORT=${PORT:-20128}
49APP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/9router-app"
50CONFIG_FILE="$APP_DIR/.env"
51SERVICE_NAME="9router.service"
52USER_SERVICE_DIR="$HOME/.config/systemd/user"
53
54# Ensure app directory exists
55if [ ! -d "$APP_DIR" ]; then
56 echo "📦 First run: Setting up 9Router in $APP_DIR ..."
57 mkdir -p "$APP_DIR"
58 rsync -a --exclude='node_modules' --exclude='.next' /usr/lib/9router/ "$APP_DIR/"
59 cd "$APP_DIR"
60 bun install --production
61 cat > "$APP_DIR/.env" <<EOL
62PORT=$PORT
63NODE_ENV=production
64DATA_DIR=$APP_DIR/data
65NEXT_PUBLIC_BASE_URL=http://localhost:$PORT
66EOL
67fi
68
69mkdir -p "$APP_DIR/data"
70
71if [ -f "$CONFIG_FILE" ]; then
72 set -a
73 source "$CONFIG_FILE"
74 set +a
75fi
76
77install_service() {
78 mkdir -p "$USER_SERVICE_DIR"
79 cat > "$USER_SERVICE_DIR/$SERVICE_NAME" <<EOL
80[Unit]
81Description=9Router - AI Model Router (WebUI)
82After=network.target
83
84[Service]
85Type=simple
86WorkingDirectory=$APP_DIR
87Environment="NODE_ENV=production"
88Environment="PORT=$PORT"
89Environment="DATA_DIR=$APP_DIR/data"
90Environment="NEXT_PUBLIC_BASE_URL=http://localhost:$PORT"
91ExecStart=/usr/bin/bun run start
92ExecStop=/usr/bin/pkill -f "bun.*$APP_DIR"
93Restart=on-failure
94RestartSec=10
95
96[Install]
97WantedBy=default.target
98EOL
99 systemctl --user daemon-reload
100 echo "✅ Systemd user service installed: $SERVICE_NAME"
101}
102
103case "$1" in
104 start)
105 systemctl --user start "$SERVICE_NAME"
106 notify-send -i network-server "9Router" "Server started on port $PORT"
107 sleep 2
108 xdg-open "http://localhost:$PORT/dashboard"
109 ;;
110 stop)
111 systemctl --user stop "$SERVICE_NAME"
112 notify-send -i network-server "9Router" "Server stopped"
113 ;;
114 restart)
115 systemctl --user restart "$SERVICE_NAME"
116 notify-send -i network-server "9Router" "Server restarted"
117 ;;
118 status)
119 systemctl --user status "$SERVICE_NAME"
120 ;;
121 logs)
122 journalctl --user -u "$SERVICE_NAME" -f
123 ;;
124 install)
125 install_service
126 systemctl --user enable "$SERVICE_NAME"
127 echo "🔧 Service enabled to start at login"
128 ;;
129 *)
130 if ! systemctl --user is-active --quiet "$SERVICE_NAME"; then
131 echo "🚀 Starting 9Router service..."
132 install_service
133 systemctl --user start "$SERVICE_NAME"
134 sleep 2
135 notify-send -i network-server "9Router" "Server is now running on port $PORT"
136 fi
137 xdg-open "http://localhost:$PORT/dashboard"
138 ;;
139esac
140EOF
141
142 # 5. Plasma desktop entry
143 install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/9router.desktop" <<EOF
144[Desktop Entry]
145Name=9Router
146Comment=AI Model Router & Token Saver (Built with Bun)
147Exec=/usr/bin/9router start
148Icon=network-server
149Terminal=false
150Type=Application
151Categories=Development;Network;
152StartupNotify=true
153StartupWMClass=9router
154Actions=OpenDashboard;StopServer;ViewLogs
155
156[Desktop Action OpenDashboard]
157Name=Open Dashboard
158Exec=/usr/bin/9router start
159Icon=network-server
160
161[Desktop Action StopServer]
162Name=Stop Server
163Exec=/usr/bin/9router stop
164Icon=process-stop
165
166[Desktop Action ViewLogs]
167Name=View Logs
168Exec=konsole -e /usr/bin/9router logs
169Icon=utilities-log
170EOF
171
172 # 6. KRunner shortcut
173 install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/9router-krunner.desktop" <<EOF
174[Desktop Entry]
175Name=9Router Dashboard
176Comment=Open 9Router WebUI directly
177Exec=xdg-open http://localhost:20128/dashboard
178Icon=network-server
179Terminal=false
180Type=Application
181Categories=Development;
182OnlyShowIn=KDE;
183EOF
184
185 # 7. Bash completion
186 install -Dm644 /dev/stdin "$pkgdir/usr/share/bash-completion/completions/9router" <<'EOF'
187_9router() {
188 local cmds="start stop restart status logs install"
189 COMPREPLY=($(compgen -W "$cmds" -- "${COMP_WORDS[1]}"))
190}
191complete -F _9router 9router
192EOF
193}
194

Scan history

Scanned at (UTC)SeverityRules
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 15:35:03 LOW 2

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion