Skip to content

Support Ubuntu 24.04 and harden TacticalRMM install/update scripts#2463

Open
cengbrecht wants to merge 6 commits into
amidaware:developfrom
cengbrecht:develop
Open

Support Ubuntu 24.04 and harden TacticalRMM install/update scripts#2463
cengbrecht wants to merge 6 commits into
amidaware:developfrom
cengbrecht:develop

Conversation

@cengbrecht

Copy link
Copy Markdown

This PR updates install.sh and update.sh to add Ubuntu 24.04 support and harden several fragile script behaviors.

Highlights

  • allow Ubuntu 24.04 in both installer and updater
  • add strict shell error handling and line-aware error reporting
  • replace fragile shell-state assumptions with explicit validation
  • remove updater dependence on activate / deactivate by using explicit venv binary paths
  • replace fragile $GROUP usage with the caller's actual primary group
  • improve repo/key handling, grep checks, directory creation, and idempotency
  • add better support for pre-seeded install inputs and Cloudflare DNS API cert flow
  • validate Python 3.11, venv binaries, WEB_VERSION, and WEBTAR_URL before continuing

Scope

These changes are intended to preserve the existing TacticalRMM install/update flow while improving:

  • Ubuntu 24.04 compatibility
  • script robustness
  • automation friendliness
  • repeatability

- allow Ubuntu 24.04 in OS validation alongside existing supported releases
- add strict shell error handling with ERR trap and optional trace mode
- switch package install/update commands to apt-get and add qrencode plus
  python3-certbot-dns-cloudflare dependencies
- make random secret generation compatible with pipefail by temporarily
  disabling it around urandom pipelines
- support pre-seeded environment variables for domains, email, Django
  credentials, and Cloudflare token to improve automation
- add Cloudflare DNS API wildcard certificate flow while preserving manual
  DNS, insecure, and BYO certificate modes
- strengthen hosts-file detection and initialization logic
- improve self-signed certificate setup with safer quoting and clearer mode
  messaging
- make /rmm cloning safer by cloning to a temp directory first and refusing
  to continue if /rmm already contains unexpected content
- install Python build prerequisites including python3-venv and python3-pip
- switch venv creation and package management to explicit Python, pip, and
  manage.py paths instead of relying on shell activation
- validate the expected Python 3.11 binary before creating the virtual
  environment
- support noninteractive Django superuser creation when password is supplied
- make post-install pause optional with TRMM_AUTO_CONTINUE
- replace fragile $GROUP usage with the user's actual primary group
- harden MeshCentral readiness loops and related status initialization
- add WEB_VERSION and WEBTAR_URL validation before frontend deployment
- preserve existing TacticalRMM install flow while improving Ubuntu 24.04
  compatibility, repeatability, and script robustness
- allow Ubuntu 24.04 in OS validation alongside existing supported releases
- add strict shell error handling with ERR trap and optional trace mode
- add shared print helpers for consistent error, warning, and status output
- harden self-update execution by preserving original script arguments
- validate the install user lookup from rmm.service before continuing
- capture the caller's primary group and replace fragile $GROUP usage
- prepare and refresh nginx repo key material before apt-get update
- switch package management commands to apt-get for consistency with the
  hardened installer flow
- make optional grep-based checks safe under strict mode by treating missing
  matches as empty state instead of fatal errors
- normalize service-file repair logic for nats and preserve Group=${USER}
  ownership consistency
- update weasyprint dependency checks to use dpkg -s instead of line-count
  matching
- validate supported Debian and Ubuntu releases before continuing the update
- replace python3.11 shell activation usage with explicit Python, pip, celery,
  and manage.py paths
- remove activate/deactivate dependency from the updater and operate directly
  on the virtual environment binaries
- validate the expected Python 3.11 binary before rebuilding the virtual
  environment
- install python3-venv and python3-pip when rebuilding Python toolchain
- make /etc/letsencrypt ownership correction conditional on the directory
  existing
- harden nginx config patching and file checks with safer quoting
- standardize npm detection with command -v and align NodeSource fallback with
  the keyring-based repository method used by the installer
- make host-file detection safe when expected entries are absent
- validate WEB_VERSION and WEBTAR_URL before frontend deployment
- use mkdir -p for reporting schema/assets directory creation to keep updates
  idempotent
- add explicit validation for virtual environment python and pip binaries
  before running package installs or management commands
- preserve existing TacticalRMM update flow while improving Ubuntu 24.04
  compatibility, repeatability, and script robustness
Incremented version to 159
@CLAassistant

CLAassistant commented Apr 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cengbrecht

cengbrecht commented Apr 23, 2026

Copy link
Copy Markdown
Author

This is my first "real" public commit.
The install for Ubuntu 24.04 does work and is stable in my testing environment. However, I am new to TacticalRMM/GitHub commits overall and would love feedback about this commit.

This commit also enables Cloudflare DNS Cert Renewal.
This workflow was tested with the options to not pre-populate any variables, and it worked quite well.
The Cloudflare DNS renewal does require that variables be populated on install launch.

I have included the instructions for that as a separate file, as I did not know where best to put them in line.

When export is used, it is cleared after the run uses it.

export djangopassword='adminportalpassword'
Cloudflare_token='cloudflaretoken'
rmmdomain='api.example.com'
frontenddomain='rmm.example.com'
meshdomain='mesh.example.com'
rootdomain='example.com'
letsemail='username@example.com'
djangousername='sysadmin'
./install.sh

It also enables silent installation via the variables listed.
There is also a new CHECK_MESH_READY, and CHECK_MESH_READY2 variable to prevent runaway loops.

- allow Ubuntu 24.04 in OS validation alongside existing supported releases
- add strict shell error handling with ERR trap and optional trace mode
- add shared print helpers for consistent status and error output
- validate supported Debian and Ubuntu releases before continuing
- capture the caller's primary group and replace fragile ${USER}:${USER}
  ownership assumptions
- validate the expected TacticalRMM Python binary before reading runtime
  configuration
- validate the expected local_settings.py file before backup operations
- switch jq detection to command -v and install it with apt-get only when
  needed for MeshCentral postgres-backed configuration parsing
- replace mixed mkdir usage with mkdir -p for idempotent backup staging and
  backup directory creation
- add safer quoting for paths, filenames, and copied certificate/config files
- preserve standalone backup behavior while ensuring /rmmbackups exists and
  ownership is corrected before archive creation
- preserve scheduled backup behavior while simplifying backup directory
  creation and ownership assignment
- keep daily, weekly, and monthly rotation behavior intact while hardening the
  archive creation paths
- preserve existing TacticalRMM backup flow while improving Ubuntu 24.04
  compatibility, repeatability, and script robustness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants