Files
api/plugin/source/dynamix.unraid.net/install/doinst.sh
Pujit Mehrotra a8566e9e5a build: fix doinst.sh compatibility with installpkg --root (#1446)
- Isolate plugin concerns into `.plg` plugin & api file modifiers instead of the api's
slackware package.

## Summary by CodeRabbit

* **New Features**
* Installation process modularized into package installation,
post-install setup with verification, and service startup with cleanup.
* Added logging and error detection during installation, including
symlink verification.
  * Created required log directory to support service dependencies.
* Integrated nginx service with reload capability triggered by
configuration changes.
* Added automatic patching of nginx configuration and hosts file to
improve security and iframe compatibility.
* Enhanced file modification system to handle side effects and trigger
nginx reloads as needed.

* **Refactor**
* Restructured installation scripts for clarity; setup scripts now
separate steps.
  * Removed legacy installation logic and deprecated related scripts.
  * Enabled hard link addition during package creation.
* Simplified installation scripts by removing conditional branching and
detailed logging.
* Streamlined API environment setup by removing redundant post-install
steps.
* Updated dependency injection to explicitly provide nginx service
token.
  * Improved patch application error reporting with file path details.

* **Chores**
  * Disabled legacy scripts to streamline installation.
  * Removed `.gitignore` to track previously ignored files.
* Updated tests to include new dependencies and relaxed logger
assertions.
<!-- 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/1210661184127051
2025-06-30 10:49:46 -04:00

28 lines
818 B
Bash

#!/bin/sh
backup_file_if_exists() {
if [ -f "$1" ]; then
mv "$1" "$1.old"
fi
}
for f in etc/rc.d/rc6.d/K*unraid-api etc/rc.d/rc6.d/K*flash-backup; do
[ -e "$f" ] && chmod 755 "$f"
done
chmod +x usr/local/unraid-api/dist/cli.js
chmod +x usr/local/unraid-api/dist/main.js
rm -f usr/local/bin/unraid-api
ln -sf ../unraid-api/dist/cli.js usr/local/bin/unraid-api
# deprecated
ln -sf ../bin/unraid-api usr/local/sbin/unraid-api
ln -sf ../local/bin/unraid-api usr/bin/unraid-api
# By default, we want to overwrite the active api-specific .env configuration on every install.
# We keep a backup in case a user needs to revert to their prior configuration.
backup_file_if_exists usr/local/unraid-api/.env
cp usr/local/unraid-api/.env.production usr/local/unraid-api/.env
# auto-generated actions from makepkg: