Commit Graph

167 Commits (c4eaea70c78e8a46f98047cbcff6326bfccafe3a)

Author SHA1 Message Date
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
Florian Eckert 5b42cd5b46 luci-mod-system: move default option from defaul-on trigger to none trigger
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-10-28 15:43:50 +02:00
Florian Eckert bff0878f91 luci-mod-system: add led-trigger description
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-10-27 10:38:34 +02:00
Jo-Philipp Wich 07569c5af2 luci-mod-system: fix time display logic
Use the system/info ubus call to obtain a TZ adjusted epoch value and
format the date time string manually instead of relying on the browsers
local representation.

Fixes: #5454
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-19 23:09:46 +02:00
Petr Štetiar 7c943a1d6b luci-mod-system: allow configuration of HTTPS redirection
Add a posibility for easy configuration of HTTPS redirection in uHTTPd.

References: https://lists.infradead.org/pipermail/openwrt-devel/2020-December/032718.html
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-09-28 10:46:36 -10:00
Rosen Penev 738f36a1c3 fix wrong ed25519 information
ECDH is not used for the ed25519. The scheme is called EdDSA.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 12:11:00 -10:00
Florian Eckert b5ea85b724 luci-mod-system: add help text to the led-trigger timer
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-09-03 10:00:22 +02:00
Ansuel Smith 82035eec61 luci-mod-system: hide unsupported option on flash.js
Hide unsupported option when /rom is not used in flash.js

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-08-18 13:44:37 +03:00
Fritz D. Ansel 8fb2d82f70 system: more text lines for crontab
10 lines are very few and there is much unused space

Signed-off-by: Fritz D. Ansel <fdansel@yandex.ru>
2021-08-11 09:25:46 +02:00
Ansuel Smith 0f4f6e89f1
luci-mod-system: improve sysupgrade page
- Add missing -k and -u option from sysupgrade page.
- Fix missing check for image verification exit code
- Provide the actual reason of the image verification

Fixes: #4160

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-08-05 15:50:56 +02:00
Jo-Philipp Wich 8d4ac60f7a luci-mod-system: reload crond upon saving crontab
Fixes: #5184
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-15 11:58:38 +02:00
Dirk Brenken 8c6a29a45c
luci-mod-system: remove bogus btn class in flash.js
* fixes #4970
* sync translations

Signed-off-by: Dirk Brenken <dev@brenken.org>
2021-04-15 19:52:52 +02:00
Henrique de Moraes Holschuh 80a1a9a555 luci-mod-system: implement system.description, system.notes
Implement two new text "options" for UCI system config, intended to
help humans describe the device.

"system.description" is a short, single-line description suitable for
selector UIs in remote administration applications, or remote UCI (over
ubus RPC), etc.  It would also be suitable as a default for LLDP/SNMP
"system description".

"system.notes" is a multi-line, free-form text field that can be used in
any way the user wishes, e.g. to hold installation notes, or unit serial
number and inventory number, location, etc.

Signed-off-by: Henrique de Moraes Holschuh <henrique@nic.br>
2021-04-06 23:20:26 +03:00
Rui Salvaterra 4bf84e29ea luci-mod-system/zram: remove zram_comp_streams
Zram uses per-CPU compression streams [1]. This is a no-op.

[1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=116191eddf9d8ddba61de788824dea442b265936

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-03-14 12:24:16 +00:00
Rui Salvaterra 02cadf67b2 luci-mod-system/zram: replace deflate with zstd
Deflate is just too slow for zram. Replace it with zstd, which is much faster at
similar compression ratios.

As a side note, this is an ugly hack. We're hard-coding compression algorithms
which might not be available in the system. The availability should be parsed
from /sys/block/zram0/comp_algorithm.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-03-14 12:24:15 +00:00
Hannu Nyman e2ac2e92b0 luci-base: correct button name on flash page help text
Correct the help text in the flash page to match the current
buttons. 'Continue' instead of "Proceed".

Adjust translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-01-12 19:13:52 +02:00
Sungbo Eo ea526fb7a2 luci-mod-system: drop kmod-ledtrig-* dependency
The kmod packages were dropped from OpenWrt,
and the LED triggers are now kernel built-in.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-01-08 20:58:33 +09:00
Jo-Philipp Wich 846b89c5bf luci-mod-system: fix parsing SSH pubkeys with options
Also eliminate some duplicate code while we're at it.

Fixes: #4684
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-12-23 15:33:08 +01:00
Jo-Philipp Wich 03c77dafe3 treewide: transition div tables to actual table markup
Modern browsers allow decomposing table markup equally well as nested div
constructs, therefor migrate our <div> table markup to actual <table> tags
but keep the old table/tr/th/td CSS classes for now to allow for a smooth
theme transition.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-11-27 21:36:40 +01:00
Florian Eckert a75ae38b6b luci-mod-system: fix uci led option remove callback
fixes #4478

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-10-06 11:30:48 +02:00
Rafał Miłecki 96bb528ccc luci-mod-system: use ubus method for reboot
It's more generic & convenient than hardcoding /sbin/reboot executable
path. procd provides "reboot" method since 2016.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2020-09-10 17:35:07 +02:00
Jo-Philipp Wich d2d3738d90 luci-mod-system: ignore empty /proc/mtd on flash page
A present, but empty /proc/mtd causes validation on the flash page to fail,
preventing any other operation.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-07-22 10:29:11 +02:00
Sven Roederer 354e4cb4a7 treewide: adapt to new luci.xml class
In the previous commit the luci.xml module was created, Let's change all
references to the old functions to the new xml-module.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
2020-07-19 20:14:47 +02:00