Commit 7b0ee69
committed
luci-app-adblock-fast: update to 1.2.2-r6
Update luci-app-adblock-fast from 1.2.1-r3 to 1.2.2-r6.
This rewrites the rpcd backend from a 519-line shell
script to a 452-line native ucode module, adds two new
RPC methods for cron management, reorganizes the web UI
with a dedicated scheduling tab and a collapsible service
details section, moves schedule persistence from UCI to
crontab, and adds the AGPL-3.0-or-later LICENSE file.
Signed-off-by: Stan Grishin <stangri@melmac.ca>
---
- **8 files changed**, +1,765 / -851 lines (net +914)
- **1 commit**: `a18c61a` —
`luci-app-adblock-fast: update to 1.2.2-r6`
---
- `+rpcd-mod-ucode` — Native ucode rpcd module loader
- `+jsonfilter` — No longer needed; ucode handles
JSON natively
- Version bumped from `1.2.1-r3` to `1.2.2-r6`
- URL updated from `github.com/stangri/...` to
`github.com/mossdef-org/...`
---
The rpcd script moves from:
```
/usr/libexec/rpcd/luci.adblock-fast (519 lines, shell)
```
to:
```
/usr/share/rpcd/ucode/luci.adblock-fast (452 lines, ucode)
```
| Aspect | Old (Shell) | New (ucode) |
|-----------------|-------------------------|--------------------|
| Language | POSIX `/bin/sh` | ucode bytecode |
| JSON handling | `json_init/add/dump` | Native objects |
| UCI access | `config_load/get` subpr | `cursor()` API |
| ubus access | `jsonfilter` pipelines | `connect()` API |
| Business logic | Duplicated in script | Imports shared lib |
| Method decl | `case` switch block | Declarative schema |
| Performance | Fork/exec per operation | In-process calls |
The new script imports the shared business logic module
directly:
```javascript
import adb from '/lib/adblock-fast/adblock-fast.uc';
```
Query methods (`getInitStatus`, `getPlatformSupport`,
`getFileUrlFilesizes`, etc.) now delegate to the shared
`adb` library rather than re-implementing the logic.
**Retained (7 methods, same interface):**
| Method | Type | Purpose |
|-----------------------|--------|--------------------|
| `getFileUrlFilesizes` | Query | URL sizes from cfg |
| `getInitList` | Query | Enabled/running |
| `getInitStatus` | Query | Full service state |
| `getPlatformSupport` | Query | Resolver/tool info |
| `setInitAction` | Action | Start/stop/enable |
| `getCronStatus` | Query | Cron diagnostics |
| `syncCron` | Action | Update cron sched |
**Added (2 new methods):**
| Method | Type | Purpose |
|----------------|--------|----------------------|
| `getCronEntry` | Query | Get raw cron line |
| `setCronEntry` | Action | Set/replace cron line|
The cron subsystem now tracks three entry states:
- **`active`** — Enabled and scheduled
- **`suspended`** — Disabled but recoverable
- **`disabled`** — Fully off
`getCronStatus` returns new diagnostic fields:
- `cron_line_multi` — Multiple entries detected
- `cron_line_parse_ok` — Expression validity
- `cron_line_state` — One of: `active`,
`suspended`, `disabled`, `multi`,
`unsupported`, `missing`
- `entry` — Raw matched cron line
Bumped from **11** to **13**, reflecting the new
methods and enhanced `getCronStatus` response shape.
Two new methods added to the rpcd ACL file
(`luci-app-adblock-fast.json`):
- `getCronEntry` (read section)
- `setCronEntry` (write section)
---
**LuciCompat** bumped from `11` to `13`.
**Data fetching refactored:**
- Removed separate `getServiceInfo()` ubus call
- `initStatus` response now provides all data
(package compat, errors, warnings) in one call
- `ubus` object built from `initData` properties
instead of separate service instance query
**New "Service Details" section:**
- Blocking stats, DNS backend info, compressed
cache status, force-DNS ports, and donation
link moved from inline status text to a
separate collapsible `detailsDiv`
- Main status area now shows only the essential
state label and cache info when stopped
**Cron warning logic rewritten:**
- Warnings only displayed when service is both
enabled and running
- New `warningCronEntryMismatch` warning for
suspended or unparseable cron entries
- Suggests "Resync Cron" action when
`cronSyncNeeded` is detected
- Pre-existing checks for missing/disabled cron
daemon preserved but now gated behind
`showCronWarnings` flag
**Cron sync flow rewritten:**
1. Fetches current entry via `getCronEntry()`
2. Strips comment markers and suspended/disabled
tags from the entry
3. Writes cleaned entry via `setCronEntry()`
4. Reloads page only on success
**New exports:** `getCronEntry`, `setCronEntry`
**New helper: `parseCronEntry(cronEntry)`**
- Parses raw cron line into form field values
- Detects schedule mode from cron pattern:
- `every_n_hours` — `*/N * * * *`
- `every_n_days` — `M H */N * *`
- `monthly` — `M H D * *`
- `weekly` — `M H * * D`
- `daily` — `M H * * *` (default)
- Returns config object with: `auto_update_enabled`,
`auto_update_mode`, `auto_update_hour`,
`auto_update_minute`, `auto_update_weekday`,
`auto_update_monthday`, `auto_update_every_ndays`,
`auto_update_every_nhours`
- Falls back to defaults for unparseable entries
**New helper: `generateCronEntry(config)`**
- Inverse of `parseCronEntry`
- Converts form config object back to cron syntax
- Returns empty string when auto-update disabled
- Output format:
`M H DOM * DOW /etc/init.d/adblock-fast dl`
`# adblock-fast-auto`
**Data loading consolidated:**
- Removed separate `getFileUrlFilesizes()` and
`getPlatformSupport()` calls
- Now fetches `getInitStatus()` + `getCronStatus()`
- Sizes and platform data extracted from the
unified `initStatus` response
**New "List Updates Schedule" tab:**
- All scheduling options moved from `tab_advanced`
to dedicated `tab_schedule`
- Options: `auto_update_enabled`,
`auto_update_mode`, `auto_update_every_ndays`,
`auto_update_every_nhours`, `auto_update_weekday`,
`auto_update_monthday`, `auto_update_hour`,
`auto_update_minute`
- Each option's `cfgvalue()` overridden to read
from parsed cron config instead of UCI
- `config_update_enabled` remains on `tab_advanced`
**Schedule persistence moved to crontab:**
- Old: scheduling fields saved to UCI config, then
`syncCron` called after `uci-applied` event to
generate cron entry from config
- New: `handleSave()` collects form values, calls
`generateCronEntry()`, writes directly via
`setCronEntry()`, then removes scheduling fields
from UCI before saving remaining config
- Result: schedule lives in crontab, survives
config resets
**`handleSaveApply` simplified:**
- Old: chained `handleSave` → listener for
`uci-applied` → `syncCron` → page reload
- New: `handleSave()` → `ui.changes.apply()`
- Cron already updated during save, no separate
sync step needed
**Instance handling fix:**
- `dnsmasq_instance` and `smartdns_instance` write
overrides now wrap values in arrays
- Ensures instances stored as UCI lists, not
scalar strings
---
**2 new strings added:**
- `"List Updates Schedule"` — New tab header
- `"Service Details"` — New status section header
**0 strings removed, 0 strings reworded.**
All other changes are source line number updates
from the JavaScript refactoring. Existing
translations remain valid; translators only need
to handle the 2 new entries.
---
Adds the full AGPL-3.0-or-later license text
(661 lines), matching the `PKG_LICENSE` field
already declared in the Makefile.
---
- `rpcdCompat` bumped from `11` to `13`
- `LuciCompat` bumped from `11` to `13`
- Requires `rpcd-mod-ucode` (replaces `jsonfilter`)
- Requires companion `adblock-fast` package >=1.2.2
(for the shared `/lib/adblock-fast/adblock-fast.uc`
library imported by the rpcd ucode module)
- All existing RPC methods preserved; 2 new ones
added
- All existing UI functionality preserved;
scheduling options reorganized into dedicated tab
Signed-off-by: Stan Grishin <stangri@melmac.ca>1 parent 8da730b commit 7b0ee69
File tree
9 files changed
+1838
-931
lines changed- applications/luci-app-adblock-fast
- htdocs/luci-static/resources
- adblock-fast
- view
- adblock-fast
- status/include
- po/templates
- root/usr
- libexec/rpcd
9 files changed
+1838
-931
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 172 additions & 86 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
202 | 215 | | |
203 | 216 | | |
204 | 217 | | |
| |||
302 | 315 | | |
303 | 316 | | |
304 | 317 | | |
305 | | - | |
306 | 318 | | |
307 | | - | |
| 319 | + | |
| 320 | + | |
308 | 321 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
334 | 350 | | |
335 | 351 | | |
336 | 352 | | |
| |||
340 | 356 | | |
341 | 357 | | |
342 | 358 | | |
| 359 | + | |
343 | 360 | | |
344 | 361 | | |
345 | 362 | | |
| |||
364 | 381 | | |
365 | 382 | | |
366 | 383 | | |
367 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
368 | 390 | | |
369 | 391 | | |
370 | 392 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
383 | 421 | | |
384 | 422 | | |
385 | 423 | | |
| |||
410 | 448 | | |
411 | 449 | | |
412 | 450 | | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | 451 | | |
439 | 452 | | |
440 | 453 | | |
| |||
446 | 459 | | |
447 | 460 | | |
448 | 461 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | 462 | | |
455 | 463 | | |
456 | 464 | | |
| |||
465 | 473 | | |
466 | 474 | | |
467 | 475 | | |
468 | | - | |
| 476 | + | |
469 | 477 | | |
470 | 478 | | |
471 | 479 | | |
472 | 480 | | |
473 | 481 | | |
474 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
475 | 539 | | |
476 | 540 | | |
477 | 541 | | |
478 | 542 | | |
479 | 543 | | |
480 | 544 | | |
481 | 545 | | |
482 | | - | |
| 546 | + | |
483 | 547 | | |
484 | 548 | | |
485 | 549 | | |
| |||
509 | 573 | | |
510 | 574 | | |
511 | 575 | | |
512 | | - | |
| 576 | + | |
513 | 577 | | |
514 | 578 | | |
515 | 579 | | |
| |||
586 | 650 | | |
587 | 651 | | |
588 | 652 | | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
599 | 664 | | |
600 | | - | |
601 | | - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
602 | 685 | | |
603 | 686 | | |
604 | 687 | | |
| |||
749 | 832 | | |
750 | 833 | | |
751 | 834 | | |
| 835 | + | |
752 | 836 | | |
753 | 837 | | |
754 | 838 | | |
| |||
773 | 857 | | |
774 | 858 | | |
775 | 859 | | |
| 860 | + | |
| 861 | + | |
776 | 862 | | |
777 | 863 | | |
778 | 864 | | |
0 commit comments