Skip to content

Commit

Permalink
Update proxy.php - no IPv6 fix (only IPv4 available)
Browse files Browse the repository at this point in the history
The AppImage/coolwsd fails when IPv6 is disabled- see here: https://help.nextcloud.com/t/aio-installation-collabora-and-docker-socket-proxy-container-startup-failure/177821

In the fix: launch "ip -6 address" command. If there is no IPv6, empty string is returned by the command. If so, then parameter "--o:net.proto=IPv4" is added to AppImage/coolwsd.
  • Loading branch information
thiemel authored and timar committed Mar 28, 2024
1 parent 9fd5fe1 commit 44052e1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,22 @@ function startCoolwsd()
$remoteFontConfig = "--o:remote_font_config.url=" . $remoteFontConfigUrl;
}

// Check if IPv6 has been disabled
$IPv4only = "";
$launchCmd = "ip -6 addr";
debug_log("Testing disabled IPv6: $launchCmd");
exec($launchCmd, $output, $return);
if (implode("",$output)=="")
{
debug_log("IPv6 disabled. Will launch coolwsd with IPv4-only option.");
$IPv4only = "--o:net.proto=IPv4";
}

// Extract the AppImage if FUSE is not available
// net.lok_allow.host[14] is the next empty slot after the last element of the default list
// when lok_allow does not contain the Nextcloud host, it is not possible to insert image from Nextloud
// we have to set explicitely, because storage.wopi.alias_groups[@mode] is 'first' in case of richdocumentscode
$launchCmd = "bash -c \"( $appImage $remoteFontConfig --o:net.lok_allow.host[14]=" . $_SERVER['HTTP_HOST'] . " --pidfile=$pidfile || $appImage --appimage-extract-and-run $remoteFontConfig --o:net.lok_allow.host[14]=" . $_SERVER['HTTP_HOST'] . " --pidfile=$pidfile) >/dev/null & disown\"";
$launchCmd = "bash -c \"( $appImage $remoteFontConfig $IPv4only --o:net.lok_allow.host[14]=" . $_SERVER['HTTP_HOST'] . " --pidfile=$pidfile || $appImage --appimage-extract-and-run $remoteFontConfig $IPv4only --o:net.lok_allow.host[14]=" . $_SERVER['HTTP_HOST'] . " --pidfile=$pidfile) >/dev/null & disown\"";

// Remove stale lock file (just in case)
if (file_exists("$lockfile"))
Expand Down

0 comments on commit 44052e1

Please sign in to comment.