Commit Graph

189 Commits

Author SHA1 Message Date
Paul Donald 37aa2807ea luci-mod-system: extend dropbear listen options
dropbear.init behaviours:

Interface: For each interface, collect all its IPs,
up to 10 endpoints total, and add `-p <addr:port>` for
each; if no interface was given, fall back to a plain
`-p <port>` (listen on all interfaces and IPs). It binds
to addresses, not the device. It collects all IPv4, and
all IPv6 - ULA, but not LL - and binds to those. Ex:

dropbear ... -p 192.168.1.1:22 -p 192.168.1.2:22 -p 192.168.1.3:22 ...

DirectInterface: A single logical interface name; the
first one is used (if multiple are given via `list`).
Runs dropbear with `-l <device> -p <port>`, i.e., it binds
directly to the layer 2 network device rather than
specific IPs. Ex:

dropbear ... -l br-lan -p 22 ...

Closes openwrt/packages#25555
Closes #7484

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-12-31 15:28:27 +01:00
Andy Chiang fdac3c0100 luci-mod-system: add translation string for language
add translation string for language

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2025-11-20 13:03:52 +01:00
Paul Donald 1299531242 luci-mod-system: file naming improvement for repo key management
When downloading a key, try to get the filename of the key. opkg expects it to
match the key fingerprint when verifying .sig files. apk not so.

Try to save the public key file with the name from the provided URL, so it is
not named "key_blah" which won't match its fingerprint.

The alternative would be to call usign with the public key file as input, and
then rename it to its fingerprint. This is only necessary for opkg which is on
the way out.

If the public key file at the remote resource is not named according to its
fingerprint, that's on the repo owner.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-11-02 18:34:30 +01:00
Paul Donald bd5650565a luci-mod-system: give repokeys the ability to fetch keys from a remote URL
Simply paste in an http(s) URL e.g.

https://example.com/releases/SNAPSHOT/publickey.pub

and press Add Key.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-25 22:46:20 +02:00
Andy Chiang f83fe35dae modules: fix default values
fix default values for luci-base and luci-mod-{dashboard,status,system}

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2025-10-21 16:12:03 +02:00
Paul Donald 523b3ea372 luci-mod-*: initialize default values
follow-up to
e67465da5e
b0004ad39c
71ea35fc7f

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-20 21:10:54 +02:00
Andy Chiang b0004ad39c luci-mod-system: use localized time
use localized time

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2025-10-20 20:40:46 +02:00
Andy Chiang b47c94cabb luci-mod-system: fix JSMIN Error
jsmin cannot handle regular expressions in this format, so use RegExp() instead.

fixes: #8020

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2025-10-20 12:46:02 +02:00
Paul Donald 850867b6e4 luci-mod-system: minor code fixes for repokeys and sshkeys
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-13 14:34:47 +02:00
Paul Donald 65bdfc61db luci-mod-system: repo key management
Reject PEM in OPKG; reject non-PEM in APK

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-06-08 20:55:11 +02:00
Paul Donald cf1e61f10d luci-mod-system: Add repo key management
follow-up fix to acdffc3d1d

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-06-07 16:05:56 +02:00
Paul Donald acdffc3d1d luci-mod-system: Add repo key management
Simplifies adding third-party repos. Functions on both 24.10 (opkg) and
main (apk). Based loosely on sshkey management.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-05-31 12:12:06 +02:00
Aleksander Jan Bajkowski 3e45fc644f luci-mod-system: add speed and duplex triggers
Many devices have LEDs to signal a specific link speed.
They are incorrectly displayed in LUCI when they are defined.
This commit adds the missing speed and duplex triggers.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2025-02-25 15:42:07 -06:00
Paul Donald e845441baf luci-base: i18n string context
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-01-31 23:28:12 +01:00
Hannu Nyman ef167782ff luci-mod-system: Add 'disabled' as cron log level
Add "Disabled" with value 9 as a choice for cron log level.

9 actually exceeds the highest built-in value 8, but can be
used to quieten the logging in cases where there are e.g. cron
jobs running each minute, which would create log spam.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2024-12-01 15:37:48 +02:00
Hannu Nyman 1e7ce8de99 luci-mod-system: Fix cron log level settings
Busybox crond only uses level 5, 7 and 8. (And 7 and 8 only differ
on one error regarding finding a crontab without user.)
For simplicity, just provide 5 and 7 as alternatives in LuCI.

Show level 7 as the default and as the first offered choice.

