collect.py: format with black
[web/firmware-selector-openwrt-org.git] / README.md
1 # Yet Another Firmware Selector
2
3 A simple OpenWrt firmware selector using autocompletion. Uses plain
4 HTML/CSS/JavaScript. Checkout the [Demo](https://mwarning.github.io/yet-another-firmware-selector/www/).
5
6 ![image](misc/screenshot.png)
7
8
9 ## Run
10
11 * Download the sources and change the working directory
12 * Start webserver (e.g. `python3 -m http.server`)
13 * Go to `http://localhost:8000/www/` in your web browser
14
15 Configure with [config.js](www/config.js).
16
17 ## Attended Sysupgrade Support
18
19 This firmware selector can speak to a [ASU server](https://github.com/aparcar/asu) to build custom images. To enable the feature, the `asu_url` option in the config.js needs to be set.
20
21 ## Update Database
22
23 The `overview.json` files are based on JSON files created by OpenWrt
24 (master): `Global build settings ---> [*] Create JSON info files per build
25 image`.
26
27 A [Python script](misc/collect.py) is included to merge the JSON files into a single overview.json:
28 ```
29 ./collect.py merge bin/ --download-url 'https://downloads.openwrt.org/releases/{version}/targets/{target}' > overview.json
30 ```
31
32 If you want to scrape the OpenWrt download website and update the config.js:
33 ```
34 ./collect.py scrape https://downloads.openwrt.org /var/www/firmware_selector
35 ```
36
37 For the OpenWrt 18.06 and 19.07 releases, you need to patch OpenWrt to output JSON files for collect.py (commit [openwrt/openwrt@881ed09](https://github.com/openwrt/openwrt/commit/881ed09ee6e23f6c224184bb7493253c4624fb9f)).
38
39 ## Similar Projects
40
41 - [Gluon Firmware Selector](https://github.com/freifunk-darmstadt/gluon-firmware-selector): Original source of this project for images generated by [Gluon](https://github.com/freifunk-gluon/), now with pictures.
42 - [Freifunk Hennef Firmware Downloader](https://github.com/Freifunk-Hennef/ffhef-fw-dl): Similar to the project above, but PHP based.
43 - [LibreMesh Chef](https://github.com/libremesh/chef/): Allows to select configurations.
44 - [GSoC Firmware Selector](https://github.com/sudhanshu16/openwrt-firmware-selector/): Result of the GSoC
45 - [FFB Firmware Selector](https://github.com/freifunk-bielefeld/firmware-selector): Build for Freifunk Bielefeld