Skip to content

Commit 8c987c8

Browse files
committed
Merge remote-tracking branch 'official/main' into dev
2 parents dc7dd51 + a3a1aa5 commit 8c987c8

10 files changed

Lines changed: 244 additions & 95 deletions

File tree

.github/actions/setup-build-environment/action.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,14 @@ runs:
2525
- name: Extract Version from Git Tag
2626
shell: bash
2727
run: |
28-
GIT_TAG_NAME="${GITHUB_REF#refs/tags/}"
29-
echo "GIT_TAG_VERSION=${GIT_TAG_NAME##*-}" >> $GITHUB_ENV
28+
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
29+
# triggered by a tag push (e.g: refs/tags/companion-v1.2.3)
30+
GIT_TAG_NAME="${GITHUB_REF#refs/tags/}"
31+
VERSION_STRING="${GIT_TAG_NAME##*-}"
32+
else
33+
# triggered by a workflow dispatch (e.g: refs/heads/main)
34+
# strip "refs/heads/" prefix and replace any remaining "/" with "-" to protect file paths
35+
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
36+
VERSION_STRING=$(echo "$BRANCH_NAME" | tr '/' '-')
37+
fi
38+
echo "GIT_TAG_VERSION=${VERSION_STRING}" >> $GITHUB_ENV

.github/workflows/build-companion-firmwares.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,8 @@ on:
1010
- 'companion-*'
1111

