-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
OpenThread Border Router #13536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+181
−0
Merged
OpenThread Border Router #13536
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| #!/usr/bin/env bash | ||
| source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) | ||
|
|
||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: MickLesk (CanbiZ) | ||
| # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | ||
| # Source: https://openthread.io/guides/border-router | ||
|
|
||
| APP="OpenThread-BR" | ||
| var_tags="${var_tags:-thread;iot;border-router;matter}" | ||
| var_cpu="${var_cpu:-2}" | ||
| var_ram="${var_ram:-2048}" | ||
| var_disk="${var_disk:-4}" | ||
| var_os="${var_os:-debian}" | ||
| var_version="${var_version:-13}" | ||
| var_unprivileged="${var_unprivileged:-0}" | ||
| var_tun="${var_tun:-yes}" | ||
|
|
||
| header_info "$APP" | ||
| variables | ||
| color | ||
| catch_errors | ||
|
|
||
| function update_script() { | ||
| header_info | ||
| check_container_storage | ||
| check_container_resources | ||
|
|
||
| if [[ ! -d /opt/ot-br-posix ]]; then | ||
| msg_error "No ${APP} Installation Found!" | ||
| exit | ||
| fi | ||
|
|
||
| cd /opt/ot-br-posix | ||
| LOCAL_COMMIT=$(git rev-parse HEAD) | ||
| $STD git fetch --depth 1 origin main | ||
| REMOTE_COMMIT=$(git rev-parse origin/main) | ||
|
|
||
| if [[ "${LOCAL_COMMIT}" == "${REMOTE_COMMIT}" ]]; then | ||
| msg_ok "Already up to date (${LOCAL_COMMIT:0:7})" | ||
| exit | ||
| fi | ||
|
|
||
| msg_info "Stopping Services" | ||
| systemctl stop otbr-web | ||
| systemctl stop otbr-agent | ||
| msg_ok "Stopped Services" | ||
|
|
||
| msg_info "Updating Source" | ||
| $STD git reset --hard origin/main | ||
| $STD git submodule update --depth 1 --init --recursive | ||
| msg_ok "Updated Source" | ||
|
|
||
| msg_info "Rebuilding OpenThread Border Router (Patience)" | ||
| cd /opt/ot-br-posix/build | ||
| $STD cmake -GNinja \ | ||
| -DBUILD_TESTING=OFF \ | ||
| -DCMAKE_INSTALL_PREFIX=/usr \ | ||
| -DOTBR_DBUS=ON \ | ||
| -DOTBR_MDNS=openthread \ | ||
| -DOTBR_REST=ON \ | ||
| -DOTBR_WEB=ON \ | ||
| -DOTBR_BORDER_ROUTING=ON \ | ||
| -DOTBR_BACKBONE_ROUTER=ON \ | ||
| -DOT_FIREWALL=ON \ | ||
| -DOT_POSIX_NAT64_CIDR="192.168.255.0/24" \ | ||
| .. | ||
| $STD ninja | ||
| $STD ninja install | ||
| msg_ok "Rebuilt OpenThread Border Router" | ||
|
|
||
| msg_info "Starting Services" | ||
| systemctl start otbr-agent | ||
| systemctl start otbr-web | ||
| msg_ok "Started Services" | ||
| msg_ok "Updated successfully!" | ||
| exit | ||
| } | ||
|
|
||
| start | ||
| build_container | ||
| description | ||
|
|
||
| msg_ok "Completed Successfully!\n" | ||
| echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" | ||
| echo -e "${INFO}${YW} Access it using the following URL:${CL}" | ||
| echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: MickLesk (CanbiZ) | ||
| # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | ||
| # Source: https://openthread.io/guides/border-router | ||
|
|
||
| source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" | ||
| color | ||
| verb_ip6 | ||
| catch_errors | ||
| setting_up_container | ||
| network_check | ||
| update_os | ||
|
|
||
| msg_info "Installing Dependencies" | ||
| $STD apt install -y \ | ||
| build-essential \ | ||
| cmake \ | ||
| ninja-build \ | ||
| pkg-config \ | ||
| git \ | ||
| iproute2 \ | ||
| libreadline-dev \ | ||
| libncurses-dev \ | ||
| rsyslog \ | ||
| dbus \ | ||
| libdbus-1-dev \ | ||
| libjsoncpp-dev \ | ||
| iptables \ | ||
| ipset \ | ||
| bind9 \ | ||
| libnetfilter-queue1 \ | ||
| libnetfilter-queue-dev \ | ||
| libprotobuf-dev \ | ||
| protobuf-compiler \ | ||
| socat | ||
| msg_ok "Installed Dependencies" | ||
|
|
||
| setup_nodejs | ||
|
|
||
| msg_info "Cloning OpenThread Border Router" | ||
| # git clone is needed to fetch submodules, fetch_and_deploy_gh_release doesn't support this. We use --depth 1 to minimize the amount of data cloned, but it still may take a while. | ||
| $STD git clone --depth 1 https://github.com/openthread/ot-br-posix /opt/ot-br-posix | ||
| cd /opt/ot-br-posix | ||
| $STD git submodule update --depth 1 --init --recursive | ||
| msg_ok "Cloned OpenThread Border Router" | ||
|
|
||
| msg_info "Building OpenThread Border Router (Patience)" | ||
| mkdir -p build && cd build | ||
| $STD cmake -GNinja \ | ||
| -DBUILD_TESTING=OFF \ | ||
| -DCMAKE_INSTALL_PREFIX=/usr \ | ||
| -DOTBR_DBUS=ON \ | ||
| -DOTBR_MDNS=openthread \ | ||
| -DOTBR_REST=ON \ | ||
| -DOTBR_WEB=ON \ | ||
| -DOTBR_BORDER_ROUTING=ON \ | ||
| -DOTBR_BACKBONE_ROUTER=ON \ | ||
| -DOT_FIREWALL=ON \ | ||
| -DOT_POSIX_NAT64_CIDR="192.168.255.0/24" \ | ||
| .. | ||
| $STD ninja | ||
| $STD ninja install | ||
| msg_ok "Built OpenThread Border Router" | ||
|
|
||
| msg_info "Configuring Network" | ||
| cat <<EOF >/etc/sysctl.d/99-otbr.conf | ||
| net.ipv6.conf.all.forwarding=1 | ||
| net.ipv4.ip_forward=1 | ||
| EOF | ||
| $STD sysctl -p /etc/sysctl.d/99-otbr.conf | ||
| msg_ok "Configured Network" | ||
|
|
||
| msg_info "Configuring Services" | ||
| cat <<'EOF' >/etc/default/otbr-agent | ||
| # USB example: | ||
| # OTBR_AGENT_OPTS="-I wpan0 -B eth0 --vendor-name OpenThread --model-name BorderRouter --rest-listen-address 0.0.0.0 --rest-listen-port 8081 spinel+hdlc+uart:///dev/ttyACM0" | ||
| # TCP via socat (for network-attached RCP like SLZB-06/SLZB-MR3): | ||
|
|
||
| # OTBR_AGENT_OPTS="-I wpan0 -B eth0 --vendor-name OpenThread --model-name BorderRouter --rest-listen-address 0.0.0.0 --rest-listen-port 8081 spinel+hdlc+forkpty:///usr/bin/socat?forkpty-arg=-,rawer&forkpty-arg=tcp:IP:PORT trel://eth0" | ||
| OTBR_AGENT_OPTS="-I wpan0 -B eth0 --vendor-name OpenThread --model-name BorderRouter --rest-listen-address 0.0.0.0 --rest-listen-port 8081 spinel+hdlc+uart:///dev/ttyACM0" | ||
| EOF | ||
| cat <<'EOF' >/etc/default/otbr-web | ||
| OTBR_WEB_OPTS="-I wpan0 -a 0.0.0.0 -p 80" | ||
| EOF | ||
| systemctl enable -q dbus rsyslog otbr-agent otbr-web | ||
| systemctl enable -q bind9 2>/dev/null || systemctl enable -q named 2>/dev/null || true | ||
| systemctl start -q dbus rsyslog bind9 | ||
| msg_ok "Configured Services" | ||
|
|
||
| motd_ssh | ||
| customize | ||
| cleanup_lxc |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github source missing for version flow
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was only needed for migration to pocketbase. we dont use the action atm and the tool doesnt have versions ^^