Commit graph

27 commits

Author SHA1 Message Date
Paul Spooren
8936e3c386 luci-app-attendedsysupgrade: request filesystem
It is possible to request a specific filesystem so no other filesystems
are used. This speeds up the build process and may prevent failures in
edge cases.

A recent edge case is installing more packages than ext4 can handle
while squashfs works fine due to compression.

Since  `rootfs_type` is now always available via `procd`, remove the
hack of reading `/proc/mounts`.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-03-22 22:33:33 +00:00
Paul Spooren
de3e0bbffd luci-app-attendedsysupgrade: LuCIfy codebase
This should make the code a bit more readable and LuCI like instead of
using plain JavaScript.

Handle the filesystem correctly to avoid installing suqashfs images on
ext4 devices and the other way around, also recognize systems running
efi.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-03-02 10:48:31 +01:00
Paul Spooren
02de3e4a2b luci-app-attendedsysupgrade: fix ACL definition
Fix the ACL file which handles the permissions for the LuCI app.

Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-07-02 09:22:59 -10:00
Paul Spooren
153ec5f46b luci-app-attendedsysupgrade: remove legacy script
The script was previously used, is however no longer needed since the
rewrite to client side UI rendering.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-03-15 09:29:43 -10:00
Paul Spooren
ddf797c79a luci-app-attendedsysupgrade: remove defaults
The defaults were added to make the app instantly available after
installing, however this automatically works since using JavaScript.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-03-08 09:56:00 -10:00
Paul Spooren
25df4114ec luci-app-attendedsysupgrade: Render on client
Use new LuCI JavaScript code instead of a mix of Lua and JS.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-03-07 23:17:06 -10:00
Paul Spooren
a32e0f443c luci-app-attendedsysupgrade: Send target to server
Currently the running devices `board_name` is mapped to it's building
`profile` name. In case of inconsistent `board_names` like the x86/64
target, it is hard to create a mapping that translates
`lenovo-20q1s02m00` to x86/64 and the generic profile.

To handle such cases, send the `target` per default.

Also `model` is no longer needed as no heuristics are applied anymore to
find the relation between model and profile.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-05-27 13:14:50 -10:00
Jo-Philipp Wich
8f34e105c0 treewide: add ACL annotations to menu entries
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-17 12:40:31 +02:00
Paul Spooren
0c7f3331af luci-app-attendedsysupgrade: use new ASU API
The API of ASU changed as it now uses a static `versions` JSON file.
This moves the upgrade validation to the client site and simplifyies the
server code.

Build requests now use the unique `profile` withouth the need of sending
the devices target.

Also some XMLHttpRequests were replaced by the newer `fetch` function.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-03-05 11:35:42 -10:00
Florian Eckert
b9292a6f57 luci.mk: move /tmp/luci-modulecache remove to package postinst script
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-02-14 09:20:48 +01:00
Florian Eckert
1f8a3c0417 luci.mk: move /tmp/luci-indexcache remove to package postinst script
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-02-14 09:20:33 +01:00
Jo-Philipp Wich
625abbfdbe treewide: convert simple Lua controllers to declarative JSON
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-05 16:52:58 +01:00
Paul Spooren
1dcf802257 luci-app-attendedsysupgrade: add 409 error code
HTTP Error code is send by the upgrade server in case of package
conflicts, like when requesting to install both `odhcpd` and
`odhcpd-ipv6only`.

Also put a <p> around download links to make them look more appealing.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-03-18 16:52:31 +01:00
Paul Spooren
c318a10c14 luci-app-attendedsysupgrade: refactor and format
* Reuse `request_dict` between requests.
* used vim Autoformat plugin to make the javascript code nice.
* add board_name as it eventually replaces board/model in requests

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-03-18 12:12:32 +01:00
Paul Spooren
24fe4788da luci-app-attendedsysupgrade: update to new api
there was a major rewrite of the database structure

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-02-20 08:59:30 +01:00
Paul Spooren
b7954cbdc6 luci-app-attendedsysupgrade: fixup server url
server does not send full download url but only path

fixup error_box

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-02-03 01:23:44 +01:00
Paul Spooren
84ff9094ce luci-app-attendedsysupgrade: new api, unify status
to distinguish between installed packages and requested packages, the
API call is now "installed" instead of "packages".