Add missing semicolons to the file.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2024-12-01 12:57:20 +02:00
Paul Donald d3ba74ed9b luci-mod-system: add 'reload' button to software start page
Often restart is not what is necessary, and can trigger longer outages.

Reload is often sufficient, especially for things like rpcd.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2024-10-28 14:22:37 +01:00
Paul Donald 37ea60da58 Revert "luci-mod-system: Dropbear: remove custom flag values"
This reverts commit 43f60c3fad.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2024-06-13 15:11:04 +02:00
Sergey Ponomarev 43f60c3fad luci-mod-system: Dropbear: remove custom flag values
Instead of saving 'on' or 'off' for flag values, use the default 1 and 0.
This makes code simpler.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-06-06 00:09:03 +02:00
Josh Correia 9068e947b0 luci-mod-system: Improve SSH-Keys page grammar, update po/pot files
Signed-off-by: Josh Correia <joshmcorreia@gmail.com>
2024-06-04 14:36:19 +02:00
Josh Correia 0add361502 luci-mod-system: Fix startup UI typo, update po/pot files
Signed-off-by: Josh Correia <joshmcorreia@gmail.com>
2024-06-03 22:48:22 -07:00
Christian Svensson fbd98a3da6 luci-mod-system: Fix broken JSON in ACL
Fixes #7126.

Signed-off-by: Christian Svensson <blue@cmd.nu>
2024-05-18 22:06:14 +02:00
Kristian Skramstad c4eaea70c7 luci-mod-system: flash.js: fix mtdname on download
The previous change did not work as intended for
partitions with _ in the name. I.e "0:qsee_1".
It would output an error "Invalid characters in filename".

So fix this by matching and replacing any
character except for a-z and 0-9 with "-".

Example "0:qsee_1" = I.e "0-qsee-1".

Signed-off-by: Kristian Skramstad <kristian+github@83.no>
2024-05-16 00:15:45 +02:00
Kristian Skramstad 08b8b1d0e3 luci-mod-system: flash.js: add mtdblock name to filename
When you download a partition, the name is hostname+mtdX.bin
and that can be confusing if you go back and try to remember
what mtdX was if you have 10+ partitions.

So let us add the partition name to the filename like:
hostname.mtdX.boot.bin
hostname.mtdX.firmware.bin

Note: If there is a better, easier and simpler way to do the
same thing, please let me know.

Signed-off-by: Kristian Skramstad <kristian+github@83.no>
2024-05-14 14:37:51 +02:00
Florian Eckert 8c8b80c572 luci-mod-system: add support for switching the ssh service on and off.
Add support for switching the ssh service on and off via LuCI.
This is already possible in the uci section of dropbear.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-05-06 13:38:12 +02:00
Florian Eckert 29678071f3 luci-base: move and rename ucitrack system.json
Move the json file to where it belongs.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-11 16:15:52 +02:00
Florian Eckert e3c6eb2e44 luci-base: move and rename ucitrack dropbear.json
Move the json file to where it belongs.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-11 16:15:52 +02:00
Florian Eckert c15b0bf513 luci-base: move and rename ucitrack fstab.json
Move the json file to where it belongs.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-11 16:15:52 +02:00
Paul Donald e5f8af1753 luci-mod-system: describe NTP server candidates
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2024-04-02 01:31:01 +02:00
Jo-Philipp Wich b8a045c67a luci-mod-system: remove bogus mount option
Drop the bogus `enabled_fsck` option which seems to be an automatic Lua->JS
conversion artifact.

