[PR #5285] Add support for TMPDIR in install.sh #27592

Open
opened 2026-08-05 07:08:56 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5285
Author: @gene1wood
Created: 2/9/2026
Status: 🔄 Open

Base: mainHead: support-tmpdir


📝 Commits (10+)

  • 5eacc49 Add support for TMPDIR in install.sh
  • 47ad132 Set OS_TYPE strings to constants in install.sh
  • 0831637 Remove If-Modified-Since from install.sh for DNS fallback
  • ce24863 Fix bare word LINUX and DARWIN variables in install.sh
  • 0b7517e Fix bare word LINUX and DARWIN variables in install.sh
  • 0f41db4 Create APP_TYPE variable in download_release_binary
  • 183defb Curl set downloaded file time to match the remote time
  • a122619 Disable Sonar for shelldre:S7688
  • 04d00f3 Fix the NOSONAR syntax
  • 3f6364e Fix the NOSONAR syntax

📊 Changes

1 file changed (+18 additions, -16 deletions)

View changed files

📝 release_files/install.sh (+18 -16)

📄 Description

Describe your changes

  • Adds support for the POSIX TMPDIR standard in install.sh which enables the user to indicate their temporary directory with the TMPDIR environment variable. If no TMPDIR value is set, the installer falls back to the original behavior of using /tmp.
  • Adds caching if the installation package is already present locally and the remote package is not newer. This would prevent re-downloading the same release package file if the newest package is already present.
  • Expands the curl arguments for these package downloads from their single character version (e.g. -L) to the full version (e.g. --location) for greater clarity.
  • Disable the curl progress meter when fetching the binary package. This matches the curl behavior when downloading the MacOS package and keeps the installer output clean.
  • Remove the deletion of /tmp/netbird.pkg for MacOS installations. This leaves it to the OS to manage keeping the /tmp directory clean and matches the behavior when downloading binary packages to /tmp. This also makes caching of packages possible by retaining the downloaded package.

Fixes #5284

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Summary by CodeRabbit

  • Bug Fixes

    • Installer now respects configured temporary directories (avoids hard-coded /tmp) and improves OS detection for more reliable platform-specific installs.
  • Improvements

    • Installer supports specifying application type for correct binary naming, selection, and UI install flow.
    • Replaced ad-hoc OS checks with stable OS-type constants and clarified, type-aware install logs and download behavior.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5285 **Author:** [@gene1wood](https://github.com/gene1wood) **Created:** 2/9/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `support-tmpdir` --- ### 📝 Commits (10+) - [`5eacc49`](https://github.com/netbirdio/netbird/commit/5eacc49cbc34081bc458eb2ca0f1105ff37519c8) Add support for TMPDIR in install.sh - [`47ad132`](https://github.com/netbirdio/netbird/commit/47ad132654a7336518383a0148549745ea0a2faf) Set OS_TYPE strings to constants in install.sh - [`0831637`](https://github.com/netbirdio/netbird/commit/083163785590c730fe8a153d870dfa2ae02baf47) Remove If-Modified-Since from install.sh for DNS fallback - [`ce24863`](https://github.com/netbirdio/netbird/commit/ce24863ed9bc2e8f2f340c0a5b2857a1ec82c224) Fix bare word LINUX and DARWIN variables in install.sh - [`0b7517e`](https://github.com/netbirdio/netbird/commit/0b7517e61a51a47301a13f299643b951bd8eb2b2) Fix bare word LINUX and DARWIN variables in install.sh - [`0f41db4`](https://github.com/netbirdio/netbird/commit/0f41db4af10cb76f597783546d425f04e8eccf14) Create APP_TYPE variable in download_release_binary - [`183defb`](https://github.com/netbirdio/netbird/commit/183defbe48b0d3fbd4ad5be83d48430dbfeb1285) Curl set downloaded file time to match the remote time - [`a122619`](https://github.com/netbirdio/netbird/commit/a1226190f321fda28d657b6449be7ebb8485e83a) Disable Sonar for shelldre:S7688 - [`04d00f3`](https://github.com/netbirdio/netbird/commit/04d00f37ecf7c7068899f714c4c77370fcb62e24) Fix the NOSONAR syntax - [`3f6364e`](https://github.com/netbirdio/netbird/commit/3f6364e7f65f259f3b1916d9f367d0795eee7f21) Fix the NOSONAR syntax ### 📊 Changes **1 file changed** (+18 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `release_files/install.sh` (+18 -16) </details> ### 📄 Description ## Describe your changes * Adds support for the POSIX TMPDIR standard in `install.sh` which enables the user to indicate their temporary directory with the TMPDIR environment variable. If no TMPDIR value is set, the installer falls back to the original behavior of using `/tmp`. * Adds caching if the installation package is already present locally and the remote package is not newer. This would prevent re-downloading the same release package file if the newest package is already present. * Expands the curl arguments for these package downloads from their single character version (e.g. -L) to the full version (e.g. --location) for greater clarity. * Disable the curl progress meter when fetching the binary package. This matches the curl behavior when downloading the MacOS package and keeps the installer output clean. * Remove the deletion of `/tmp/netbird.pkg` for MacOS installations. This leaves it to the OS to manage keeping the `/tmp` directory clean and matches the behavior when downloading binary packages to `/tmp`. This also makes caching of packages possible by retaining the downloaded package. ## Issue ticket number and link Fixes #5284 ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Installer now respects configured temporary directories (avoids hard-coded /tmp) and improves OS detection for more reliable platform-specific installs. * **Improvements** * Installer supports specifying application type for correct binary naming, selection, and UI install flow. * Replaced ad-hoc OS checks with stable OS-type constants and clarified, type-aware install logs and download behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:08:56 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#27592