recognition of extensions without GUI / config.xml entries
This commit is contained in:
crestAT
2016-07-16 08:24:23 +02:00
parent c101a67b8c
commit 06f4a1b3a5
6 changed files with 42 additions and 14 deletions

View File

@@ -0,0 +1,13 @@
<?php
$command = "mcommander.sh";
$cmd = dirname(__FILE__)."/".$command;
require_once("config.inc");
require_once("functions.inc");
$i =0;
if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
for ($i; $i < count($config['rc']['postinit']['cmd']);) {
if (preg_match("/$command/", $config['rc']['postinit']['cmd'][$i])) break; ++$i; }
}
$config['rc']['postinit']['cmd'][$i] = $config['cmd']."$cmd";
write_config();
?>

View File

@@ -49,7 +49,7 @@ $loginfo = array(
"type" => "plain",
"pattern" => "/^(.*)###(.*)###(.*)###(.*)###(.*)###(.*)###(.*)$/",
"columns" => array(
array("title" => gettext("Extensions"), "class" => "listlr", "param" => "align=\"left\" valign=\"middle\" nowrap", "pmid" => 0),
array("title" => gettext("Extension"), "class" => "listlr", "param" => "align=\"left\" valign=\"middle\" nowrap", "pmid" => 0),
array("title" => gettext("Version"), "class" => "listr", "param" => "align=\"center\" valign=\"middle\"", "pmid" => 1),
array("title" => gettext("Description"), "class" => "listr", "param" => "align=\"left\" valign=\"middle\"", "pmid" => 5),
array("title" => gettext("Install"), "class" => "listr", "param" => "align=\"center\" valign=\"middle\"", "pmid" => 4)
@@ -64,6 +64,17 @@ function log_get_contents($logfile) {
return $content;
}
function log_get_status($cmd_entry) {
global $config;
$i =0;
if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
for ($i; $i < count($config['rc']['postinit']['cmd']);) { if (preg_match("/$cmd_entry/", $config['rc']['postinit']['cmd'][$i])) break; ++$i; }
}
//echo($cmd_entry." $i - ");
if ($i == count($config['rc']['postinit']['cmd'])) return 0; // 0 = no entry, extension is not installed
else return 1; // 1 = entry found, extension is already installed
}
function log_display($loginfo) {
global $g;
global $config;
@@ -110,15 +121,15 @@ function log_display($loginfo) {
// architectures: x86, x64, rpi
// platforms: embedded, full, livecd, liveusb
if (!empty($result[6]) && ((strpos($result[6], $g['arch']) !== false) || (strpos($result[6], $g['platform']) !== false))) {
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}'> <img src='{$image_path}status_disabled.png' border='0' alt='' title='".gettext('Unsupported architecture/platform')."' /></td>\n";
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}'> <img src='{$image_path}status_disabled.png' border='0' alt='' title='".gettext('Unsupported architecture/platform').': '.$result[6]."' /></td>\n";
}
else {
// check if extension is already installed (existing config.xml entry or, for command line tools, based on installation directory)
if ((isset($config[$result[2]])) || ((strpos($result[2], "/") == 0) && (is_dir("{$config['onebuttoninstaller']['storage_path']}{$result[2]}")))){
// check if extension is already installed (existing config.xml or postinit cmd entry)
if ((isset($config[$result[2]])) || (log_get_status($result[2]) == 1)) {
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}'> <img src='{$image_path}status_enabled.png' border='0' alt='' title='".gettext('Enabled')."' /></td>\n";
}
else { // data for installation
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}'>
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}' title='".gettext('Select to install')."' >
<input type='checkbox' name='name[".$j."][extension]' value='".$result[2]."' />
<input type='hidden' name='name[".$j."][truename]' value='".$result[0]."' />
<input type='hidden' name='name[".$j."][command1]' value='".$result[3]."' />
@@ -197,7 +208,10 @@ bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?>
log_display($loginfo[$log]);
?>
</table>
<div id="submit">
<div id="remarks">
<?php html_remark("note", gettext("Note"), gettext("After successful installation extensions can be found under the 'Extensions' entry in the navigation bar.")."<br /><b>".gettext("Some extensions need to finish their installation procedures on their own extension page before they will be shown as installed!")."</b>");?>
</div>
<div id="submit">
<input name="install" type="submit" class="formbtn" title="<?=gettext("Install extensions");?>" value="<?=gettext("Install");?>" onclick="return confirm('<?=gettext("Ready to install the selected extensions?");?>')" />
<input name="update" type="submit" class="formbtn" title="<?=gettext("Update extensions list");?>" value="<?=gettext("Update");?>" />
</div>

View File

@@ -3,9 +3,8 @@ Downloady###<font color="green">RELEASE<br>0.1</font>###downloady###mkdir -p dow
RRDGraphs###<font color="green">RELEASE<br>0.3.2</font>###rrdgraphs###mkdir -p rrdgraphs && cd rrdgraphs && fetch https://raw.github.com/crestAT/nas4free-rrdtool/master/rrdgraphs/rrd-install.php && chmod 770 rrd*install.php###rrdgraphs/rrd-install.php###Extension to install / configure / update and remove RRDTool based graphs for NAS4Free servers.<br><br>The extension is based on RRDtool and provides graphs for CPU frequency, CPU temperature, CPU usage, Disk usage (recognition of all mountpoints/shares automatically at RRDG startup), Load averages, Memory usage, Network latency, Network traffic, Processes, UPS, Uptime and ZFS ARC.<br><br>The extension is compatible with all versions (9.1.x - 10.x) of NAS4Free except on ARM boxes and works on all plattforms (x86 & x64, embedded & full), does not need jail or pkg_add, add pages to NAS4Free Web GUI extensions, features configuration and extension maintenance (update & removal inside the WebGUI) and is able to work on RAM drives to take care of your HDDs/USB pen drives.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=8299' target='_blank'>NAS4Free Forum</a>
BitTorrent Sync###<font color="green">RELEASE<br>0.7</font>###btsync###fetch https://raw.github.com/crestAT/nas4free-bittorrent-sync/master/bts-install.php && chmod 770 bts*install.php###bts-install.php###Extension to install / configure / backup / update / manage and remove BitTorrent Sync application on NAS4Free servers.<br><br>The extension can be used with BitTorrent Sync 1.4.x (last version was 1.4.111) as well as 2.x, is compatible with all versions (9.1.x - 10.x) of NAS4Free except on ARM boxes, works on all plattforms (embedded, full), does not need jail or pkg_add, add pages to NAS4Free Web GUI extensions, features configuration, application update & backup management, extension mantenance (update & removal) and log view with filter and search capability.<br><br><font color="blue"><b>Note:</b> Standard BitTorrent Sync version is based on 2.x releases, to use the latest 1.x release open Extensions | BitTorrent Sync | Maintenance and change the Download URL for version <b>1.4.111:</b><br><b>64 bit: </b>http://syncapp.bittorrent.com/1.4.111/btsync_freebsd_x64-1.4.111.tar.gz<br><b>32 bit: </b>http://syncapp.bittorrent.com/1.4.111/btsync_freebsd_i386-1.4.111.tar.gz<br>and hit Save URL, Fetch and Install.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=5704' target='_blank'>NAS4Free Forum</a>###rpi, rpi2
Syncthing###<font color="green">RELEASE<br>0.1.5</font>###syncthing###fetch https://raw.github.com/crestAT/nas4free-syncthing/master/stg-install.php && chmod 770 stg*install.php###stg-install.php###Extension to install / configure / backup / update / manage and remove Syncthing (STG) application on NAS4Free (N4F) servers.<br><br>The extension works on all plattforms, does not need jail or pkg_add, add pages to NAS4Free WebGUI extensions, features configuration, application update & backup management, scheduling and log view with filter / search capabilities.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=7821' target='_blank'>NAS4Free Forum</a>###rpi, rpi2
TheBrig###<font color="green">RELEASE<br>0.94</font>###thebrig###mkdir -p thebrig && cd thebrig && fetch https://raw.githubusercontent.com/fsbruva/thebrig/alcatraz/thebrig_install.sh && chmod a+x thebrig_install.sh && sh thebrig_install.sh###-###Jail manager extension for NAS4Free.<br><br><font color="blue"><b>Note:</b> After the installation navigate to rudimentary config tab and push Save to finish the installation.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=79&t=3894' target='_blank'>NAS4Free Forum</a>
DNSMasq DHCP Server###<font color="red">BETA<br>0.2</font>###dnsmasq###mkdir -p dnsmasq && cd dnsmasq && fetch https://raw.github.com/alexey1234/nas4free-dnsmasq/master/dnsmasq_install.sh && chmod a+x dnsmasq_install.sh && sh dnsmasq_install.sh `pwd`###-###DNSMasq DHCP Server extension for NAS4Free.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=3002' target='_blank'>NAS4Free Forum</a>###rpi, rpi2
Midnight Commander###<font color="green">RELEASE<br>2015-02-21</font>###/midnightcommander###mkdir -p midnightcommander && cd midnightcommander && cp /usr/local/www/ext/onebuttoninstaller/mcommander.sh . && echo "copy OK" && chmod u+x mcommander.sh && echo "chmod OK" && `pwd`/mcommander.sh###-###Midnight Commander for NAS4Free.<br><br>After the successful installation you can use Midnight Commander in the system console shell or if you connect via ssh. To start the Midnight Commander just enter the command <b>mc</b> in the CLI.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=70&t=187' target='_blank'>NAS4Free Forum</a>###rpi, rpi2
Bhyve###<font color="red">BETA<br>0.x</font>###bhyve###mkdir -p bhyve && cd bhyve && fetch https://raw.githubusercontent.com/alexey1234/vmbhyve_nas4free/master/bhyve_install.sh && chmod a+x bhyve_install.sh && sh bhyve_install.sh `pwd`###-###WebGUI for bhyve for NAS4Free.<br><br><font color="blue"><b>Note:</b> After the installation navigate to rudimentary config tab and push Save to finish the installation.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=10433#p65157' target='_blank'>NAS4Free Forum</a>
ezPlex Standard###<font color="green">RELEASE<br>4.0</font>###ezplex###mkdir -p plex && cd plex && ./plexinit && rehash###plex/postinit###<font color="red"><h3>ATM NEEDS LOCALLY SAVED plexinit FILE!</h3></font>Plex Media Server Add-On for NAS4Free 10.x.<br><br>The extension works on NAS4Free Plex Media Server Add-On for NAS4Free 10.x or compatible FreeBSD based NAS solutions, don't need jail, fstab or unionfs configs, self contained and portable package, single script for management and startup, easy to upgrade/rollback while maintaining actual Plex config, Plex IP address will be locally visible by any devices.<br><br><font color="blue"><b>Note: </b>After install simply reboot and enjoy ezPlex.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=11049#p69002' target='_blank'>NAS4Free Forum</a>###x86, rpi, rpi2
ezPlex PlexPass###<font color="green">RELEASE<br>4.0</font>###ezplexpass###mkdir -p plexpass && cd plexpass && tar xf ezplex-*.tgz && rm ezplex-*.tgz && ./plexinit && rehash###-###Plex Media Server Add-On for NAS4Free 10.x.<br><br>The extension works on NAS4Free 10.x or compatible FreeBSD based NAS solutions, don't need jail, fstab or unionfs configs, self contained and portable package, single script for management and startup, easy to upgrade/rollback while maintaining actual Plex config, Plex IP address will be locally visible by any devices.<br><br><font color="blue"><b>Note: </b>After install simply reboot and enjoy ezPlex.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=11049#p69002' target='_blank'>NAS4Free Forum</a>###x86, x64, rpi, rpi2
TheBrig###<font color="green">RELEASE<br>0.94</font>###thebrig###mkdir -p thebrig && cd thebrig && fetch https://raw.githubusercontent.com/fsbruva/thebrig/alcatraz/thebrig_install.sh && chmod a+x thebrig_install.sh && sh thebrig_install.sh###-###Jail manager extension for NAS4Free.<br><br><font color="red"><b>Note:</b> After the installation navigate to rudimentary config tab and push Save to finish the installation.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=79&t=3894' target='_blank'>NAS4Free Forum</a>
DNSMasq DHCP Server###<font color="green">RELEASE<br>0.3</font>###dnsmasq###mkdir -p dnsmasq && cd dnsmasq && fetch https://raw.github.com/alexey1234/nas4free-dnsmasq/master/dnsmasq_install.sh && chmod a+x dnsmasq_install.sh && sh dnsmasq_install.sh `pwd`###-###DNSMasq DHCP Server extension for NAS4Free.<br><br><font color="red"><b>Note:</b> After the installation navigate to rudimentary config tab and push Save to finish the installation.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=3002' target='_blank'>NAS4Free Forum</a>###rpi, rpi2
Midnight Commander###<font color="green">RELEASE<br>4.8.8</font>###mcommander.sh###mkdir -p midnightcommander && cd midnightcommander && cp /usr/local/www/ext/onebuttoninstaller/mcommander.* . && chmod u+x mcommander.sh && `pwd`/mcommander.sh###midnightcommander/mcommander.postinit###Midnight Commander for NAS4Free.<br><br>After successful installation you can use Midnight Commander in the system console shell or if you connect via ssh. To start the Midnight Commander just enter the command <b>mc</b> in the CLI.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=70&t=187' target='_blank'>NAS4Free Forum</a>###rpi, rpi2
Bhyve###<font color="red">BETA<br>0.x</font>###bhyve###mkdir -p bhyve && cd bhyve && fetch https://raw.githubusercontent.com/alexey1234/vmbhyve_nas4free/master/bhyve_install.sh && chmod a+x bhyve_install.sh && sh bhyve_install.sh `pwd`###-###WebGUI for bhyve for NAS4Free.<br><br><font color="red"><b>Note:</b> After the installation navigate to rudimentary config tab and push Save to finish the installation.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=10433#p65157' target='_blank'>NAS4Free Forum</a>
Plex Media Server###<font color="green">RELEASE<br>4.0</font>###plexinit###cd plex && ./plexinit -g ###plex/postinit###Plex Media Server Add-On for NAS4Free 10.x.<br><br>The extension works on NAS4Free Plex Media Server Add-On for NAS4Free 10.x or compatible FreeBSD based NAS solutions, don't need jail, fstab or unionfs configs, self contained and portable package, single script for management and startup, easy to upgrade/rollback while maintaining actual Plex config, Plex IP address will be locally visible by any devices.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=11049#p69002' target='_blank'>NAS4Free Forum</a>###x86, rpi, rpi2

View File

@@ -31,6 +31,7 @@
*/
/*
Version Date Description
0.1-b6 2016.06.16 recognition of extensions without GUI / config.xml entries
0.1-b4 2016.04.07 2451 compatibility
0.1-b3 2016.02.06 N: add language support
0.1-b2 2016.02.02 N: check for supported architecture, plattform
@@ -42,7 +43,7 @@ Version Date Description
0.1-a1 2016.01.16 initial release
*/
$v = "v0.1-b4"; // extension version
$v = "v0.1-b6"; // extension version
$appname = "OneButtonInstaller";
require_once("config.inc");

View File

@@ -1,4 +1,5 @@
Version Date Description
0.1-b6 2016.06.16 recognition of extensions without GUI / config.xml entries
0.1-b4 2016.04.07 2451 compatibility
0.1-b3 2016.02.06 N: add language support
0.1-b2 2016.02.01 N: check for supported architecture, plattform

View File

@@ -1 +1 @@
0.1-b4
0.1-b6