beta release 1
This commit is contained in:
crestAT
2016-01-28 17:13:36 +01:00
parent 94c5ff0aa7
commit f0210c40c6
7 changed files with 80 additions and 100 deletions

View File

@@ -0,0 +1,30 @@
<!-- attach spinner -->
<script type="text/javascript">
function spinner() {
var opts = {
lines: 10, // The number of lines to draw
length: 7, // The length of each line
width: 4, // The line thickness
radius: 10, // The radius of the inner circle
corners: 1, // Corner roundness (0..1)
rotate: 0, // The rotation offset
color: '#000', // #rgb or #rrggbb
opacity: 0.45, // Opacity of the lines
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: '50%', // Top position relative to parent
left: '50%', // Left position relative to parent
position: 'fixed', // Element positioning
};
var target = document.getElementById('spinner_main');
var spinner = new Spinner(opts).spin(target);
$('#spinner_overlay').show();
}
</script>
<div id="spinner_main"></div>
<div id="spinner_overlay" style="display: none; background-color: black; position: fixed; left:0; top:0; height:100%; width:100%; opacity: 0.25;"></div>
<!-- end of spinner -->

View File

@@ -126,29 +126,10 @@ if (isset($_POST['ext_update']) && $_POST['ext_update']) {
else { $input_errors[] = sprintf(gettext("Download of installation file %s failed, installation aborted!"), "onebuttoninstaller-install.php"); }
}
include("fbegin.inc");?>
<script type="text/javascript">
function spinner() {
var opts = {
lines: 10, // The number of lines to draw
length: 7, // The length of each line
width: 4, // The line thickness
radius: 10, // The radius of the inner circle
corners: 1, // Corner roundness (0..1)
rotate: 0, // The rotation offset
color: '#000', // #rgb or #rrggbb
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
};
var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);
}
</script>
<div id="foo">
<!-- The Spinner Elements -->
<?php include("ext/onebuttoninstaller/spinner.inc");?>
<script src="ext/onebuttoninstaller/spin.min.js"></script>
<!-- use: onsubmit="spinner()" within the form tag -->
<form action="onebuttoninstaller-update_extension.php" method="post" name="iform" id="iform" onsubmit="spinner()">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
@@ -196,4 +177,3 @@ function spinner() {
</table>
</form>
<?php include("fend.inc");?>
</div> <!-- foo -->

View File

@@ -86,16 +86,9 @@ function log_display($loginfo) {
* name: 0 extension name
* version: 1 extension version (base for config entry - could change for newer versions)
* xmlstring: 2 config.xml or installation directory
* command(list)1: 3 SHELL commands
* command(list)2: 4 PHP commands
* command(list)1: 3 execution of SHELL commands / scripts (e.g. download installer, untar, chmod, ...)
* command(list)2: 4 empty ("-") or PHP script name (file MUST exist)
* description: 5 plain text which can include HTML tags
*/
/* DEBUGGER
print_r($result[3]);
echo('<br />');
print_r($result[4]);
echo('<br />');
*/
// Create table data
@@ -106,13 +99,14 @@ echo('<br />');
echo "<tr valign=\"top\">\n";
for ($i = 0; $i < count($loginfo['columns']); $i++) { // handle pmids (columns)
if ($i == count($loginfo['columns']) - 1) {
// check if extension is already installed (config.xml entry or for command line tools based on install directory)
// 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]}")))){
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}'> <img src='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']}'>
<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]."' />
<input type='hidden' name='name[".$j."][command2]' value='".$result[4]."' />
</td>\n";
@@ -125,74 +119,49 @@ echo('<br />');
}
}
//ob_start();
//$ausgabe = ob_get_contents();
//ob_end_clean();
//foreach ($ausgabe as $msg) $savemsg .= $msg."<br />";
if (isset($_POST) && $_POST) {
foreach($_POST[name] as $line) {
if (isset($_POST['install'], $_POST['name'])) {
foreach($_POST['name'] as $line) {
if (isset($line['extension'])) {
$savemsg .= "<b>{$line['extension']}</b>"."<br />";
$savemsg .= print_r($line, true)."<br />";
$savemsg .= gettext("Installation").": <b>{$line['truename']}</b>"."<br />";
unset($result);
exec("cd {$config["onebuttoninstaller"]["storage_path"]} && {$line['command1']}", $result, $return_val);
if ($return_val == 0) {
$savemsg .= "<b>command1 successful</b>"."<br />";
foreach ($result as $msg) $savemsg .= $msg."<br />";
foreach ($result as $msg) $savemsg .= $msg."<br />"; // output on success
unset($result);
// exec("cd {$config["onebuttoninstaller"]["storage_path"]} && {$line['command2']}", $result, $return_val);
// if (file_exists("{$config["onebuttoninstaller"]["storage_path"]}/{$line['command2']}")) {
if ("{$line['command2']}" != "-") {
ob_start();
require_once("{$config['onebuttoninstaller']['storage_path']}/{$line['command2']}");
ob_end_clean();
if ($return_val == 0) {
$savemsg .= "<br />"."<b>command2 successful</b>"."<br />";
// foreach ($result as $msg) $savemsg .= $msg."<br />";
}
else {
$errormsg .= gettext("Error")."<br />";
// foreach ($result as $msg) $errormsg .= $msg."<br />";
$savemsg .= "<b>command2 NOT successful</b>"."<br />";
if ("{$line['command2']}" != "-") { // check if a PHP script must be executed
if (file_exists("{$config["onebuttoninstaller"]["storage_path"]}/{$line['command2']}")) {
$savemsg_old = $savemsg; // save messages for use after output buffering ends
ob_start(); // start output buffering
include("{$config['onebuttoninstaller']['storage_path']}/{$line['command2']}");
$ausgabe = ob_get_contents(); // get outputs from include command
ob_end_clean(); // close output buffering
$savemsg = $savemsg_old; // recover saved messages ...
$savemsg .= str_replace("\n", "<br />", $ausgabe)."<br />"; // ... and append messages from include command
}
else $errormsg .= sprintf(gettext("PHP script %s not found!"), "{$config["onebuttoninstaller"]["storage_path"]}/{$line['command2']}")."<br />";
}
// else $errormsg .= "Error: file {$config["onebuttoninstaller"]["storage_path"]}/{$line['command2']} not found!"."<br />";
}
else {
$errormsg .= gettext("Error on command1")."<br />";
} // EOcommand1 OK
else { // throw error message for command1
$errormsg .= gettext("Installation error").": <b>{$line['truename']}</b>"."<br />";
foreach ($result as $msg) $errormsg .= $msg."<br />";
$savemsg .= "<b>command1 NOT successful</b>"."<br />";
}
}
}
}
} // EOcommand1 NOK
} // EOisset line
} // EOforeach
} // EOinstall
if (!is_file("{$config['onebuttoninstaller']['rootfolder']}extensions.txt")) $savemsg .= sprintf(gettext("File %s not found!"), "{$config['onebuttoninstaller']['rootfolder']}extensions.txt");
if (isset($_POST['update'])) {
$return_val = mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}extensions.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/extensions.txt", true);
if ($return_val == 0) $savemsg .= gettext("New extensions list successfully downloaded!")."<br />";
else $errormsg .= gettext("Unable to retrieve extensions list from server!")."<br />";
} // EOupdate
if (!is_file("{$config['onebuttoninstaller']['rootfolder']}extensions.txt")) $errormsg .= sprintf(gettext("File %s not found!"), "{$config['onebuttoninstaller']['rootfolder']}extensions.txt")."<br />";
include("fbegin.inc");?>
<script type="text/javascript">
function spinner() {
var opts = {
lines: 10, // The number of lines to draw
length: 7, // The length of each line
width: 4, // The line thickness
radius: 10, // The radius of the inner circle
corners: 1, // Corner roundness (0..1)
rotate: 0, // The rotation offset
color: '#000', // #rgb or #rrggbb
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
};
var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);
}
</script>
<div id="foo">
<!-- The Spinner Elements -->
<?php include("ext/onebuttoninstaller/spinner.inc");?>
<script src="ext/onebuttoninstaller/spin.min.js"></script>
<!-- use: onsubmit="spinner()" within the form tag -->
<form action="onebuttoninstaller.php" method="post" name="iform" id="iform" onsubmit="spinner()">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
@@ -204,8 +173,8 @@ function spinner() {
</ul>
</td></tr>
<tr><td class="tabcont">
<?php if (!empty($errormsg)) print_error_box($errormsg);?>
<?php if (!empty($savemsg)) print_info_box($savemsg);?>
<?php if (!empty($errormsg)) print_error_box($errormsg);?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php
log_display($loginfo[$log]);
@@ -220,4 +189,3 @@ function spinner() {
</table>
</form>
<?php include("fend.inc");?>
</div> <!-- foo -->

View File

@@ -1,5 +1,5 @@
Extended GUI###0.5.1.2###extended-gui###mkdir -p extended-gui/backup && mkdir -p extended-gui/log && cd extended-gui && fetch https://raw.github.com/crestAT/nas4free-extended-gui/master/extended-gui/extended-gui-install.php && chmod 770 extended-gui*install.php && echo "fetch OK"###extended-gui/extended-gui-install.php###Extension for NAS4Free with several improvements for the WebGUI and additional functions. Most of the extension affects STATUS | SYSTEM view but also STATUS | GRAPH and DIAGNOSTICS | LOG which got a new entry NOTIFICATIONS.<br><br>The extension works on all plattforms (x86 & x64, ARM, embedded & full), does not need jail or pkg_add, enhance pages of the NAS4Free WebGUI, features configuration and extension maintenance (update & removal inside the WebGUI), let you switch between STANDARD (original) and EXTENDED WebGUI view and let you easily configure/enable/disable views and additional functions.<br>For more information -> <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=6405' target='_blank'>NAS4Free Forum</a>
Downloady###0.1###downloady###mkdir -p downloady/log && cd downloady && ls -hal && fetch -v https://raw.github.com/crestAT/nas4free-downloady/master/downloady/downloady-install.php && chmod 770 downloady*install.php && echo "fetch OK"###downloady/downloady-install.php###Simple PHP download manager which is fully integrated into the NAS4Free WebGUI.<br><br>Downloady for NAS4Free is based on Downloady - the PHP Download Manager by CyberLeo@cyberLeo Projects and features downloads from http, https and ftp sites as well as download bandwith managment, resume downloads after system startup and a simple scheduler. The extension works on all plattforms (x86 & x64, ARM, embedded & full), does not need jail or pkg_add, enhance pages of the NAS4Free WebGUI and features configuration and extension maintenance.
Downloady###0.1###downloady###mkdir -p downloady/log && cd downloady && fetch -v https://raw.github.com/crestAT/nas4free-downloady/master/downloady/downloady-install.php && chmod 770 downloady*install.php && echo "fetch OK"###downloady/downloady-install.php###Simple PHP download manager which is fully integrated into the NAS4Free WebGUI.<br><br>Downloady for NAS4Free is based on Downloady - the PHP Download Manager by CyberLeo@cyberLeo Projects and features downloads from http, https and ftp sites as well as download bandwith managment, resume downloads after system startup and a simple scheduler. The extension works on all plattforms (x86 & x64, ARM, embedded & full), does not need jail or pkg_add, enhance pages of the NAS4Free WebGUI and features configuration and extension maintenance.
RRDGraphs###0.3.1###rrdgraphs###mkdir -p rrdgraphs && cd rrdgraphs && fetch https://raw.github.com/crestAT/nas4free-rrdtool/master/rrdgraphs/rrd-install.php && chmod 770 rrd*install.php && echo "fetch OK"###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>For more information -> <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=8299' target='_blank'>NAS4Free Forum</a>
BitTorrent Sync###0.6.4.2###btsync###mkdir -p btsync && cd btsync && fetch https://raw.github.com/crestAT/nas4free-bittorrent-sync/master/bts-install.php && chmod 770 bts*install.php && echo "fetch OK"###btsync/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><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.<br>For more information -> <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=5704' target='_blank'>NAS4Free Forum</a>
Syncthing###0.1.3###syncthing###mkdir -p syncthing && cd syncthing && fetch https://raw.github.com/crestAT/nas4free-syncthing/master/stg-install.php && chmod 770 stg*install.php && echo "fetch OK"###syncthing/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>For more information -> <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=7821' target='_blank'>NAS4Free Forum</a>
@@ -10,4 +10,4 @@ DNSMasq DHCP Server###0.2###dnsmasq###mkdir -p dnsmasq && cd dnsmasq && fetch ht
Midnight Commander###2015-02-21###/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>For more information -> <a href='http://forums.nas4free.org/viewtopic.php?f=70&t=187' target='_blank'>NAS4Free Forum</a>
zzz Dummy Project1###1.0###DummyProject###fetch https://raw.github.com/crestAT/nas4free-extended-gui/master/extended-gui_install.php && chmod 770 extended-gui*install.php && echo "fetch OK"###cat TEST/release_notes.txt && echo "\nFERTIG bin ich\n" && chmod 770 TEST/test.sh && TEST/test.sh###<font size="5" color="blue">This is a testbed for NAS4Free extensions!!!</font><br><b>Note: </b><font size="3" color="red">Don't use this extension!!!</font>
zzz WebGUI Themes###6.6###themes###command1 themes ### command2 themes ### blah blah blah blah blah
zzz RSS Feeder###x.y.z###rssfeed###command1 rssfeed ### command2 rssfeed ### blah blah blah blah blah
zzz RSS Feeder###x.y.z###rssfeed###echo "rssfeed com1" && echo "rssfeed OK"###zzz.php### blah blah blah blah blah

View File

@@ -31,11 +31,14 @@
*/
/*
Version Date Description
0.1-b1 2016.01.28 real install/update from GitHub
0.1-a6 2016.01.28 include spinner with overlay
0.1-a5 2016.01.27 output buffering working now
0.1-a4 2016.01.25 initial release
0.1-a1 2016.01.16 initial release
*/
$v = "0.1-a4"; // extension version
$v = "0.1-b1"; // extension version
$appname = "OneButtonInstaller";
require_once("config.inc");
@@ -50,7 +53,6 @@ global $input_errors;
global $savemsg;
$install_dir = dirname(__FILE__)."/"; // get directory where the installer script resides
if (!is_dir("{$install_dir}/backup")) { mkdir("{$install_dir}/backup", 0775, true); }
if (!is_dir("{$install_dir}/log")) { mkdir("{$install_dir}/log", 0775, true); }
// check FreeBSD release for fetch options >= 9.3
@@ -60,11 +62,11 @@ else $verify_hostname = "";
// create stripped version name
$vs = str_replace(".", "", $v);
// fetch release archive
$return_val = 0;//mwexec("fetch {$verify_hostname} -vo {$install_dir}master.zip 'https://github.com/crestAT/nas4free-onebuttoninstaller/releases/download/{$v}/onebuttoninstaller-{$vs}.zip'", true);
$return_val = mwexec("fetch {$verify_hostname} -vo {$install_dir}master.zip 'https://github.com/crestAT/nas4free-onebuttoninstaller/releases/download/{$v}/onebuttoninstaller-{$vs}.zip'", true);
if ($return_val == 0) {
$return_val = 0;//mwexec("tar -xf {$install_dir}master.zip -C {$install_dir} --exclude='.git*' --strip-components 2", true);
$return_val = mwexec("tar -xf {$install_dir}master.zip -C {$install_dir} --exclude='.git*' --strip-components 2", true);
if ($return_val == 0) {
// exec("rm {$install_dir}master.zip");
exec("rm {$install_dir}master.zip");
exec("chmod -R 775 {$install_dir}");
if (is_file("{$install_dir}version.txt")) { $file_version = exec("cat {$install_dir}version.txt"); }
else { $file_version = "n/a"; }

View File

@@ -1 +1 @@
0.1-a4
0.1-b1

View File

@@ -7,7 +7,7 @@ $release = explode("-", exec("uname -r"));
if ($release[0] >= 9.3) $verify_hostname = "--no-verify-hostname";
else $verify_hostname = "";
$return_val = 0;//mwexec("fetch {$verify_hostname} -vo onebuttoninstaller/onebuttoninstaller-install.php 'https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/onebuttoninstaller-install.php'", true);
$return_val = mwexec("fetch {$verify_hostname} -vo onebuttoninstaller/onebuttoninstaller-install.php 'https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/onebuttoninstaller-install.php'", true);
if ($return_val == 0) {
chmod("onebuttoninstaller/onebuttoninstaller-install.php", 0775);
require_once("onebuttoninstaller/onebuttoninstaller-install.php");