{"id":14109633,"url":"https://github.com/openwrt/asu","last_synced_at":"2025-08-01T09:31:05.636Z","repository":{"id":37739562,"uuid":"91547904","full_name":"openwrt/asu","owner":"openwrt","description":"An image on demand server for OpenWrt based distributions","archived":false,"fork":false,"pushed_at":"2024-10-29T12:23:16.000Z","size":2403,"stargazers_count":327,"open_issues_count":286,"forks_count":82,"subscribers_count":25,"default_branch":"main","last_synced_at":"2024-10-29T13:18:30.904Z","etag":null,"topics":["flask","imagebuilder","lede","libremesh","openwrt","python","python3","sysupgrade"],"latest_commit_sha":null,"homepage":"https://sysupgrade.openwrt.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openwrt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-17T07:44:03.000Z","updated_at":"2024-10-29T11:19:00.000Z","dependencies_parsed_at":"2023-11-17T22:57:40.474Z","dependency_job_id":"a64f07d0-953c-4eb6-b680-8412a26018c3","html_url":"https://github.com/openwrt/asu","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwrt%2Fasu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwrt%2Fasu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwrt%2Fasu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwrt%2Fasu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openwrt","download_url":"https://codeload.github.com/openwrt/asu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228360158,"owners_count":17907868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","imagebuilder","lede","libremesh","openwrt","python","python3","sysupgrade"],"created_at":"2024-08-14T10:02:25.291Z","updated_at":"2025-08-01T09:31:05.623Z","avatar_url":"https://github.com/openwrt.png","language":"Python","readme":"# Attendedsysupgrade Server (GSoC 2017)\n\n[![codecov](https://codecov.io/gh/aparcar/asu/branch/master/graph/badge.svg)](https://codecov.io/gh/aparcar/asu)\n[![PyPi](https://badge.fury.io/py/asu.svg)](https://badge.fury.io/py/asu)\n\nThis project simplifies the sysupgrade process for upgrading the firmware of\ndevices running OpenWrt or distributions based on it. These tools offer an easy\nway to reflash the router with a new firmware version\n(including all packages) without the need to use `opkg`.\n\nASU is based on an [API](#api) to request custom firmware images with any\nselection of packages pre-installed. This avoids the need to set up a build\nenvironment, and makes it possible to create a custom firmware image even using\na mobile device.\n\n## Clients of the Sysupgrade Server\n\n### OpenWrt Firmware Selector\n\nSimple web interface using vanilla JavaScript currently developed by @mwarning.\nIt offers a device search based on model names and show links either to\n[official images](https://downloads.openwrt.org/) or requests images via the\n_asu_ API. Please join in the development at\n[GitLab repository](https://gitlab.com/openwrt/web/firmware-selector-openwrt-org)\n\n* \u003chttps://firmware-selector.openwrt.org\u003e\n\n![ofs](misc/ofs.png)\n\n### LuCI app\n\nThe package\n[`luci-app-attendedsysupgrade`](https://github.com/openwrt/luci/tree/master/applications/luci-app-attendedsysupgrade)\noffers a simple tool under `System \u003e Attended Sysupgrade`. It requests a new\nfirmware image that includes the current set of packages, waits until it's built\nand flashes it. If \"Keep Configuration\" is checked in the GUI, the device\nupgrades to the new firmware without any need to re-enter any configuration or\nre-install any packages.\n\n![luci](misc/luci.png)\n\n### CLI\n\nWith `OpenWrt SNAPSHOT-r26792 or newer` (and in the 24.10 release) the CLI app\n[`auc`](https://github.com/openwrt/packages/tree/master/utils/auc) was replaced\nwith [`owut`](https://openwrt.org/docs/guide-user/installation/sysupgrade.owut)\nas a more comprehensive CLI tool to provide an easy way to upgrade your device.\n\n![owut](misc/owut.png)\n\n## Server\n\nThe server listens for image requests and, if valid, automatically generates\nthem. It coordinates several OpenWrt ImageBuilders and caches the resulting\nimages in a Redis database. If an image is cached, the server can provide it\nimmediately without rebuilding.\n\n### Active server\n\n* [sysupgrade.openwrt.org](https://sysupgrade.openwrt.org)\n* [ImmortalWrt](https://sysupgrade.kyarucloud.moe)\n* [LibreMesh](https://sysupgrade.antennine.org) (only `stable` and `oldstable` openwrt versions)\n* Create a pull request to add your server here\n\n## Run your own server\n\nFor security reasons each build happens inside a container so that one build\ncan't affect another build. For this to work a Podman container runs an API\nservice so workers can themselfs execute builds inside containers.\n\n### Installation\n\nThe server uses `podman-compose` to manage the containers. On a Debian based\nsystem, install the following packages:\n\n```bash\nsudo apt install podman-compose\n```\n\nA [Python library](https://podman-py.readthedocs.io/en/latest/) is used to\ncommunicate with Podman over a socket. To enable the socket either `systemd` is\nrequired or the socket must be started manually using the Podman itself:\n\n```bash\n# systemd\nsystemctl --user enable podman.socket\nsystemctl --user start podman.socket\nsystemctl --user status podman.socket\n\n# manual (must stay open)\npodman system service --time=0 unix:/run/user/$(id -u)/podman/podman.sock\n```\n\nNow you can either use the latest ASU containers or build them yourself, run\neither of the following two commands:\n\n```bash\n# use existing containers\npodman-compose pull\n\n# build containers locally\npodman-compose build\n```\nThe services are configured via environment variables, which can be set in a\n`.env` file\n\n```bash\necho \"PUBLIC_PATH=$(pwd)/public\" \u003e .env\necho \"CONTAINER_SOCKET_PATH=/run/user/$(id -u)/podman/podman.sock\" \u003e\u003e .env\n# optionally allow custom scripts running on first boot\necho \"ALLOW_DEFAULTS=1\" \u003e\u003e .env\n```\n\nNow it's possible to run all services via `podman-compose`:\n\n```bash\npodman-compose up -d\n```\n\nThis will start the server, the Podman API container and one worker. Once the\nserver is running, it's possible to request images via the API on\n`http://localhost:8000`. Modify `podman-compose.yml` to change the port.\n\n### Production\n\nFor production it's recommended to use a reverse proxy like `nginx` or `caddy`.\nYou can find a Caddy sample configuration in `misc/Caddyfile`.\n\nIf you want your server to remain active after you log out of the server, you\nmust enable \"linger\" in `loginctl`:\n\n```bash\nloginctl enable-linger\n```\n\n#### System requirements\n\n* 2 GB RAM (4 GB recommended)\n* 2 CPU cores (4 cores recommended)\n* 50 GB disk space (200 GB recommended)\n\n#### Squid Cache\n\nInstead of creating and uploading SNAPSHOT ImageBuilder containers everyday,\nonly a container with installed dependencies and a `setup.sh` script is offered.\nASU will automatically run that script and setup the latest ImageBuilder. To\nspeed up the process, a Squid cache can be used to store the ImageBuilder\narchives locally. To enable the cache, set `SQUID_CACHE=1` in the `.env` file.\n\nTo have the cache accessible from running containers, the Squid port 3128 inside\na running container must be forwarded to the host. This can be done by adding\nthe following line to the `.config/containers/containers.conf` file:\n\n```toml\n[network]\npasta_options = [\n    \"-a\", \"10.0.2.0\",\n    \"-n\", \"24\",\n    \"-g\", \"10.0.2.2\",\n    \"--dns-forward\", \"10.0.2.3\",\n    \"-T\", \"3128:3128\"\n]\n```\n\n\u003e If you know a better setup, please create a pull request.\n\n### Development\n\nAfter cloning this repository, install `poetry` which manages the Python\ndependencies.\n\n```bash\napt install python3-poetry\npoetry install\n```\n\n#### Running the server\n\n```bash\npoetry run fastapi dev asu/main.py\n```\n\n#### Running a worker\n\n```bash\nsource .env # poetry does not load .env\npoetry run rq worker\n```\n\n### API\n\nThe API is documented via _OpenAPI_ and can be viewed interactively on the\nserver:\n\n* [https://sysupgrade.openwrt.org/docs/](https://sysupgrade.openwrt.org/docs/)\n* [https://sysupgrade.openwrt.org/redoc](https://sysupgrade.openwrt.org/redoc/)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwrt%2Fasu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenwrt%2Fasu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwrt%2Fasu/lists"}