www/index.html: add proper project URL and add version variable
[web/firmware-selector-openwrt-org.git] / README.md
index e3c23db2b20b9bf8daec08a01e86ab48e41480da..2452880f739383aec37b9b26d81b11f84aa5e5e6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,30 +1,54 @@
 # 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](screenshot.png)
+![image](misc/screenshot.png)
 
-Run:
 
-* Download repository.
-* Go to the project www directory.
+## Quick Run
+
+* 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](www/config.js).
 
-## Update Database
+## Attended Sysupgrade Support
+
+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.
+
+## Installation
+
+Place the `www/` folder somewhere web accessible. Then use the `collect.py` script to update the `config.json` file:
+
+```
+./misc/collect.py scan "https://firmware.example.com/{version}/targets/{target}" ~/openwrt/bin/ www/
+```
+
+This should do it.
+
+The https link is used to access image files. `{version}` will be replaced by the name of the release, e.g. `19.07.4`. `{taget}` will be replaced by the main- and sub target, e.g. `ath79/generic`.
+
+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`.
 
-OpenWrt master has a feature to create json files: `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).
 
-The included python script can merge all these files for a new data.json file: `./collect.py bin/ bin2/ > data.json`
+### Scrape
 
-The data JSON file can also include a link that will overwrite downloadLink from `config.json`.
+If you want to scrape the OpenWrt download website and update the `config.js`:
 
-## Contributions
+```
+./collect.py --download-url "https://firmware.example.com/{version}/targets/{target}" scrape https://downloads.openwrt.org /var/www/firmware_selector
+```
 
-It would be nice to have more features. E.g.:
+## Similar Projects
 
-* more translations
-* help text for images
-* better CSS
+- [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://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