Fixes: #6837
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2024-02-21 22:11:53 +01:00
Christian Marangi cbfa9ca8d6 luci-mod-system: drop not used setInitAction ubus luci permission
Drop not used setInitAction ubus luci method permission from
luci-mod-system-uhttpd and luci-mod-system-ssh. They are not used in the
related js files and should be removed as the related js doesn't
use/require them.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-12-30 23:38:19 +00:00
Rafał Miłecki 2e4900eb43 luci-mod-system: use new "rc" ubus object for init.d scripts
Convert startup.js and system.js to use the generic ubus rc method to
handle /etc/init.d/ scripts for enable/disable/start/restart/reload/stop
operation.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
[ reword commit description, convert system.js ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-12-30 23:38:19 +00:00
Sergey Ponomarev 038fdd9fbc luci-mod-system: Remove unused unspecified option
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-08-31 12:01:35 +03:00
Paul Dee 677da57a28 luci-mod-system: grammar fixes
Login (n) -> Log (v) in

Logout (n) -> Log (v) out

Signed-off-by: Paul Dee <itsascambutmailmeanyway@gmail.com>
2023-08-11 13:17:05 +02:00
Jo-Philipp Wich 58f7b27adf luci-mod-system: uhttpd.js: remove flag option overrides
Use standard 0/1 values for the `redirect_https` option.

Supersedes: #6332
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-04-28 23:52:45 +02:00
Jo-Philipp Wich 0186d7eae0 luci-mod-system: fix potential stored XSS
Make sure to escape the key contents in the delete confirmation dialog.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-01-13 21:18:09 +01:00
Jo-Philipp Wich f478fe6c43 luci-mod-system: drop unused Lua code
Drop an unused, leftover Lua cbi model from the system module.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Eric McDonald 2b3c852aa3 luci-mod-system: allow ecdsa-sk and ed25519-sk key types
Allow adding ecdsa-sk and ed25519-sk SSH keys in LuCI
These key types can be generated via the -t flag in ssh-keygen and are
supported in recent versions of dropbear. As ssh-keygen ignores the -b
flag when generating ecdsa-sk and ed25519-sk keys, the curve field in
the objects returned by the decode function is set to fixed strings for
both ecdsa-sk and ed25519-sk public key strings. This is in contrast to
ecdsa keys for which various curves can be provided (e.g., NIST P-256,
NIST P-384, and NIST P-521).

Signed-off-by: Eric McDonald <ericmcdonald@protonmail.com>
2022-09-21 17:25:37 -04:00
Jo-Philipp Wich 944b55738e luci-mod-system: sshkeys.js: prevent XSS through pubkey comments
Ensure to not display public key comments verbatim in order to prevent
injection of markup.

Reported-by: Eric McDonald <ericmcdonald@protonmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-09-21 14:47:41 +02:00
Florian Eckert d4330a53ee luci-mod-system: add config option to invert heartbeat trigger
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-08-05 12:58:10 +02:00
Florian Eckert bb9476cb94 Merge pull request #5765 from TDT-AG/pr/20220412-luci-mod-system
luci-mod-system: mount sections are always mounted unless they are explicitly not mounted
2022-08-03 09:47:50 +02:00
Alexey Dobrovolsky 24ac5a2bf6 luci-mod-system: add interface selection for NTPD
UCI option `interface` for sysntpd server was introduced in
OpenWrt commit 4da60500ebd2. NTP server binds to the specified interface,
or if unspecified, to all.

This patch adds selection widget to LuCI.

Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
2022-05-06 00:08:18 +03:00
Jo-Philipp Wich c2eb30bba7 luci-mod-system: enforce availability of english as language choice
Always offer english, regardless of whether a dummy language pack for it
is installed or not.

Fixes: #5783
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-04-27 20:54:58 +02:00
Florian Eckert b6fb2b1697 luci-mod-system: Set description to blank if the trigger has none
In this case the cbi description div will not be generated and when
switching to another trigger later, attempts to change the description
div contents will fail.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-04-12 14:14:27 +02:00
Florian Eckert 2135525b72 Revert "luci-mod-system: Set description to blank if the trigger has none"
This reverts commit 3de5446003.

I have unfortunately edited the wrong line!

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-04-12 14:12:04 +02:00
Florian Eckert 5abb2847ba luci-mod-system: mount sections are always mounted unless they are explicitly not mounted
fixes #4862

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-04-12 13:01:17 +02:00
Florian Eckert 3de5446003 luci-mod-system: Set description to blank if the trigger has none
In this case the cbi description div will not be generated and when
switching to another trigger later, attempts to change the description
div contents will fail.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-04-12 10:05:36 +02:00
Jo-Philipp Wich e0ff3ff933 luci-mod-system: mention ED25519 keys
Also update translations source strings accordingly.

Fixes: #5649
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-01-19 12:10:03 +01:00
Jo-Philipp Wich fceabd7446 luci-mod-system: add missing require to none led trigger class
Also convert ES6 to ES5 syntax while we're at it.

Fixes: #5476
Fixes: 5b42cd5b46 ("luci-mod-system: move default option from defaul-on trigger to none trigger")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-31 22:27:46 +01:00
Florian Eckert b710c4a843 Merge pull request #5328 from TDT-AG/pr/20210903-luci-mod-system
luci-mod-system: add led-trigger description
2021-10-28 15:47:44 +02:00