Also unify "info_box" and "error_box" to "status_box"

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-01-25 19:45:51 +01:00
Stefan Weil
ec63339ae5 Add missing variable declarations in JavaScript code
This fixes errors reported by LGTM.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-28 22:38:20 +01:00
yangfl
ae8b68cfe8 treewide: Fix typos in UI strings
Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-10-12 22:18:51 +08:00
Paul Spooren
6551f5c139 luci-app-attendedsysupgrade: fixup missing package
Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
2018-03-16 18:52:48 +01:00
Paul Spooren
5949c2cea8 luci-app-attendedsysupgrade: reload rpcd fix #1668
when installing the luci app and opening it for the first time the
webinterface shows an error as some freshly installed rpcd calls are not
yet available. The reload fixes the problem.

luci-app-attendedsysupgrade: downloadable image

the creted sysupgrade image can now easily be downloaded via web
interface.

also fixed some </br> to <br />

Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
2018-03-07 13:11:32 +01:00
Paul Spooren
a6d55b19f3 luci-app-attendedsysupgrade: show unknown package
Reads the header X-Unknown-Package offered by the sysupgrade server and
shows it in the error message.

Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
2018-03-06 19:25:08 +01:00
Paul Spooren
6638e4cdd5 luci-app-attendedsysupgrade: remove outdated checks
the upgrade server used to store a md5 checksum and the image filesize,
due to complexity this was removed.

Instead a sha256sums file is created by the IB with additional
signature. The firmware filesize can be retrived by requesting
Content-Length data.sysupgrade_url.

As the deeper layers (rpcd) currently do not offer an easy way to to
perform a sha256sum check & verify a usign sig these features will be
re-added once supported.

Until then the security of the sysupgrades depend on TLS and so the
luci-app is meant as a demonstration only.

Signed-off-by: Paul Spooren <paul@spooren.de>
2017-12-27 03:26:21 +01:00
Paul Spooren
99fea16179 luci-app-attendedsysupgrade: separate js from html
also use hide(), show() and $() like jquery

Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
2017-12-27 03:26:21 +01:00
Paul Spooren
802d5b6bec luci-app-attendedsysupgrade: use rpc-sys pkglist
The bash package rpcd-mod-packagelist is no longer required as it has
been ported to rpc-sys by @dangowrt. The luci app now uses that feature.

The packagelist.acls is no longer required and has been removed.

luci-app-attendedsysupgrade: follow new server api

a new api uses more status codes and headers instead of genric 400 code
with json payload.

show error message when ubus call fail

fix typo

more info here
https://github.com/aparcar/attendedsysupgrade-server#response-status-codes

luci-app-attendedsysupgrade: refactoring

luci-app-attendedsysupgrade: use checksum

now compares cgi-io md5 checksum with md5 of server
as well checks if enough free memory is available to store image

Added needed ACL to let Luci request "system info"

rename "image" to "firmware" in output strings. This was requested as
"unification"

rpcd-mod-packelist used to return a variable called "packagelist", the
new "rpc-sys packagelist" returns a variable called "packages". This has
been adapted.

Signed-off-by: Paul Spooren <paul@spooren.de>
2017-11-24 02:10:31 +01:00
Paul Spooren
4891deaf94 luci-app-attendedsysupgrade: use common
use attendedsysupgrade-common package and rpc-sys instead of
rpcd-mod-attendedsysupgrade

luci-app-attendedsysupgrade: editable server url

the server url can now be changed. The solution is kept as simple as
possible to not introduce any lua code.

Small cleanup, but needs a refactoring.

Add acl rights to edit the attendedsysupgrade file

Add cgi-io as a dependencie to upload image to router

Signed-off-by: Paul Spooren <paul@spooren.de>
2017-11-12 03:09:33 +01:00
Paul Spooren
26c93debe9 luci-app-attendedsysupgrade: upgrade to version 2
Add required ubus acls from package rpcd-mod-attendedsysupgrade.

luci-app-attendedsysupgrade: add postinst script

removes caches and restarts uhttpd as mentioned here:
https://github.com/aparcar/gsoc17-attended-sysupgrade/issues/58#issuecomment-339370803

luci-app-attendedsysupgrade: redesign

simplified the interface and made it more "luci" like

simplify ubus interaction, use uci_call und ubus_call functions

add optional settings:

auto_search:
search on opening the view without clicking

advanced_mode:
if set, allow package edits, show build log

rename updateserver to upgradeserver
rename url to server_url

luci-app-attendedsysupgrade: rename uci options

remove leading "upgrade" from uci options
also rename server_url to url

cleaning

use new api/ urls

wait for successfull reboot

Signed-off-by: Paul Spooren <paul@spooren.de>
2017-11-04 19:25:10 +01:00