1212
jobs:
13-
14-
build:
15-
runs-on: ubuntu-latest
16-
steps:
17-
18-
- name: Clone Repo
19-
uses: actions/checkout@v6
20-
21-
- name: Setup Build Environment
22-
uses: ./.github/actions/setup-build-environment
23-
24-
- name: Build Firmwares
25-
env:
26-
FIRMWARE_VERSION: ${{ env.GIT_TAG_VERSION }}
27-
run: /usr/bin/env bash build.sh build-companion-firmwares
28-
29-
- name: Upload Workflow Artifacts
30-
uses: actions/upload-artifact@v7
31-
with:
32-
name: companion-firmwares
33-
path: out
34-
35-
- name: Create Release
36-
uses: softprops/action-gh-release@v3
37-
if: startsWith(github.ref, 'refs/tags/')
38-
with:
39-
name: Companion Firmware ${{ env.GIT_TAG_VERSION }}
40-
body: ""
41-
draft: true
42-
files: out/*
13+
build-companion-firmwares:
14+
uses: ./.github/workflows/firmware-builder.yml
15+
with:
16+
firmware_type: 'companion'
17+
release_title_prefix: 'Companion Firmware'

.github/workflows/build-repeater-firmwares.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,8 @@ on:
1010
- 'repeater-*'
1111

1212
jobs:
13-
14-
build:
15-
runs-on: ubuntu-latest
16-
steps:
17-
18-
- name: Clone Repo
19-
uses: actions/checkout@v6
20-
21-
- name: Setup Build Environment
22-
uses: ./.github/actions/setup-build-environment
23-
24-
- name: Build Firmwares
25-
env:
26-
FIRMWARE_VERSION: ${{ env.GIT_TAG_VERSION }}
27-
run: /usr/bin/env bash build.sh build-repeater-firmwares
28-
29-
- name: Upload Workflow Artifacts
30-
uses: actions/upload-artifact@v7
31-
with:
32-
name: repeater-firmwares
33-
path: out
34-
35-
- name: Create Release
36-
uses: softprops/action-gh-release@v3
37-
if: startsWith(github.ref, 'refs/tags/')
38-
with:
39-
name: Repeater Firmware ${{ env.GIT_TAG_VERSION }}
40-
body: ""
41-
draft: true
42-
files: out/*
13+
build-repeater-firmwares:
14+
uses: ./.github/workflows/firmware-builder.yml
15+
with:
16+
firmware_type: 'repeater'
17+
release_title_prefix: 'Repeater Firmware'

.github/workflows/build-room-server-firmwares.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,8 @@ on:
1010
- 'room-server-*'
1111

1212
jobs:
13-
14-
build:
15-
runs-on: ubuntu-latest
16-
steps:
17-
18-
- name: Clone Repo
19-
uses: actions/checkout@v6
20-
21-
- name: Setup Build Environment
22-
uses: ./.github/actions/setup-build-environment
23-
24-
- name: Build Firmwares
25-
env:
26-
FIRMWARE_VERSION: ${{ env.GIT_TAG_VERSION }}
27-
run: /usr/bin/env bash build.sh build-room-server-firmwares
28-
29-
- name: Upload Workflow Artifacts
30-
uses: actions/upload-artifact@v7
31-
with:
32-
name: room-server-firmwares
33-
path: out
34-
35-
- name: Create Release
36-
uses: softprops/action-gh-release@v3
37-
if: startsWith(github.ref, 'refs/tags/')
38-
with:
39-
name: Room Server Firmware ${{ env.GIT_TAG_VERSION }}
40-
body: ""
41-
draft: true
42-
files: out/*
13+
build-room-server-firmwares:
14+
uses: ./.github/workflows/firmware-builder.yml
15+
with:
16+
firmware_type: 'room-server'
17+
release_title_prefix: 'Room Server Firmware'
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Firmware Builder
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
firmware_type:
7+
required: true
8+
type: string
9+
release_title_prefix:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
15+
generate-build-matrix:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
targets: ${{ steps.get-build-targets.outputs.targets }}
19+
steps:
20+
21+
- name: Clone Repo
22+
uses: actions/checkout@v6
23+
24+
- name: Setup Build Environment
25+
uses: ./.github/actions/setup-build-environment
26+
27+
- name: Get Build Targets
28+
id: get-build-targets
29+
run: |
30+
# get list of firmwares to build
31+
TARGET_LIST=$(/usr/bin/env bash build.sh get-${{ inputs.firmware_type }}-firmwares-to-build)
32+
33+
# convert targets separated by new line into a json array string
34+
JSON_ARRAY=$(echo "$TARGET_LIST" | jq -R -s -c 'split("\n") | map(select(length > 0))')
35+
36+
# use json array as targets result
37+
echo "targets=$JSON_ARRAY" >> $GITHUB_OUTPUT
38+
39+
build:
40+
needs: generate-build-matrix
41+
runs-on: ubuntu-latest
42+
continue-on-error: true # don't fail entire build if one board fails to build
43+
strategy:
44+
matrix:
45+
target: ${{ fromJson(needs.generate-build-matrix.outputs.targets) }}
46+
fail-fast: false # don't cancel other builds if one board fails to build
47+
steps:
48+
49+
- name: Clone Repo
50+
uses: actions/checkout@v6
51+
52+
- name: Setup Build Environment
53+
uses: ./.github/actions/setup-build-environment
54+
55+
- name: Build Firmware
56+
env:
57+
FIRMWARE_VERSION: ${{ env.GIT_TAG_VERSION }}
58+
run: /usr/bin/env bash build.sh build-firmware ${{ matrix.target }}
59+
60+
- name: Upload Workflow Artifacts
61+
uses: actions/upload-artifact@v7
62+
with:
63+
name: "${{ matrix.target }}"
64+
path: out
65+
66+
create-release:
67+
needs: build
68+
runs-on: ubuntu-latest
69+
if: startsWith(github.ref, 'refs/tags/') # only create release for tagged builds
70+
steps:
71+
72+
- name: Clone Repo
73+
uses: actions/checkout@v6
74+
75+
- name: Setup Build Environment
76+
uses: ./.github/actions/setup-build-environment
77+
78+
- name: Download All Artifacts
79+
uses: actions/download-artifact@v8
80+
with:
81+
merge-multiple: true
82+
path: out
83+
84+
- name: Create Release
85+
uses: softprops/action-gh-release@v3
86+
with:
87+
name: "${{ inputs.release_title_prefix }} ${{ env.GIT_TAG_VERSION }}"
88+
body: ""
89+
draft: true
90+
files: out/*

.github/workflows/stale-bot.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Run Stale Bot'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *' # daily at 1:30am
5+
workflow_dispatch: {}
6+
7+
permissions:
8+
actions: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
close-issues:
14+
# only run on main repo, not forks
15+
if: github.repository == 'meshcore-dev/MeshCore'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Close Stale Issues
19+
uses: actions/stale@v10
20+
with:
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
# auto close issues
23+
days-before-issue-stale: 60
24+
days-before-issue-close: 7
25+
exempt-issue-labels: "keep-open"
26+
stale-issue-label: "stale"
27+
stale-issue-message: "This issue is stale because it has been open for 60 days with no activity. Remove the stale label or add a comment if this issue is still relevant, otherwise this issue will automatically close in 7 days."
28+
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
29+
# don't auto close prs
30+
days-before-pr-stale: -1
31+
days-before-pr-close: -1
32+

SECURITY.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Security fixes are applied to the latest release only. We do not backport
6+
fixes to older versions.
7+
8+
| Version | Supported |
9+
|---------|-----------|
10+
| 1.15+ ||
11+
| <1.15 ||
12+
13+
## Reporting a Vulnerability
14+
15+
**Please do not report security vulnerabilities through public GitHub issues.**
16+
17+
Use GitHub's private vulnerability reporting instead:
18+
1. Go to the **Security** tab of this repository
19+
2. Click **Report a vulnerability**
20+
3. Fill in the details and submit
21+
22+
### What to include
23+
24+
A useful report tells us:
25+
- Which component or file is affected
26+
- What an attacker can do (impact) and under what conditions
27+
- A minimal reproduction case or proof-of-concept if you have one
28+
- Whether you believe it is remotely exploitable
29+
30+
You do not need a working exploit to report. An incomplete report is better
31+
than no report.
32+
33+
## What to expect
34+
35+
This is a volunteer-maintained open-source project. We will do our best to
36+
respond in a reasonable timeframe, but cannot commit to specific deadlines.
37+
38+
We ask that you give us a fair opportunity to investigate and address the
39+
issue before any public disclosure. If you have not heard back after
40+
**90 days**, feel free to follow up or proceed with disclosure at your
41+
discretion.
42+
43+
## Scope
44+
45+
In scope:
46+
- Remote code execution, memory corruption, or denial-of-service via crafted
47+
radio packets
48+
- Authentication or encryption bypasses
49+
- Vulnerabilities in the packet routing or path handling logic
50+
51+
Out of scope:
52+
- Physical access attacks (e.g., JTAG, UART extraction of keys)
53+
- Regulatory compliance (duty cycle, frequency restrictions)
54+
- Jamming or other physical-layer radio interference
55+
- Issues in third-party libraries (RadioLib, Crypto, etc.) — report those
56+
upstream
57+
- "Best practice" suggestions without a demonstrated attack path

build.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# exit when any command fails
4+
set -e
5+
36
global_usage() {
47
cat - <<EOF
58
Usage:
@@ -93,7 +96,7 @@ get_pio_envs_ending_with_string() {
9396
# $1 should be the environment name
9497
get_platform_for_env() {
9598
local env_name=$1
96-
echo "$PIO_CONFIG_JSON" | python3 -c "
99+
printf '%s' "$PIO_CONFIG_JSON" | python3 -c "
97100
import sys, json, re
98101
data = json.load(sys.stdin)
99102
for section, options in data:
@@ -275,4 +278,11 @@ elif [[ $1 == "build-repeater-firmwares" ]]; then
275278
build_repeater_firmwares
276279
elif [[ $1 == "build-room-server-firmwares" ]]; then
277280
build_room_server_firmwares
281+
elif [[ $1 == "get-companion-firmwares-to-build" ]]; then
282+
get_pio_envs_ending_with_string "_companion_radio_usb"
283+
get_pio_envs_ending_with_string "_companion_radio_ble"
284+
elif [[ $1 == "get-repeater-firmwares-to-build" ]]; then
285+
get_pio_envs_ending_with_string "_repeater"
286+
elif [[ $1 == "get-room-server-firmwares-to-build" ]]; then
287+
get_pio_envs_ending_with_string "_room_server"
278288
fi

docs/cli_commands.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,25 @@ This document provides an overview of CLI commands that can be sent to MeshCore
2929
**Usage:**
3030
- `reboot`
3131

32+
**Note:** No reply is sent.
33+
34+
---
35+
36+
### Power-off the node
37+
**Usage:**
38+
- `poweroff`, or
39+
- `shutdown`
40+
41+
**Note:** No reply is sent.
42+
3243
---
3344

3445
### Reset the clock and reboot
3546
**Usage:**
3647
- `clkreboot`
3748

49+
**Note:** No reply is sent.
50+
3851
---
3952

4053
### Sync the clock with the remote device
@@ -661,10 +674,21 @@ This document provides an overview of CLI commands that can be sent to MeshCore
661674
**Parameters:**
662675
- `value`: Maximum flood hop count (0-64) for a packet without a scope (no region set)
663676

664-
**Default:** `0xFF` - indicates it hasn't been set, will track flood.max until it is.
677+
**Default:** `64` - (`0xFF` indicates it hasn't been set, will track flood.max until it is.)
665678

666679
**Note:** An alternative to `region denyf *`, setting `flood.max.unscoped` to a lower value such as `3` would allow for local unscoped messages to propagate, while preventing noisy neighbors from flooding a local region.
667680

681+
---
682+
683+
#### Limit the number of hops for an advert flood message
684+
**Usage:**
685+
- `get flood.max.advert`
686+
- `set flood.max.advert <value>`
687+
688+
**Parameters:**
689+
- `value`: Maximum flood hop count (0-64) for an advert packet
690+
691+
**Default:** `8`
668692

669693
---
670694

0 commit comments

Comments
 (0)