Skip to main content

No project description provided

Project description

gooseBit


A simplistic, opinionated remote update server implementing hawkBit™'s DDI API.

Quick Start

Installation

  1. Install dependencies using Poetry:

    poetry install
    
  2. Create the database:

    poetry run aerich init -t goosebit.db.config
    poetry run aerich upgrade
    
  3. Launch gooseBit:

    python main.py
    

Initial Configuration

Before running gooseBit for the first time, update the default credentials in settings.yaml. The default login for testing purposes is:

  • Username: admin@goosebit.local
  • Password: admin

Assumptions

  • Devices use SWUpdate for managing software updates.

Features

Device Registry

When a device connects to gooseBit for the first time, it is automatically added to the device registry. The server will then request the device's configuration data, including:

  • hw_model and hw_revision: Used to match compatible software.
  • sw_version: Indicates the currently installed software version.

The registry tracks each device's status, including the last online timestamp, installed software version, update state, and more.

Software Repository

Software packages (*.swu files) can be hosted directly on the gooseBit server or on an external server. gooseBit parses the software metadata to determine compatibility with specific hardware models and revisions.

Device Update Modes

Devices can be configured with different update modes. The default mode is Rollout.

1. Manual Update to Specified Software

Assign specific software to a device manually. Once installed, no further updates will be triggered.

2. Automatic Update to Latest Software

Automatically updates the device to the latest compatible software, based on the reported hw_model and hw_revision. Note: versions are interpreted as SemVer versions.

3. Software Rollout

Rollouts target all devices with a specified "feed" value, ensuring that the assigned software is installed on all matching devices. Rollouts also track success and error rates, with future plans for automatic aborts. If multiple rollouts exist for the same feed, the most recent rollout takes precedence.

Pause Updates

Devices can be pinned to their current software version, preventing any updates from being applied.

Real-time Update Logs

While updates are in progress, gooseBit captures real-time logs, which are accessible through the device repository.

Development

Database

Create or upgrade database

poetry run aerich upgrade

After a model change create the migration

poetry run aerich migrate

Code formatting and linting

Code is formatted using different tools

  • black and isort for *.py
  • biomejs for *.js, *.json
  • prettier for *.html, *.md, *.yml, *.yaml

Code is linted using different tools as well

  • flake8 for *.py
  • biomejs for *.js

Best to have pre-commit install git hooks that run all those tools before a commit:

poetry run pre-commit install

To manually apply the hooks to all files use:

pre-commit run --all-files

Testing

Tests are implemented using pytest. To run all tests

poetry run pytest

Structure

The structure of gooseBit is as follows:

  • api: Files for the API.
  • ui: Files for the UI.
    • bff: Backend for frontend API.
    • static: Static files.
    • templates: Jinja2 formatted templates.
    • nav: Navbar handler.
  • updater: DDI API handler and device update manager.
  • updates: SWUpdate file parsing.
  • realtime: Realtime API functionality with websockets.
  • auth: Authentication functions and permission handling.
  • models: Database models.
  • db: Database config and initialization.
  • schema: Pydantic models used for API type hinting.
  • settings: Settings loader and handler.
  • telemetry: Telemetry data handlers.
  • routes: Routes for a giving endpoint, including the router.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goosebit-0.2.4.tar.gz (50.1 kB view details)

Uploaded Source

Built Distribution

goosebit-0.2.4-py3-none-any.whl (76.2 kB view details)

Uploaded Python 3

File details

Details for the file goosebit-0.2.4.tar.gz.

File metadata

  • Download URL: goosebit-0.2.4.tar.gz
  • Upload date:
  • Size: 50.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.8.0-1014-azure

File hashes

Hashes for goosebit-0.2.4.tar.gz
Algorithm Hash digest
SHA256 d57e99e032d2a49253e163d0444a65ebe95c1df62b5767b3e36a72043102ff2e
MD5 db9ccf7e512ebb951c4ee2c0a24a9e31
BLAKE2b-256 74e1923efb707f28bdde32aa6b883ce8f6671f8f84760c09d6a67561fe64d5b8

See more details on using hashes here.

File details

Details for the file goosebit-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: goosebit-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 76.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.8.0-1014-azure

File hashes

Hashes for goosebit-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5eaaccbee4c5bf23091ef43dd9e6fa272d3306a456d87946db3c7b6835636dac
MD5 0451d9c02d403a5f578ec07e11f2e309
BLAKE2b-256 4403fbcd89d3232a1a3154ebe1aa7e2bf84e22d65e852f1101ce8496e4705d0f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page