ci: remove superfluous before_script
[web/firmware-selector-openwrt-org.git] / README.md
index b2e8a12aab11c92718158a03c818cb12535b32cf..7ea9464b86dd10fce0a2943407e2de3ffae4d8fc 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,39 +1,58 @@
 # Yet Another Firmware Selector
 
-A simple OpenWrt firmware selector using autocompletion. Uses plain HTML/JavaScript.
+A simple OpenWrt firmware selector using autocompletion. Uses plain
+HTML/CSS/JavaScript. Checkout the [Demo](https://mwarning.github.io/yet-another-firmware-selector/www/).
 
 ![image](misc/screenshot.png)
 
-Checkout the [Demo](https://mwarning.github.io/yet_another_firmware_selector/)!
 
-Run:
+## Quick Run
 
-* Download repository and change directory to it
+* Download the sources and change the working directory
 * Start webserver (e.g. `python3 -m http.server`)
-* Go to `http://localhost:8000`
+* Go to `http://localhost:8000/www/` in your web browser
 
-Configure with [config.js](config.js).
+Configure with [config.js](www/config.js).
 
-## Update Database
+## Attended Sysupgrade Support
 
-The `names-<version>.json` files are based on JSON files created by OpenWrt (master): `Global build settings  ---> [*] Create JSON info files per build image`.
+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.
 
-A [Python script](misc/collect.py) is included to create those json files: `./collect.py bin/ --url 'https://downloads.openwrt.org/releases/{release}/targets/{target}' > names-test.json`.
+## Installation
 
-Note: Files `names-18.06.7.json` and `names-19.07.1.json` contain data for older OpenWrt releases that do not support JSON output. It was generated using heuristics.
+Place the `www/` folder somewhere web accessible. Then use the `collect.py` script to update the `config.json` file:
 
-## Contributions
+```
+./misc/collect.py scan "https://firmware.example.com/{version}/targets/{target}" ~/openwrt/bin/ www/
+```
 
-It would be nice to have more features. E.g.:
+This should do it.
 
-* more translations
-* help text for images
-* better CSS
+The https link is used to access image files. There are different variables available:
+
+* `{version}`: Version in the profiles.json files. E.g. `19.07.4` or `SNAPSHOT`.
+* `{target}`: Main- and sub target, E.g. `ath79/generic`.
+* `{base}`: Distinct path to the targets directory. E.g. `releases/18.06.8/targets/`
+
+The `collect.py` script searches the `~/openwrt/bin/` directory for `profile.json` files. These are merged into `overview.json` files (one per release). The `overview.json` files are then placed into `www/data/` and `www/config.js` is updated.
+
+To let OpenWrt create `profile.json` files, enable the build setting (`make menuconfig`):
+`Global build settings  ---> [*] Create JSON info files per build image`.
+
+If the option is not available (OpenWrt 18.06 or 19.07.3), apply commit [openwrt/openwrt@881ed09](https://github.com/openwrt/openwrt/commit/881ed09ee6e23f6c224184bb7493253c4624fb9f).
+
+### Scrape
+
+If you want to scrape the OpenWrt download website and update the `config.js`:
+
+```
+./misc/collect.py scrape https://downloads.openwrt.org www/
+```
 
 ## Similar Projects
 
 - [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.
 - [Freifunk Hennef Firmware Downloader](https://github.com/Freifunk-Hennef/ffhef-fw-dl): Similar to the project above, but PHP based.
-- [LibreMesh Chef](https://chef.libremesh.org/): Allows to select configurations.
+- [LibreMesh Chef](https://github.com/libremesh/chef/): Allows to select configurations.
 - [GSoC Firmware Selector](https://github.com/sudhanshu16/openwrt-firmware-selector/): Result of the GSoC
 - [FFB Firmware Selector](https://github.com/freifunk-bielefeld/firmware-selector): Build for Freifunk Bielefeld