Commit Graph

123 Commits

Author SHA1 Message Date
rcourtman f9b8037486 fix: resolve install script unbound variables and add update command
Addresses #450, #451, #406

- Initialize all variables at top of script to prevent "unbound variable" errors with set -u
  - BUILD_FROM_SOURCE, SKIP_DOWNLOAD, IN_CONTAINER, IN_DOCKER now set at line 20-27
  - ENABLE_AUTO_UPDATES, FORCE_VERSION, FORCE_CHANNEL, SOURCE_BRANCH also moved to top
  - Removed duplicate assignments from argument parsing section

- Restore /bin/update command creation for ProxmoxVE LXC installations
  - Creates update script that re-runs install.sh for easy updates
  - Allows backend to properly detect ProxmoxVE deployment type
  - Users can now run "update" in LXC console as documented

- Update deployment detection to recognize install.sh in update command
  - Previously only looked for legacy "pulse.sh" reference
  - Now checks for both pulse.sh and install.sh
2025-09-30 16:16:10 +00:00
Pulse Monitor 347aa9e6d6 fix: add missing SKIP_DOWNLOAD initialization
Addresses #459 #461 - Consolidates variable initialization at the top
of the script alongside other defaults. Removes redundant BUILD_FROM_SOURCE
initialization from argument parsing section.
2025-09-30 10:50:59 +00:00
rcourtman 8910e1e379 Fix installer defaults, auth fallbacks, alert persistence, and docs helper 2025-09-29 16:36:33 +00:00
Pulse Monitor 1f115897c7 fix: use correct binary path after build
The Makefile builds to ./pulse not bin/pulse. Updated the install script
to copy from the correct location.
2025-09-11 16:42:17 +00:00
Pulse Monitor 63f51984aa fix: export Go path before building from source
The build was failing because Go wasn't in PATH after installation. Now
exports PATH=/usr/local/go/bin:/home/pulse/.local/bin:/home/pulse/.local/bin:/home/pulse/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games before running make build.
2025-09-11 16:39:15 +00:00
Pulse Monitor cc75318340 fix: install npm dependencies before building from source
The build was failing because npm packages weren't installed. Now runs
npm install in frontend-modern directory before running make build.
2025-09-11 16:36:52 +00:00
Pulse Monitor 688627756c fix: inline Go installation code to fix undefined install_go function
The --main flag was calling install_go which didn't exist. Now properly
installs Go 1.23 when needed during source builds.
2025-09-11 16:31:17 +00:00
Pulse Monitor b3c5343f8c fix: handle --main flag properly for existing installations (addresses #448)
The install script now correctly builds from source when --main is specified,
even if Pulse is already installed. Previously it would go into the update
prompt instead of building from source.
2025-09-11 16:29:42 +00:00
Pulse Monitor cdbb92f01c fix: correct binary path when building from source
The Makefile builds to 'pulse' not 'bin/pulse', updated the install
script to copy from the correct location.
2025-09-11 15:41:01 +00:00
Pulse Monitor d203a746e8 fix: install Go 1.23 when building from source if system Go is too old
- Checks if system Go version meets minimum requirement (1.21+)
- Downloads and installs Go 1.23 from official releases if needed
- Supports amd64, arm64, and armv6l architectures
- Ensures Go is in PATH for the build process

This fixes build failures on Debian 12 which ships with Go 1.19
2025-09-11 15:35:03 +00:00
Pulse Monitor 8db2ab264a fix: handle missing argument for --main option
Fixed 'unbound variable' error when using --main without additional arguments.
Added check for argument count before accessing $2.
2025-09-11 15:20:39 +00:00
Pulse Monitor 2bc834de70 improve: add --main as primary option for building from source
- --main is now the primary option (clearer intent)
- --source, --from-source, --branch remain as aliases
- Help text shows --main first for better discoverability

Usage: curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --main
2025-09-11 15:16:40 +00:00
Pulse Monitor b45220600b feat: add --source option to install script for building from source
- Added --source, --from-source, and --branch options (all equivalent)
- Allows building and installing Pulse from source code
- Optional branch parameter (defaults to main)
- Builds frontend and backend locally before installing
- Removes separate install-from-main.sh script - integrated into main script

Usage:
  curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --source
  curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --source develop
2025-09-11 15:15:27 +00:00
Pulse Monitor 71697f63bf fix: preserve config files during reinstalls to prevent threshold loss (addresses #429)
- Modified install.sh to avoid recursive chown on /etc/pulse during reinstalls
- This prevents custom thresholds in alerts.json from being lost during updates
- Only changes directory ownership, not existing file permissions
- Explicitly preserves permissions on critical config files
2025-09-10 20:54:07 +00:00
Pulse Monitor c668ac9c48 feat: add ~/.pulse marker file for Community Scripts compatibility
- Creates ~/.pulse marker file after successful install/update
- Addresses vhsdream's request in PR #7519
- Helps Community Scripts track that Pulse has been installed
- Improves compatibility between installation methods
2025-09-10 13:09:41 +00:00
Pulse Monitor 8bf06ee683 refactor: remove update command creation to avoid conflicts with Community Scripts
- Native installations no longer create /usr/local/bin/update
- Avoids conflicts with Community Scripts /bin/update command
- Community installations keep their update mechanism
- Native installations use: curl -fsSL ... | bash for updates
- Each installation method respects the other's update approach
2025-09-10 13:03:42 +00:00
Pulse Monitor d84fe5971a fix: handle fresh PVE installations without VMs in installer (addresses #422)
The installer would exit abruptly on fresh Proxmox installations without any VMs due to commands failing with set -e enabled. Now wrapped the ID collection section with set +e/set -e to allow graceful handling of these cases.
2025-09-05 17:33:36 +00:00
Pulse Monitor e3a9c4a460 fix: improve binary replacement reliability during updates (addresses #406)
- Add backup/restore mechanism for old binary during updates
- Add explicit error checking for binary copy operations
- Add version verification after installation to detect issues
- Force retry if version mismatch detected after update
- Ensure old binary is properly replaced, not just overwritten

This should resolve issues where updates appear to complete but the old version continues to run, particularly when the binary replacement fails silently.
2025-09-01 22:59:32 +00:00
Pulse Monitor 99139a20c6 fix: improve install script reliability in unprivileged containers (addresses #386)
- Add timeout command wrapper around all curl calls to prevent hanging
- Add multiple fallback mechanisms for GitHub API failures
- Use fallback to known stable version if all methods fail
- Add proper timeouts to prevent indefinite waiting
- Improve error handling to proceed when version verification fails

The script now handles network issues, rate limiting, and container
restrictions more gracefully, ensuring installation completes even
in restricted environments.
2025-08-31 20:34:09 +00:00
Pulse Monitor ce8cf0b824 improve: clarify CIDR notation requirement in installer IP prompt
addresses #392 - make it clear that static IP should include CIDR notation
2025-08-30 22:44:29 +00:00
Pulse Monitor 6ba52fde24 fix: duplicate auto-update prompt when answering No (addresses #391)
- Set ENABLE_AUTO_UPDATES global variable when user responds in select_install_mode
- Only ask about auto-updates once during installation
- Fixed issue where answering No to auto-updates would prompt again later
2025-08-30 17:00:43 +00:00
Pulse Monitor 115e19fad8 feat: add optional VLAN support to installer (addresses #392)
- Added optional VLAN ID prompt in both Quick and Advanced modes
- Regular users can just press Enter to skip VLAN configuration
- Validates VLAN ID range (1-4094)
- Adds tag parameter to network config when VLAN is specified
- Defaults to no VLAN, ensuring regular users aren't affected
2025-08-30 16:37:38 +00:00
Pulse Monitor 1d083c0280 fix: restore port prompt in Quick installation mode
The Quick installation mode was no longer asking for the port number,
just using the default 7655. This regression was introduced when
the duplicate main function was removed.

Restored the port prompt to Quick mode so users can specify a custom
port if needed, matching the original behavior.
2025-08-30 16:29:50 +00:00
Pulse Monitor cbef650e83 fix: remove duplicate main function in install script (fixes #391)
The install script had a duplicate mainmain() function that was causing
the installation to run twice. This resulted in:
- Double prompts for auto-updates configuration
- Confusing installation output with duplicate headers
- The script appearing to reinstall after initial installation

Removed the duplicate function (lines 2025-2467) and fixed the script
to run only once as intended.

Tested on fresh Debian 12 LXC container - confirmed single installation
with working web UI on port 7655.
2025-08-30 16:07:28 +00:00
Pulse Monitor cc0c28ce26 fix: handle unbound container variable in install script (fixes #390)
The install script was failing with "container: unbound variable" error
when run with set -u. Fixed by using ${container:-} to provide a default
empty value when the variable is not set.
2025-08-30 13:56:19 +00:00
Pulse Monitor 587ffd2be8 feat: install jq in containers for better JSON handling
- Containers created by the script now get jq installed
- Makes auto-update config more reliable
- Keeps JSON properly formatted
- Falls back gracefully if jq can't be installed
- Only affects fresh installs in containers, not existing systems
2025-08-30 08:03:05 +00:00
Pulse Monitor 89ad7a3261 feat: re-ask about auto-updates for users with misconfigured settings
- Detects when auto-updates are disabled despite timer being installed
- Shows 'Auto-updates are currently disabled' message to be clear
- Offers to enable auto-updates during any update/reinstall operation
- Works with --version flag, regular updates, and reinstalls
- Helps users who had the broken config from before the sed fix
2025-08-30 07:37:54 +00:00
Pulse Monitor bf30655a81 fix: auto-update setup properly sets config when jq not installed
- Fixed sed fallback in setup_auto_updates to correctly update existing autoUpdateEnabled field
- Improved Docker detection with multiple methods for better reliability
- Auto-updates now work correctly in LXC containers when enabled
2025-08-30 07:26:10 +00:00
Pulse Monitor fdb0453a42 fix: actually prompt for auto-updates in container installation
- Add auto-updates prompt to Quick mode (not just Advanced)
- Remove 'local' keyword so the flag variable is accessible later
- Previously the prompt appeared but the choice wasn't being passed through
2025-08-29 20:40:57 +00:00
Pulse Monitor 510fdeebd5 fix: ensure auto-updates prompt appears during container installation
- Add auto-updates prompt to Proxmox container creation flow
- Pass the choice to container via --enable-auto-updates flag
- Previously the prompt was skipped entirely for container installs
2025-08-29 20:12:28 +00:00
Pulse Monitor 2c0dfbe30a fix: prevent install script hanging in unprivileged containers
- Add safe_systemctl wrapper with 5-second timeout for systemctl commands
- Handle systemctl daemon-reload hanging in unprivileged LXC containers
- Provide clear messaging when systemctl fails (common in unprivileged mode)
- Installation continues successfully even when systemctl operations fail

This addresses #386 where the install script would hang indefinitely
in unprivileged containers due to systemctl daemon-reload never completing.
2025-08-29 19:51:41 +00:00
Pulse Monitor 6ea64c2bf5 fix: ask for space-separated DNS servers instead of converting
Simpler to just ask users to enter DNS servers space-separated
(the format Proxmox expects) rather than converting from commas
2025-08-29 18:53:48 +00:00
Pulse Monitor f4729890af fix: convert comma-separated DNS to space-separated for pct
The install script asks for comma-separated DNS servers but Proxmox expects
space-separated. Now properly converts the format before passing to pct create.
2025-08-29 18:53:08 +00:00
Pulse Monitor 85f679e313 fix: correct template selection in install script
The script was incorrectly prefixing storage name twice when listing templates,
resulting in ISOs:ISOs:vztmpl/... format instead of ISOs:vztmpl/...
This caused template existence checks to fail and always trigger downloads.

addresses #381
2025-08-29 18:17:38 +00:00
Pulse Monitor 914915b820 fix: make installation mode prompt wait for Enter key
- Changed mode selection to require Enter instead of single character
- Makes behavior consistent with other prompts
- Less jarring user experience
2025-08-29 17:45:17 +00:00
Pulse Monitor d814c8a021 fix: restore missing main function and improve container installation
- Restored accidentally deleted main() function
- Fixed script not running at all due to missing main call
- Added IN_CONTAINER checks to skip prompts in container context
- Fixed network bridge detection parsing issue
- Script now completes installation properly without hanging
2025-08-29 17:43:14 +00:00
Pulse Monitor ad9891f6a2 fix: prevent install script from exiting when Enter pressed at prompts
- Add safe_read_with_default wrapper to handle read failures gracefully
- Update all prompts to use the wrapper with appropriate defaults
- Script now continues with defaults instead of exiting on Enter key
- Addresses issue #383 installation problems
2025-08-29 17:23:40 +00:00
Pulse Monitor e3a47c0ef4 feat: improve install UX with numbered options for network and storage selection
- Users can now select bridges and storage by number (1, 2, 3, etc.)
- Much easier than typing out storage names like 'local-lvm'
- Shows default option in brackets [1]
- Still allows typing the name directly if preferred
- Works in both Quick and Advanced modes
- Improves installation experience significantly
2025-08-29 17:16:04 +00:00
Pulse Monitor 10a2e1fc35 fix: handle safe_read failures with set -e enabled
- Temporarily disable errexit when calling safe_read
- Prevents script from exiting when safe_read returns 1
- Properly handles non-interactive container installations
- Addresses #383
2025-08-29 17:05:20 +00:00
Pulse Monitor 2dc9cff782 fix: handle non-interactive mode in container installations
- Fix safe_read failures when running --in-container without TTY
- Use defaults when prompts fail in non-interactive mode
- Prevents hanging when pct exec runs install script
- Addresses #383
2025-08-29 17:03:55 +00:00
Pulse Monitor 3b09455e71 fix: show real-time progress during container installation
- Show installation output in real-time instead of capturing silently
- Users can now see what's happening during download/install
- Still includes 5-minute timeout to prevent infinite hangs
- Better error messages with manual recovery instructions
- Addresses #383 - users can now see where installation gets stuck
2025-08-29 16:58:08 +00:00
Pulse Monitor 13d586fb03 fix: add timeouts to prevent installation hanging on network issues
- Add timeout to GitHub API calls when fetching releases
- Add timeout to wget when downloading release files
- Add timeout to container installation with better error messages
- Show helpful error messages when timeouts occur
- Addresses #383 - installation getting stuck
2025-08-29 16:52:08 +00:00
Pulse Monitor abc1a9cd1c fix: prompt for gateway when static IP is entered in advanced mode
addresses #382 - installer now prompts for gateway IP when user enters a static IP.
validates IP is in CIDR format (e.g., 192.168.1.100/24) and gateway is valid.
if no gateway is provided, attempts to use .1 of the subnet as default.
this fixes the 'waiting for network' timeout when using static IPs.
2025-08-29 15:58:27 +00:00
Pulse Monitor dbdc788f06 fix: detect and use all available template storages for Proxmox installations
addresses #381 - installer now searches all storages that can contain templates
instead of assuming templates are in the same storage as the container rootfs.
when downloading templates, it uses the storage with the most free space.
2025-08-29 15:49:56 +00:00
Pulse Monitor 2465fab7fc fix: ensure PATH and update command work for all installations
- Created setup_update_command() function to handle PATH and update script setup
- Adds /usr/local/bin to PATH in /etc/profile and /etc/bash.bashrc
- Creates /usr/local/bin/update script if it doesn't exist
- Called during all installation/update flows (fresh, update, reinstall)
- Fixes issue where existing users couldn't run 'update' command without full path
- Addresses #377
2025-08-29 07:59:03 +00:00
Pulse Monitor 4466990058 fix: add /usr/local/bin to PATH in containers so 'update' command works
This addresses #377 where users couldn't run the 'update' command
without specifying the full path when using pct enter.
2025-08-29 07:55:11 +00:00
Pulse Monitor 90e56241d1 fix: support non-local storage for templates in install.sh (addresses #368)
- Use selected storage instead of hardcoded 'local' for template listing
- Use storage:vztmpl/template format instead of hardcoded paths
- Downloads now go to the selected storage (btrfs, zfs, etc.)
- Check template existence using pveam list with correct storage
2025-08-28 14:07:09 +00:00
Pulse Monitor 06c99ce88b fix: make install script interactive when piped from curl
- Modified safe_read to properly detect when no TTY is available
- Returns failure status when truly non-interactive (no /dev/tty)
- Only auto-selects update when safe_read actually fails
- Now curl | bash will show the interactive menu if terminal is available
2025-08-28 13:48:56 +00:00
Pulse Monitor d0dae51e34 fix: detect fresh installs correctly for auto-update prompts
The script was checking if CONFIG_DIR existed to detect fresh installs, but we create that directory early in the process. Now checking for system.json file instead which only exists after a real installation.
2025-08-28 08:10:25 +00:00
Pulse Monitor f407137d62 fix: enable auto-update prompts for LXC containers
LXC containers are full Linux systems with systemd and can handle auto-updates perfectly fine. Only Docker containers should skip auto-update prompts since they're immutable and can't restart themselves.

- Separated IN_DOCKER flag from IN_CONTAINER
- LXC containers now get auto-update prompts like bare metal installs
- Docker containers still skip auto-updates as intended
2025-08-28 08:07:20 +00:00