Ready to test on 6.9.2
parent
634101b81c
commit
6762125cce
Binary file not shown.
|
@ -272,6 +272,7 @@ $(function(){
|
||||||
|
|
||||||
$('.mainArea').on("click",".dockerUpdate",function() {
|
$('.mainArea').on("click",".dockerUpdate",function() {
|
||||||
var container = $(this).attr("data-name");
|
var container = $(this).attr("data-name");
|
||||||
|
$("#sb-nav-close").css("visibility","hidden"); // Because docker install cannot be aborted so why allow window to close
|
||||||
<? if ( $translations ): ?>
|
<? if ( $translations ): ?>
|
||||||
openBox('/plugins/community.applications/scripts/installUpdate.php?ct[]='+encodeURIComponent(container),tr('Update Container'),600,1100,true,"refreshDisplay");
|
openBox('/plugins/community.applications/scripts/installUpdate.php?ct[]='+encodeURIComponent(container),tr('Update Container'),600,1100,true,"refreshDisplay");
|
||||||
<? else: ?>
|
<? else: ?>
|
||||||
|
|
|
@ -8,6 +8,8 @@ Link='nav-user'
|
||||||
# Licenced under GPLv2 #
|
# Licenced under GPLv2 #
|
||||||
# #
|
# #
|
||||||
###############################################################
|
###############################################################
|
||||||
|
|
||||||
|
### Note: This file is only needed on OS versions less than 6.8.3
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<? if ( ! file_exists("/usr/local/emhttp/plugins/dynamix.plugin.manager/PluginHelpers.page") ) : ?>
|
<? if ( ! file_exists("/usr/local/emhttp/plugins/dynamix.plugin.manager/PluginHelpers.page") ) : ?>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
767d6f2203fed9541daeb57bbf7b58b3 ./Apps.page
|
767d6f2203fed9541daeb57bbf7b58b3 ./Apps.page
|
||||||
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
|
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
|
||||||
fcf7fdd6e4091b8b495d1f44f751a8b1 ./CommunityApps.page
|
c310bec9668efd9bb040c2854f0b0ad8 ./CommunityApps.page
|
||||||
6db73582f22dab13d329e862067ee84e ./PluginAPI.page
|
8c24d585c7dd3ff9ef961bb2c2705711 ./PluginAPI.page
|
||||||
b398273cf7daa62ab00d2de2336ca25f ./README.md
|
b398273cf7daa62ab00d2de2336ca25f ./README.md
|
||||||
2cdb7da0d67a11278ada7fd029707738 ./ca_settings.page
|
2cdb7da0d67a11278ada7fd029707738 ./ca_settings.page
|
||||||
7c88ace586933a4a60b0ef2f8a97a662 ./default.cfg
|
7c88ace586933a4a60b0ef2f8a97a662 ./default.cfg
|
||||||
|
@ -19,7 +19,7 @@ e29c13353bc1277fc2c3597782d7c954 ./skins/Narrow/css.php
|
||||||
e7bf62923b2d7109b6848554701e12f6 ./skins/Narrow/skin.html
|
e7bf62923b2d7109b6848554701e12f6 ./skins/Narrow/skin.html
|
||||||
3d99868bae55191e2fe27bfcb3b8806e ./skins/Narrow/skin.php
|
3d99868bae55191e2fe27bfcb3b8806e ./skins/Narrow/skin.php
|
||||||
430966e5646376b62905b63a30de7102 ./scripts/PluginAPI.php
|
430966e5646376b62905b63a30de7102 ./scripts/PluginAPI.php
|
||||||
11eecc7264a3057ee70cc00a24c8299b ./scripts/installMulti.php
|
bbd9dec6c5df486d75c46388c14f09ce ./scripts/installMulti.php
|
||||||
ce2c904b6a40c4677a3ff3484776959e ./scripts/installMultiPlugin.sh
|
ce2c904b6a40c4677a3ff3484776959e ./scripts/installMultiPlugin.sh
|
||||||
524afab04ca930f59117a846f819fb2f ./scripts/installPluginUpdate.sh
|
524afab04ca930f59117a846f819fb2f ./scripts/installPluginUpdate.sh
|
||||||
5846421e95b475e1156c3f68164ccc4f ./scripts/languageInstall.sh
|
5846421e95b475e1156c3f68164ccc4f ./scripts/languageInstall.sh
|
||||||
|
@ -28,5 +28,5 @@ ce2c904b6a40c4677a3ff3484776959e ./scripts/installMultiPlugin.sh
|
||||||
f9c3f431935fb20801f3fef152dc7b58 ./scripts/showStatistics.php
|
f9c3f431935fb20801f3fef152dc7b58 ./scripts/showStatistics.php
|
||||||
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
|
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
|
||||||
02759ea835ee4ce5a051fead96ab9b9b ./scripts/updatePluginSupport.php
|
02759ea835ee4ce5a051fead96ab9b9b ./scripts/updatePluginSupport.php
|
||||||
0a4b291ae29b73cea0437a11ba28c8d9 ./scripts/checkForUpdates.php
|
090480fd4d6f2dff82f0b5c3e8ca3e6a ./scripts/checkForUpdates.php
|
||||||
ce77df69331ccd3bf4037389325a01e1 ./scripts/installUpdate.php
|
ce77df69331ccd3bf4037389325a01e1 ./scripts/installUpdate.php
|
||||||
|
|
|
@ -10,7 +10,7 @@ $docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: "/usr/local/emhttp";
|
||||||
exec("$docroot/plugins/dynamix.docker.manager/scripts/dockerupdate check nonotify > /dev/null 2>&1");
|
exec("$docroot/plugins/dynamix.docker.manager/scripts/dockerupdate check nonotify > /dev/null 2>&1");
|
||||||
foreach (glob("/var/log/plugins/*.plg") as $plg) {
|
foreach (glob("/var/log/plugins/*.plg") as $plg) {
|
||||||
if ( $plg == "/var/log/plugins/community.applications.plg" || $plg == "unRAIDServer.plg" || $plg == "gui.search.plg")
|
if ( $plg == "/var/log/plugins/community.applications.plg" || $plg == "unRAIDServer.plg" || $plg == "gui.search.plg")
|
||||||
continue; // avoid possible race condition since CA / gui.search automatically check for updates for themselves
|
continue; // avoid possible race condition since CA / gui.search automatically check for updates for themselves when on Apps tab
|
||||||
|
|
||||||
exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin check ".escapeshellarg(basename($plg))." > /dev/null 2>&1");
|
exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin check ".escapeshellarg(basename($plg))." > /dev/null 2>&1");
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,37 +14,47 @@ if ( $translations ) {
|
||||||
|
|
||||||
require_once "$docroot/plugins/community.applications/include/paths.php";
|
require_once "$docroot/plugins/community.applications/include/paths.php";
|
||||||
require_once "$docroot/plugins/dynamix/include/Wrappers.php";
|
require_once "$docroot/plugins/dynamix/include/Wrappers.php";
|
||||||
require_once "$docroot/plugins/community.applications/include/helpers.php";
|
|
||||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
|
||||||
|
|
||||||
$caSettings['dockerRunning'] = true;
|
|
||||||
$unRaidVersion = parse_ini_file($caPaths['unRaidVersion']);
|
$unRaidVersion = parse_ini_file($caPaths['unRaidVersion']);
|
||||||
$translations = is_file("$docroot/plugins/dynamix/include/Translations.php");
|
$translations = is_file("$docroot/plugins/dynamix/include/Translations.php");
|
||||||
|
|
||||||
$DockerClient = new DockerClient();
|
function tr($string,$ret=true) {
|
||||||
$DockerTemplates = new DockerTemplates();
|
if ( function_exists("_") )
|
||||||
|
$string = str_replace('"',""",str_replace("'","'",_($string)));
|
||||||
|
if ( $ret )
|
||||||
|
return $string;
|
||||||
|
else
|
||||||
|
echo $string;
|
||||||
|
}
|
||||||
|
|
||||||
$running = getRunningContainers();
|
function startsWith($haystack, $needle) {
|
||||||
|
return $needle === "" || strripos($haystack, $needle, -strlen($haystack)) !== FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
$exeFile = "/usr/local/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php";
|
# Modify the system file to avoid a harmless error from being displayed under normal circumstances
|
||||||
|
# Not needed under unRaid 6.6.2+
|
||||||
|
|
||||||
|
if ( version_compare($unRaidVersion['version'],"6.6.2",">=") ) {
|
||||||
|
$exeFile = "/usr/local/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php";
|
||||||
|
} else {
|
||||||
|
$exeFile = "/tmp/community.applications/tempFiles/newCreateDocker.php";
|
||||||
|
$dockerInstall = file("/usr/local/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php",FILE_IGNORE_NEW_LINES);
|
||||||
|
foreach ($dockerInstall as $line) {
|
||||||
|
if ( startsWith(trim($line),"removeContainer(") ) {
|
||||||
|
$line = "#$line";
|
||||||
|
}
|
||||||
|
$newInstall[] = $line;
|
||||||
|
}
|
||||||
|
file_put_contents($exeFile,implode("\n",$newInstall));
|
||||||
|
chmod($exeFile,0777);
|
||||||
|
}
|
||||||
$javascript = file_get_contents("/usr/local/emhttp/plugins/dynamix/javascript/dynamix.js");
|
$javascript = file_get_contents("/usr/local/emhttp/plugins/dynamix/javascript/dynamix.js");
|
||||||
echo "<script>$javascript</script>";
|
echo "<script>$javascript</script>";
|
||||||
|
|
||||||
$dockers = explode(",",$_GET['docker']);
|
|
||||||
if ( $_GET['upgrade'] ) {
|
|
||||||
foreach ( $dockers as $container ) {
|
|
||||||
if ( $running[$container]['running'] ) {
|
|
||||||
echo "Stopping $container...\n";
|
|
||||||
myStopContainer($running[$container]['Id']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $_GET['docker'] ) {
|
if ( $_GET['docker'] ) {
|
||||||
echo "<div id='output'>";
|
echo "<div id='output'>";
|
||||||
|
$dockers = explode(",",$_GET['docker']);
|
||||||
$msg = $_GET['upgrade'] ? "Upgrading docker application %s" : "Installing docker applications %s";
|
echo sprintf(tr("Installing docker applications %s"),str_replace(",",", ",$_GET['docker']))."<br>";
|
||||||
echo sprintf(tr($msg),str_replace(",",", ",$_GET['docker']))."<br>";
|
|
||||||
$_GET['updateContainer'] = true;
|
$_GET['updateContainer'] = true;
|
||||||
$_GET['ct'] = $dockers;
|
$_GET['ct'] = $dockers;
|
||||||
$_GET['communityApplications'] = true;
|
$_GET['communityApplications'] = true;
|
||||||
|
@ -87,7 +97,6 @@ function addCloseButton() {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?
|
<?
|
||||||
if ( ! $_GET['upgrade'] ) {
|
|
||||||
foreach ($dockers as $docker) {
|
foreach ($dockers as $docker) {
|
||||||
echo sprintf(tr("Starting %s"),"<span class='ca_bold'>$docker</span>")."<br>";
|
echo sprintf(tr("Starting %s"),"<span class='ca_bold'>$docker</span>")."<br>";
|
||||||
unset($output);
|
unset($output);
|
||||||
|
@ -121,16 +130,5 @@ function addCloseButton() {
|
||||||
echo "<script>top.Shadowbox.close();</script>";
|
echo "<script>top.Shadowbox.close();</script>";
|
||||||
}
|
}
|
||||||
@unlink("/tmp/community.applications/tempFiles/newCreateDocker.php");
|
@unlink("/tmp/community.applications/tempFiles/newCreateDocker.php");
|
||||||
} else {
|
|
||||||
foreach ( $dockers as $container ) {
|
|
||||||
if ( $running[$container]['running'] ) {
|
|
||||||
echo "Starting $container";
|
|
||||||
passthru("docker start $container");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "<br>".tr("Docker Application Installation finished")."<br><script>addCloseButton();</script>";
|
|
||||||
echo "<script>top.Shadowbox.close();</script>";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue