mirror of
https://github.com/unraid/api.git
synced 2026-01-04 07:29:48 -06:00
fix: update PHP path in plugin and enhance deployment script for web components
- Changed the PHP executable path in the plugin from `/bin/php` to `/usr/bin/php` for better compatibility. - Improved the `deploy-dev.sh` script by ensuring proper quoting in the rsync command and adding a check to create the remote directory for standalone apps, enhancing deployment reliability.
This commit is contained in:
@@ -166,7 +166,7 @@ exit 0
|
||||
</INLINE>
|
||||
</FILE>
|
||||
|
||||
<FILE Run="/bin/php" Method="install">
|
||||
<FILE Run="/usr/bin/php" Method="install">
|
||||
<INLINE>
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -38,19 +38,18 @@ exit_code=0
|
||||
# Deploy web components if they exist
|
||||
if [ "$has_webcomponents" = true ]; then
|
||||
echo "Deploying web components..."
|
||||
ssh "root@${server_name}" "rm -rf /usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/nuxt/*"
|
||||
rsync_command="rsync -avz -e ssh $webcomponents_directory root@${server_name}:/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/nuxt"
|
||||
echo "$rsync_command"
|
||||
eval "$rsync_command"
|
||||
# Run rsync with proper quoting and --delete for safe mirroring
|
||||
rsync -avz --delete -e "ssh" "$webcomponents_directory" "root@${server_name}:/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/nuxt/"
|
||||
exit_code=$?
|
||||
fi
|
||||
|
||||
# Deploy standalone apps if they exist
|
||||
if [ "$has_standalone" = true ]; then
|
||||
echo "Deploying standalone apps..."
|
||||
rsync_standalone="rsync -avz --delete -e ssh $standalone_directory root@${server_name}:/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/standalone/"
|
||||
echo "$rsync_standalone"
|
||||
eval "$rsync_standalone"
|
||||
# Ensure remote directory exists
|
||||
ssh root@"${server_name}" "mkdir -p /usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/standalone/"
|
||||
# Run rsync with proper quoting
|
||||
rsync -avz --delete -e "ssh" "$standalone_directory" "root@${server_name}:/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/standalone/"
|
||||
standalone_exit_code=$?
|
||||
# If standalone rsync failed, update exit_code
|
||||
if [ $standalone_exit_code -ne 0 ]; then
|
||||
@@ -91,7 +90,7 @@ update_auth_request() {
|
||||
print $0
|
||||
next
|
||||
}
|
||||
!in_array || !/\/plugins\/dynamix\.my\.servers\/unraid-components\/nuxt\/_nuxt\/unraid-components\.client-/ {
|
||||
!in_array || !/\/plugins\/dynamix\.my\.servers\/unraid-components\/(nuxt\/_nuxt|standalone)\/.*\.m?js/ {
|
||||
print $0
|
||||
}
|
||||
' "$AUTH_REQUEST_FILE" > "${AUTH_REQUEST_FILE}.tmp"
|
||||
|
||||
Reference in New Issue
Block a user