Commit Graph

27 Commits

Author SHA1 Message Date
Pujit Mehrotra
441e1805c1 fix: replace myservers.cfg reads in UpdateFlashBackup.php (#1517)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added a new method for verifying user sign-in status using a dedicated
configuration handler.
* Introduced a class to manage connection configuration and status
checks.

* **Refactor**
* Updated logic for checking connection and registration status to use
new configuration handling methods for improved clarity and reliability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-15 10:30:04 -04:00
Pujit Mehrotra
29dcb7d0f0 fix: rm short-circuit in rc.unraid-api if plugin config dir is absent (#1515)
This short-circuit causes any/all `rc.unraid-api` invocations to
immediately fail on fresh 7.2 images (because
`/boot/config/dynamix.my.servers` doesn't exist).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Removed initial checks and setup for a plugin directory and default
environment file in the startup script.
* Simplified environment switching with streamlined commands and
improved error handling.
* Removed deprecated environment path references and updated related
tests.
* **Documentation**
* Added descriptive comments clarifying build and environment settings.
* **Tests**
* Updated test cases by removing assertions related to deprecated
environment paths.
* **Maintenance**
  * Updated timestamp fixtures for consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-15 09:48:12 -04:00
Pujit Mehrotra
038c582aed fix: flash backup integration with Unraid Connect config (#1448)
read `username` from connect.json & drop minigraphConnected check

---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1210592838407162

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved reliability of configuration file handling for backup and API
features.
* Resolved potential false negatives when checking connection status by
updating connection verification logic.

* **Chores**
  * Centralized configuration paths for easier future updates.
  * Minor formatting improvements for better readability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 10:09:58 -04:00
Pujit Mehrotra
d9ab58eb83 chore: require connect plugin to enable flash backup (#1419)
## Summary by CodeRabbit

- **New Features**
- Added a check to ensure the "unraid-api-plugin-connect" plugin is
enabled before allowing flash backup functionality.
- Introduced a utility to directly verify if specific API plugins are
enabled.

- **Refactor**
- Updated internal logic to use a centralized class and script-based
checks for plugin status and version instead of manual config parsing.
- Improved script command-line interface for easier plugin status and
version checks.

- **Bug Fixes**
- Flash Backup feature and service now only activate when the required
API plugin is enabled, preventing unintended usage.
- Flash Backup UI is conditionally displayed based on the presence of
the API plugin.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1209357561531351
  - https://app.asana.com/0/0/1210541992642236
2025-06-18 10:20:59 -04:00
Pujit Mehrotra
184b76de1c chore: include node_modules in api slackware package (#1415)
instead of vendoring & uploading separately.

## Summary by CodeRabbit

- **Chores**
- Updated build process to retain the `node_modules` directory, removing
compression and archiving steps.
- Improved plugin installation by cleaning up outdated dependency
archives before reinstalling, enhancing system stability.
- Removed vendor store file references and related bundling steps from
the plugin build and installation process.
- Enhanced dependency restoration during service start to log warnings
without aborting on failure.
- Simplified dependency management scripts by removing vendor store URL
handling and download functionality.
- Streamlined build workflows by removing artifact upload/download and
validation steps related to node modules archives.
- Updated Docker Compose configuration to remove unused volume mounts
for node modules archives.
- Added repository cleanup commands to remove top-level `node_modules`
directories and common build artifact folders for easier maintenance.
2025-06-11 12:07:32 -04:00
Eli Bosley
83076bb940 fix: rc.unraid-api now cleans up older dependencies (#1404)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added an option to clean up old dependency files, keeping only those
needed for the current API version.
- Introduced a direct cleanup command to remove outdated dependencies
before installing new ones.

- **Bug Fixes**
- Improved handling and messaging for missing or invalid dependency
information during cleanup operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 10:23:58 -04:00
Eli Bosley
4f63b4cf3b feat: native slackware package (#1381)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added detailed versioning for plugin packages incorporating
architecture and build identifiers.
- Simplified and improved install/uninstall scripts with backup and
dynamic package detection.
- Introduced comprehensive setup, verification, patching, and cleanup
scripts for the Unraid API environment.
- Enhanced service control with explicit start, stop, restart, and
status commands.
- Added robust dependency management scripts for restoring and archiving
Node.js modules.
- Implemented vendor archive metadata storage and dynamic handling
during build and runtime.
- Added new CLI options and environment schemas for consistent build
configuration.
- Introduced new shutdown scripts to gracefully stop flash-backup and
unraid-api services.
- Added utility scripts for API version detection and vendor archive
configuration.
- Added a new package description file detailing Unraid API features and
homepage link.

- **Bug Fixes**
- Improved validation and error reporting for missing manifests,
dependencies, and configuration files.
  - Enhanced fallback logic for locating and creating vendor archives.
- Fixed iframe compatibility in UI by updating HTML and Firefox
preference files.

- **Chores**
- Updated .gitignore with generated file patterns for Node.js binaries
and archives.
  - Removed obsolete internal documentation and legacy cleanup scripts.
- Refined Docker Compose and CI workflows to pass precise API versioning
and manage build artifacts.
- Centralized common environment validation and CLI option definitions
across build tools.
- Cleaned up plugin manifest by removing Node.js and PNPM-related
entities and legacy logic.
- Improved logging and error handling in build and installation scripts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-08 22:54:10 -04:00
Pujit Mehrotra
97ab6fbe32 refactor(api): vendor node_modules instead of pnpm store (#1346)
due to issues and redundancies in vendoring postinstall side-effects, such as compiled bindings for libvirt, we reverted to vendoring `node_modules`, installed via `npm` instead of a global pnpm store generated by `pnpm`.

This should resolve runtime issues with e.g. the libvirt bindings because `node_modules` will contain the correct "side-effects."

## Summary by CodeRabbit

- **New Features**
- Introduced a command to remove stale archive files during the cleanup
process.
  - Added functionality to archive the `node_modules` directory.
- Enhanced dependency resolution with new overrides for specific
packages.

- **Chores**
- Updated dependency settings by replacing one key dependency with an
alternative and removing two unused ones, ensuring optimal deployment.
- Enhanced the installation process to operate strictly in offline mode.
- Updated artifact naming conventions for clarity and consistency in
workflows.
- Modified volume mappings in the Docker Compose configuration to
reflect new artifact names.
- Improved error handling in the GitHub Actions workflow by adding
checks for required files.
- Updated references in the build process to use a vendor store instead
of the PNPM store.
- Removed the management of PNPM store archives from the build process.
2025-04-09 15:17:50 -04:00
Pujit Mehrotra
1f10b63c8b fix(plugin): flaky masking of benign warning during pnpm install (#1313)
The masking logic has a different effect in TTY and non-TTY environments
bc pnpm will change the `install` reporter. Now, we:

- set `--reporter=append-only` for consistency
- replace the grep loop with `sed` to mask and redirect the benign
"Ignored build scripts" warning

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Streamlined the background logging during dependency installations to
improve overall efficiency and reduce complexity. This update enhances
maintainability without any visible changes to the user experience.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-03 09:20:55 -04:00
Pujit Mehrotra
7fb78494cb fix(api): redirect benign pnpm postinstall warning to log file (#1290)
which lives at `/var/log/unraid-api/build-scripts.log`
2025-03-28 13:50:41 -04:00
Pujit Mehrotra
9f492bf217 feat: api plugin system & offline versioned dependency vendoring (#1252)
- **New Features**
- Created a dynamic plugin system for the API to enable community
augmentation of GraphQL, CLI, and Cron functionalities capabilities.
- Included an example plugin under `packages/unraid-api-plugin-health`
that adds a new graphql query for API health checks.
- Added `rc.unraid-api` commands for backing up, restoring, and
installing production dependencies, streamlining maintenance and
deployment.
- Improved dependency vendoring by bundling a versioned pnpm store
(instead of `node_modules`). Versioning will allow users to add plugins
to a specific api release without requiring an internet connection on
subsequent reboots.

- **Chores**
- Upgraded build workflows and versioning processes to ensure more
reliable artifact handling and production packaging.
2025-03-27 13:23:55 -04:00
Eli Bosley
f1838bf69a fix: fix invalid path to node with sh execution (#1213)
Hoping this will resolve:
https://forums.unraid.net/topic/187498-unable-to-install-my-server-plugin/


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Improved command-line execution behavior for enhanced compatibility
across different environments.
- Enhanced the version retrieval process by allowing the system to
locate configuration details from multiple potential sources.
- Introduced a build enhancement that conditionally injects a startup
script into bundled outputs, improving script portability and user
experience.
- Specified the Node.js interpreter path in the application
configuration for better execution control.
- Added a symbolic link for the Node.js binary to enhance accessibility.

- **Bug Fixes**
- Enhanced error handling for locating the `package.json` file,
providing feedback when no valid file is found.

- **Chores**
- Removed unnecessary shell script that modified the system's `PATH`
environment variable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-03-04 16:13:47 -05:00
Eli Bosley
4f5c367fdf feat: begin building plugin with node instead of bash (#1120)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced automated build and release processes with containerized
builds, improved caching, and refined artifact handling.
- Introduced new configuration options to strengthen versioning,
integrity checks, and pull request tracking.
	- Added a new Dockerfile for building the Node.js application.
- Added new environment variables for API versioning and validation
control.
	- Implemented comprehensive management of PM2 processes and state.
- Introduced a new GitHub Actions workflow for automating staging plugin
deployment upon pull request closure.
	- Updated logic for handling plugin installation and error feedback.
	- Added new asynchronous methods for managing PM2 processes.
	- Updated logging configurations for better control over log outputs.
	- Added Prettier configuration for consistent code formatting.
- Introduced a configuration to prevent the application from watching
for file changes.

- **Bug Fixes**
- Improved error handling and user feedback during the installation of
staging versions.

- **Documentation**
- Removed outdated introductory documentation to streamline project
information.

- **Chores**
- Updated deployment routines and validation steps to improve release
consistency and error handling.
- Simplified packaging and build scripts for smoother staging and
production workflows.
	- Excluded sensitive files from the Docker build context.
- Updated the `.gitignore` file to prevent unnecessary files from being
tracked.
- Adjusted the test timeout configuration for improved test reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-02-06 12:32:41 -05:00
Pujit Mehrotra
61ee689658 feat(ui): webgui-compatible web component library (#1075)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eli Bosley <ekbosley@gmail.com>

- **CI/CD**
	- Updated GitHub Actions workflow to build Unraid UI Web Components.
	- Adjusted artifact naming and download configurations.

- **Web Components**
	- Added new web components and registration mechanism.
	- Implemented toast notifications.
	- Enhanced UI component library.

- **Notifications**
	- Added real-time notification subscription.
	- Created notification settings page.
	- Implemented notification toast system.

- **API Improvements**
	- Refactored GraphQL schema loading.
	- Updated authentication and cookie handling.
	- Improved error logging and server initialization.

- **Development Tools**
	- Updated ESLint configuration.
	- Enhanced import path management.
	- Added new development dependencies.
2025-01-31 10:47:03 -05:00
Eli Bosley
bbf28075c6 feat: use plugin file for install and uninstall 2025-01-08 10:16:34 -05:00
Eli Bosley
00b8ffe87d feat: move variable declarations to theme.ts 2024-12-17 11:48:45 -05:00
Eli Bosley
bb555f8296 feat: remove nghttp3 and only bundle nodejs 2024-12-05 16:04:16 -05:00
Eli Bosley
3ed1d10c98 fix: properly restart the API when installed 2024-11-05 16:11:21 -05:00
Eli Bosley
810708f775 fix: use unraid binary path to call unraid commands 2024-11-05 16:11:21 -05:00
Eli Bosley
406c400bd2 fix: proper directory in rc.unraid-api 2024-11-05 16:11:21 -05:00
Eli Bosley
cf0eeebd31 feat: remove more unused calls 2024-11-05 16:11:21 -05:00
Eli Bosley
f118597e47 feat: massive rc.unraid-api updates to facilitate installing and linking 2024-11-05 16:11:21 -05:00
ljm42
5ee7cb2647 feat: reduce how often rc.flashbackup checks for changes
Instead of checking once per minute, check once every 30 minutes
2024-09-10 12:48:40 -04:00
Eli Bosley
4423829911 feat: add global agent (#897)
* feat: add global agent

* feat: add proxy setup to rc.unraid-api

* feat: update myservers.cfg to latest version
2024-08-14 14:52:36 -04:00
ljm42
c995a4c5c8 Fix: rc.flashbackup needs to check both signed in and connected (#882)
because /var/local/emhttp/myservers.cfg does not clear the connected status when the user signs out
2024-05-10 10:44:21 -07:00
ljm42
9ae9d40f94 fix: keep minor enhancements from #872 (#878) 2024-05-07 08:39:46 -07:00
ljm42
cc69213beb Feat: Flash Backup requires connection to mothership (#868)
* fix: branding

* feat: flash backup requires connection to mothership

* feat: flash backup requires connection to mothership
2024-04-26 12:01:42 -04:00