From df407d436bf4c849ef603b3c9ffe22c7002b81ce Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Fri, 29 Sep 2023 23:58:31 +0200 Subject: [PATCH 1/6] .github: add codeql workflow Signed-off-by: Enrico Joerns --- .github/workflows/codeql.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..afa99940 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,43 @@ +name: "CodeQL" + +on: + push: + branches: [ "master", "codeql" ] + pull_request: + branches: [ "master", "codeql" ] + schedule: + - cron: "23 8 * * 5" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: cpp + queries: +security-and-quality + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install meson libcurl4-openssl-dev libjson-glib-dev + + - name: Build C Code + run: | + meson setup build + meson compile -C build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:cpp" From c2e54eecee975a143c8ebd1c1c23a9a390311e6c Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Sat, 30 Sep 2023 00:27:31 +0200 Subject: [PATCH 2/6] README.md: replace lgtm badges by CodeQL badge Signed-off-by: Enrico Joerns --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index a96fc042..c8babd3a 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ RAUC hawkBit Updater [![Build Status](https://github.com/rauc/rauc-hawkbit-updater/workflows/tests/badge.svg)](https://github.com/rauc/rauc-hawkbit-updater/actions) [![License](https://img.shields.io/badge/license-LGPLv2.1-blue.svg)](https://raw.githubusercontent.com/rauc/rauc-hawkbit-updater/master/LICENSE) -[![Total alerts](https://img.shields.io/lgtm/alerts/g/rauc/rauc-hawkbit-updater.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rauc/rauc-hawkbit-updater/alerts/) -[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/rauc/rauc-hawkbit-updater.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rauc/rauc-hawkbit-updater/context:cpp) +[![CodeQL](https://github.com/rauc/rauc-hawkbit-updater/workflows/CodeQL/badge.svg)](https://github.com/rauc/rauc-hawkbit-updater/actions/workflows/codeql.yml) [![Documentation](https://readthedocs.org/projects/rauc-hawkbit-updater/badge/?version=latest)](https://rauc-hawkbit-updater.readthedocs.io/en/latest/?badge=latest) [![Matrix](https://img.shields.io/matrix/rauc:matrix.org?label=matrix%20chat)](https://app.element.io/#/room/#rauc:matrix.org) From ad2608dc41a0f365abf8bd28c2a022588d752ff1 Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Sat, 30 Sep 2023 00:48:10 +0200 Subject: [PATCH 3/6] README.md: unify command line call listings Remove excess whitespace and add leading prompt. Signed-off-by: Enrico Joerns --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c8babd3a..46a6cfe0 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ The attributes in hawkBit can be used in target filters. Finally start the updater as daemon: ```shell - ./rauc-hawkbit-updater -c config.conf +$ ./rauc-hawkbit-updater -c config.conf ``` @@ -69,7 +69,7 @@ When setting the log level to 'debug' the RAUC hawkBit client will print JSON payload sent and received. This can be done by using option -d. ```shell - ./rauc-hawkbit-updater -d -c config.conf +$ ./rauc-hawkbit-updater -d -c config.conf ``` @@ -77,8 +77,8 @@ Compile ------- ```shell - meson setup build - ninja -C build +$ meson setup build +$ ninja -C build ``` Test Suite @@ -115,7 +115,7 @@ Usage / options --------------- ```shell -/usr/bin/rauc-hawkbit-updater --help +$ /usr/bin/rauc-hawkbit-updater --help Usage: rauc-hawkbit-updater [OPTION?] From af4535b421911985e7d6faec323fc8fa92f6776f Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Sat, 30 Sep 2023 00:43:12 +0200 Subject: [PATCH 4/6] README.md: some minor fixes Signed-off-by: Enrico Joerns --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 46a6cfe0..30156629 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ RAUC hawkBit Updater [![Documentation](https://readthedocs.org/projects/rauc-hawkbit-updater/badge/?version=latest)](https://rauc-hawkbit-updater.readthedocs.io/en/latest/?badge=latest) [![Matrix](https://img.shields.io/matrix/rauc:matrix.org?label=matrix%20chat)](https://app.element.io/#/room/#rauc:matrix.org) -The RAUC hawkBit updater is a simple commandline tool / daemon written in C (glib). +The RAUC hawkBit updater is a simple command-line tool/daemon written in C (glib). It is a port of the RAUC hawkBit Client written in Python. The daemon runs on your target and operates as an interface between the [RAUC D-Bus API](https://github.com/rauc/rauc) @@ -17,10 +17,10 @@ Quickstart ---------- The RAUC hawkBit updater is primarily meant to be used as a daemon, -but it also allows you to do a one shot instantly checking and install +but it also allows you to do a one-shot instantly checking and install new software. -To quickly getting started with hawkBit server, follow +To quickly get started with hawkBit server, follow [this](https://github.com/eclipse/hawkbit#getting-started) instruction. @@ -111,7 +111,7 @@ Run test suite: Pass `-o log_cli=true` to pytest in order to enable live logging for all test cases. -Usage / options +Usage / Options --------------- ```shell From c57644541b79a0c3becd82ac877c165e3f61e6e8 Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Sat, 30 Sep 2023 00:23:38 +0200 Subject: [PATCH 5/6] README.md: note minimal build requirements Signed-off-by: Enrico Joerns --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 30156629..1331f7ca 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,17 @@ $ ./rauc-hawkbit-updater -d -c config.conf Compile ------- +Install build pre-requisites: + +* meson +* libcurl +* libjson-glib + +```shell +$ sudo apt-get update +$ sudo apt-get install meson libcurl4-openssl-dev libjson-glib-dev +``` + ```shell $ meson setup build $ ninja -C build From f4e6c0bb81d3f857f61259975810997dc38c95e1 Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Sat, 30 Sep 2023 00:31:34 +0200 Subject: [PATCH 6/6] add .readthedocs.yaml to fix build readthedocs.org starts refusing builds with missing or old config files: | Error | The configuration file required to build documentation is missing from | your project. Add a configuration file to your project to make it build | successfully. Read more at | https://docs.readthedocs.io/en/stable/config-file/v2.html First of all, this just adds the basic template suggested under the above-mentioned link. Signed-off-by: Enrico Joerns --- .readthedocs.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..faed0469 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,9 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: docs/conf.py