forked from Mirrors/nas4free-onebuttoninstaller
Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f24d37890 | |||
| d840baeea2 | |||
| b85fe5f9e6 | |||
| e65767fd32 | |||
|
|
a902200644 | ||
|
|
d74178de46 | ||
|
|
a559b07deb | ||
|
|
b4ea21f188 | ||
|
|
8783c3b9e7 | ||
|
|
055a40fb85 | ||
|
|
ea6d38e606 | ||
|
|
0b9bce1bbf | ||
|
|
cdae93c40b | ||
|
|
4c65214d5e | ||
|
|
27a345b161 | ||
|
|
02f3d0e54b | ||
|
|
634baa08f7 | ||
|
|
67fef6d504 | ||
|
|
c160148867 | ||
|
|
6fc28413a4 | ||
|
|
537e47d185 | ||
|
|
436cdc8007 | ||
|
|
696e2768f2 | ||
|
|
83f6711b2b | ||
|
|
805071a104 | ||
|
|
1ba4dbceb9 | ||
|
|
7a8016176d | ||
|
|
535e73b3b4 | ||
|
|
98f5593f45 | ||
|
|
513cec5256 | ||
|
|
a4d27c34c3 | ||
|
|
850a73a0b4 | ||
|
|
4c5ea3ab16 | ||
|
|
8e15be5ad5 | ||
|
|
c4fd186662 | ||
|
|
35b9cee955 | ||
|
|
eae7031298 | ||
|
|
f0d035866a | ||
|
|
d71d4b77a6 | ||
|
|
33aad8d171 | ||
|
|
c9dcb9e1c6 | ||
|
|
ad45a13fb9 | ||
|
|
a7807fd115 | ||
|
|
a7166fcb33 | ||
|
|
9431f59704 | ||
|
|
7b15775f15 | ||
|
|
cd7b98b5ae | ||
|
|
7169a5df11 | ||
|
|
afac4582a3 | ||
|
|
e13d0697aa | ||
|
|
e099e6a1a3 | ||
|
|
5dce9f59a5 | ||
|
|
5dd9f9b9d7 | ||
|
|
537f0d1e35 | ||
|
|
e436f7b6f0 | ||
|
|
f9c222824e | ||
|
|
7deac353e3 | ||
|
|
b620e047a2 | ||
|
|
d8e1934620 | ||
|
|
60442895f6 | ||
|
|
45a7f7ca05 | ||
|
|
7042e5958a | ||
|
|
d07c88c4c4 | ||
|
|
4659cb77cb | ||
|
|
3405a8b116 | ||
|
|
2c7cfd1c2b | ||
|
|
b9f2003020 | ||
|
|
4019d157d9 | ||
|
|
96081af83e | ||
|
|
c0fae3308d | ||
|
|
4fd79c7566 | ||
|
|
bd93001678 | ||
|
|
2eff3da6a6 | ||
|
|
57933c9359 | ||
|
|
d9a2d132b3 |
17
.gitattributes
vendored
17
.gitattributes
vendored
@@ -1,17 +0,0 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
47
.gitignore
vendored
47
.gitignore
vendored
@@ -1,47 +0,0 @@
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# =========================
|
||||
# Operating System Files
|
||||
# =========================
|
||||
|
||||
# OSX
|
||||
# =========================
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
25
LICENSE.txt
Normal file
25
LICENSE.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
12
OBI.php
12
OBI.php
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
OBI.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -24,10 +24,6 @@
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
require("auth.inc");
|
||||
require("guiconfig.inc");
|
||||
@@ -37,6 +33,10 @@ $pgtitle = array(gettext("Extensions"), gettext($application), gettext("Configur
|
||||
|
||||
if (!isset($config['onebuttoninstaller']) || !is_array($config['onebuttoninstaller'])) $config['onebuttoninstaller'] = array();
|
||||
|
||||
$platform = $g['platform'];
|
||||
if ($platform == "livecd" || $platform == "liveusb")
|
||||
$input_errors[] = sprintf(gettext("Attention: the used XigmaNAS platform '%s' is not recommended for extensions! After a reboot all extensions will no longer be available, use XigmaNAS embedded or full platform instead!"), $platform);
|
||||
|
||||
/* Check if the directory exists, the mountpoint has at least o=rx permissions and
|
||||
* set the permission to 775 for the last directory in the path
|
||||
*/
|
||||
@@ -85,7 +85,7 @@ if (isset($_POST['save']) && $_POST['save']) {
|
||||
$config['onebuttoninstaller']['path_check'] = isset($_POST['path_check']) ? true : false;
|
||||
$install_dir = $config['onebuttoninstaller']['storage_path']."/"; // get directory where the installer script resides
|
||||
if (!is_dir("{$install_dir}onebuttoninstaller/log")) { mkdir("{$install_dir}onebuttoninstaller/log", 0775, true); }
|
||||
$return_val = mwexec("fetch {$verify_hostname} -vo {$install_dir}onebuttoninstaller/onebuttoninstaller-install.php 'https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/onebuttoninstaller-install.php'", true);
|
||||
$return_val = mwexec("fetch {$verify_hostname} -vo {$install_dir}onebuttoninstaller/onebuttoninstaller-install.php 'https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/onebuttoninstaller-install.php'", false);
|
||||
if ($return_val == 0) {
|
||||
chmod("{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php", 0775);
|
||||
require_once("{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php");
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
OneButtonInstaller
|
||||
------------------
|
||||
|
||||
Description in the NAS4Free forum -> <a href="http://forums.nas4free.org/viewtopic.php?f=71&t=11189">OneButtonInstaller</a>
|
||||
|
||||
Please visit the XigmaNAS forum for full description and installation guide -> <a href="https://www.xigmanas.com/forums/viewtopic.php?f=71&t=11189">OneButtonInstaller</a>
|
||||
|
||||
67
onebuttoninstaller/apps/fail2ban.postinit
Normal file
67
onebuttoninstaller/apps/fail2ban.postinit
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/*
|
||||
fail2ban.postinit
|
||||
|
||||
Copyright (c) 2015 - 2018 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
$command = "fail2ban_start.sh";
|
||||
$cmd = dirname(__FILE__)."/".$command;
|
||||
require_once("config.inc");
|
||||
|
||||
// remove start/stop commands
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param']['0'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// check FreeBSD release
|
||||
$release = explode("-", exec("uname -r"));
|
||||
|
||||
if ($release[0] >= 11.0) { // new rc format
|
||||
// postinit command
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "Fail2Ban Extension";
|
||||
$rc_param['value'] = "{$cmd}";
|
||||
$rc_param['comment'] = "Start Fail2Ban";
|
||||
$rc_param['typeid'] = '2';
|
||||
$rc_param['enable'] = true;
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
}
|
||||
else {
|
||||
$config['rc']['postinit']['cmd'][] = "{$cmd}";
|
||||
}
|
||||
write_config();
|
||||
?>
|
||||
44
onebuttoninstaller/apps/htop-start.php
Normal file
44
onebuttoninstaller/apps/htop-start.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
htop-start.php
|
||||
|
||||
Copyright (c) 2018 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
require_once("config.inc");
|
||||
require_once("/usr/local/www/ext/onebuttoninstaller/extension-lib.inc");
|
||||
$rootfolder = dirname(__FILE__);
|
||||
|
||||
$return_val = 0;
|
||||
|
||||
$pkgName = "htop";
|
||||
$pkgFileNameNeeded = $pkgName;
|
||||
$manifest = ext_load_package($pkgName, $pkgFileNameNeeded, $rootfolder);
|
||||
$return_val += mwexec("mkdir -p /usr/local/share/pixmaps", true);
|
||||
$return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}/usr/local/bin/htop' /usr/local/bin", true);
|
||||
$return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}/usr/local/share/pixmaps/htop.png' /usr/local/share/pixmaps", true);
|
||||
|
||||
if ($return_val == 0) mwexec("logger {$pkgName}-extension: started successfully");
|
||||
else mwexec("logger {$pkgName}-extension: error(s) during startup, failed with return value = {$return_val}");
|
||||
echo "RETVAL = {$return_val}\n";
|
||||
?>
|
||||
70
onebuttoninstaller/apps/htop.postinit
Normal file
70
onebuttoninstaller/apps/htop.postinit
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*
|
||||
universal postinit file for CLI extensions
|
||||
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
require_once("config.inc");
|
||||
|
||||
$appName = "Htop";
|
||||
$command = "htop-start.php";
|
||||
$cmd = dirname(__FILE__)."/{$command}";
|
||||
|
||||
// remove start/stop commands
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param']['0'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// check FreeBSD release
|
||||
$release = explode("-", exec("uname -r"));
|
||||
|
||||
if ($release[0] >= 11.0) { // new rc format
|
||||
// postinit command
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "{$appName} Extension";
|
||||
$rc_param['value'] = "php {$cmd}";
|
||||
$rc_param['comment'] = "Start {$appName}";
|
||||
$rc_param['typeid'] = '2';
|
||||
$rc_param['enable'] = true;
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
}
|
||||
else {
|
||||
$config['rc']['postinit']['cmd'][] = "php {$cmd}";
|
||||
}
|
||||
write_config();
|
||||
require_once($cmd);
|
||||
?>
|
||||
67
onebuttoninstaller/apps/mc-start.php
Normal file
67
onebuttoninstaller/apps/mc-start.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/*
|
||||
mc-start.php
|
||||
|
||||
Copyright (c) 2018 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
require_once("config.inc");
|
||||
require_once("/usr/local/www/ext/onebuttoninstaller/extension-lib.inc");
|
||||
$rootfolder = dirname(__FILE__);
|
||||
|
||||
$return_val = 0;
|
||||
|
||||
$pkgName = "mc";
|
||||
$pkgFileNameNeeded = "free Norton Commander";
|
||||
$manifest = ext_load_package($pkgName, $pkgFileNameNeeded, $rootfolder);
|
||||
$return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}/usr/local/share/mc' /usr/local/share", true);
|
||||
$return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}/usr/local/libexec/mc' /usr/local/libexec", true);
|
||||
$return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}/usr/local/etc/mc' /usr/local/etc", true);
|
||||
foreach ($manifest['files'] as $mFKey => $mFValue) {
|
||||
if (strpos($mFKey, "usr/local/bin") > 0) $return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}{$mFKey}' '{$mFKey}'", true);
|
||||
// if (strpos($mFKey, "usr/local/lib") > 0) $return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}{$mFKey}' '{$mFKey}'", true);
|
||||
if (strpos($mFKey, "LC_MESSAGES") > 0) {
|
||||
$localeDir = dirname($mFKey);
|
||||
if (!file_exists($localeDir)) $return_val += mwexec("mkdir -p '{$localeDir}'", true);
|
||||
$return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}{$mFKey}' '{$mFKey}'", true);
|
||||
}
|
||||
}
|
||||
|
||||
$pkgName = "libslang2";
|
||||
$pkgFileNameNeeded = $pkgName;
|
||||
$manifest = ext_load_package($pkgName, $pkgFileNameNeeded, $rootfolder);
|
||||
foreach ($manifest['files'] as $mFKey => $mFValue) {
|
||||
if (strpos($mFKey, "usr/local/lib/libslang.so.2") > 0) $return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}{$mFKey}' '{$mFKey}'", true);
|
||||
}
|
||||
|
||||
$pkgName = "libssh2";
|
||||
$pkgFileNameNeeded = "^libssh2";
|
||||
$manifest = ext_load_package($pkgName, $pkgFileNameNeeded, $rootfolder);
|
||||
foreach ($manifest['files'] as $mFKey => $mFValue) {
|
||||
if (strpos($mFKey, "usr/local/lib/libssh2.so.1") > 0) $return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}{$mFKey}' '{$mFKey}'", true);
|
||||
}
|
||||
|
||||
if ($return_val == 0) mwexec("logger midnightcommander-extension: started successfully");
|
||||
else mwexec("logger midnightcommander-extension: error(s) during startup, failed with return value = {$return_val}");
|
||||
echo "RETVAL = {$return_val}\n";
|
||||
?>
|
||||
70
onebuttoninstaller/apps/mcommander.postinit
Normal file
70
onebuttoninstaller/apps/mcommander.postinit
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*
|
||||
universal postinit file for CLI extensions
|
||||
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
require_once("config.inc");
|
||||
|
||||
$appName = "Midnight Commander";
|
||||
$command = "mc-start.php";
|
||||
$cmd = dirname(__FILE__)."/{$command}";
|
||||
|
||||
// remove start/stop commands
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param']['0'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// check FreeBSD release
|
||||
$release = explode("-", exec("uname -r"));
|
||||
|
||||
if ($release[0] >= 11.0) { // new rc format
|
||||
// postinit command
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "{$appName} Extension";
|
||||
$rc_param['value'] = "php {$cmd}";
|
||||
$rc_param['comment'] = "Start {$appName}";
|
||||
$rc_param['typeid'] = '2';
|
||||
$rc_param['enable'] = true;
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
}
|
||||
else {
|
||||
$config['rc']['postinit']['cmd'][] = "php {$cmd}";
|
||||
}
|
||||
write_config();
|
||||
require_once($cmd);
|
||||
?>
|
||||
@@ -11,6 +11,8 @@
|
||||
# date: 2014-12-18 ; Update for v9.3; Clean up
|
||||
# date: 2015-02-21 ; Update mc package to mc-4.8.11.tbz
|
||||
# date: 2016-08-04 ; check hardware platform to use it on i386 too - author: crest <info@a3s.at>
|
||||
# date: 2016-11-21 ; create symlinks for v11.x compatibility - author: crest <info@a3s.at>
|
||||
#
|
||||
# purpose: Install Midnight Commander on NAS4Free (embedded version).
|
||||
# Note: Check the end of the page.
|
||||
#
|
||||
@@ -82,6 +84,9 @@ cd /usr/local/lib
|
||||
[ -e libpcre.so.3 ] || ln -s /usr/local/lib/libpcre.so.1 libpcre.so.3
|
||||
[ -e libintl.so.9 ] || ln -s /usr/local/lib/libintl.so.8 libintl.so.9
|
||||
[ -e libiconv.so.3 ] || ln -s /usr/local/lib/libiconv.so.2 libiconv.so.3
|
||||
# Symlinks for v11.x
|
||||
if [ -e /usr/lib/libssl.so.8 ]; then ln -sf /usr/lib/libssl.so.8 libssl.so.6; fi
|
||||
if [ -e /lib/libcrypto.so.8 ]; then ln -sf /lib/libcrypto.so.8 libcrypto.so.6; fi
|
||||
cd -
|
||||
|
||||
# Aliases
|
||||
42
onebuttoninstaller/apps/ncdu-start.php
Normal file
42
onebuttoninstaller/apps/ncdu-start.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/*
|
||||
ncdu-start.php
|
||||
|
||||
Copyright (c) 2018 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
require_once("config.inc");
|
||||
require_once("/usr/local/www/ext/onebuttoninstaller/extension-lib.inc");
|
||||
$rootfolder = dirname(__FILE__);
|
||||
|
||||
$return_val = 0;
|
||||
|
||||
$pkgName = "ncdu";
|
||||
$pkgFileNameNeeded = $pkgName;
|
||||
$manifest = ext_load_package($pkgName, $pkgFileNameNeeded, $rootfolder);
|
||||
$return_val += mwexec("ln -sf '{$rootfolder}/bin/{$pkgName}/usr/local/bin/ncdu' /usr/local/bin", true);
|
||||
|
||||
if ($return_val == 0) mwexec("logger {$pkgName}-extension: started successfully");
|
||||
else mwexec("logger {$pkgName}-extension: error(s) during startup, failed with return value = {$return_val}");
|
||||
echo "RETVAL = {$return_val}\n";
|
||||
?>
|
||||
70
onebuttoninstaller/apps/ncdu.postinit
Normal file
70
onebuttoninstaller/apps/ncdu.postinit
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*
|
||||
universal postinit file for CLI extensions
|
||||
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
require_once("config.inc");
|
||||
|
||||
$appName = "NCurses Disk Usage";
|
||||
$command = "ncdu-start.php";
|
||||
$cmd = dirname(__FILE__)."/{$command}";
|
||||
|
||||
// remove start/stop commands
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param']['0'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// check FreeBSD release
|
||||
$release = explode("-", exec("uname -r"));
|
||||
|
||||
if ($release[0] >= 11.0) { // new rc format
|
||||
// postinit command
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "{$appName} Extension";
|
||||
$rc_param['value'] = "php {$cmd}";
|
||||
$rc_param['comment'] = "Start {$appName}";
|
||||
$rc_param['typeid'] = '2';
|
||||
$rc_param['enable'] = true;
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
}
|
||||
else {
|
||||
$config['rc']['postinit']['cmd'][] = "php {$cmd}";
|
||||
}
|
||||
write_config();
|
||||
require_once($cmd);
|
||||
?>
|
||||
45
onebuttoninstaller/apps/ncdu.sh
Normal file
45
onebuttoninstaller/apps/ncdu.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
# filename: ncdu.sh
|
||||
# author: Graham Inggs
|
||||
# date: 2018-05-24 ; Initial release for NAS4Free 11.1.0.4
|
||||
# purpose: Install NCurses Disk Usage (ncdu) on NAS4Free (embedded version).
|
||||
# Note: Check the end of the page.
|
||||
#
|
||||
#----------------------- Set variables ------------------------------------------------------------------
|
||||
DIR=`dirname $0`;
|
||||
PLATFORM=`uname -m`
|
||||
RELEASE=`uname -r | cut -d- -f1`
|
||||
REL_MAJOR=`echo $RELEASE | cut -d. -f1`
|
||||
REL_MINOR=`echo $RELEASE | cut -d. -f2`
|
||||
#URL="http://distcache.freebsd.org/FreeBSD:${REL_MAJOR}:${PLATFORM}/release_${REL_MINOR}/All"
|
||||
URL="http://distcache.freebsd.org/FreeBSD:${REL_MAJOR}:${PLATFORM}/release_1/All"
|
||||
NCDUFILE="ncdu-1.12.txz"
|
||||
#----------------------- Set Errors ---------------------------------------------------------------------
|
||||
_msg() { case $@ in
|
||||
0) echo "The script will exit now."; exit 0 ;;
|
||||
1) echo "No route to server, or file do not exist on server"; _msg 0 ;;
|
||||
2) echo "Can't find ${FILE} on ${DIR}"; _msg 0 ;;
|
||||
3) echo "NCurses Disk Usage installed and ready! (ONLY USE DURING A SSH SESSION)"; exit 0 ;;
|
||||
4) echo "Always run this script using the full path: /mnt/.../directory/ncdu.sh"; _msg 0 ;;
|
||||
esac ; exit 0; }
|
||||
#----------------------- Check for full path ------------------------------------------------------------
|
||||
if [ ! `echo $0 |cut -c1-5` = "/mnt/" ]; then _msg 4; fi
|
||||
cd $DIR;
|
||||
#----------------------- Download and decompress ncdu files if needed -----------------------------------
|
||||
FILE=${NCDUFILE}
|
||||
if [ ! -d ${DIR}/usr/local/bin ]; then
|
||||
if [ ! -e ${DIR}/${FILE} ]; then fetch ${URL}/${FILE} || _msg 1; fi
|
||||
if [ -f ${DIR}/${FILE} ]; then tar xzf ${DIR}/${FILE} || _msg 2;
|
||||
rm ${DIR}/+*; rm -R ${DIR}/usr/local/man; rm -R ${DIR}/usr/local/share; fi
|
||||
if [ ! -d ${DIR}/usr/local/bin ] ; then _msg 4; fi
|
||||
fi
|
||||
#----------------------- Create symlinks ----------------------------------------------------------------
|
||||
for i in `ls $DIR/usr/local/bin/`
|
||||
do if [ ! -e /usr/local/bin/${i} ]; then ln -s ${DIR}/usr/local/bin/$i /usr/local/bin; fi; done
|
||||
_msg 3 ; exit 0;
|
||||
#----------------------- End of Script ------------------------------------------------------------------
|
||||
# 1. Keep this script in its own directory.
|
||||
# 2. chmod the script u+x,
|
||||
# 3. Always run this script using the full path: /mnt/.../directory/ncdu.sh
|
||||
# 4. You can add this script to WebGUI: Advanced: Command Scripts as a PostInit command (see 3).
|
||||
# 5. To run Ncurses Disk Usage from shell type 'ncdu'.
|
||||
44
onebuttoninstaller/apps/show-MANIFEST.php
Normal file
44
onebuttoninstaller/apps/show-MANIFEST.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
show-MANIFEST.php
|
||||
|
||||
Copyright (c) 2018 - 2019 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
if (!function_exists('ext_load_config')) {
|
||||
function ext_load_config($config_file, $assoc = true, $depth = 512, $options = 0) {
|
||||
if (is_file($config_file)) {
|
||||
if (($config_data = file_get_contents($config_file)) === false) return false;
|
||||
$config_data = json_decode($config_data, $assoc, $depth, $options);
|
||||
return $config_data;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
|
||||
$fileName = $argv[1];
|
||||
echo "Show '{$fileName}':\n";
|
||||
if (($manifest = ext_load_config($fileName)) !== false) print_r($manifest);
|
||||
else echo "File '{$fileName}' not found!\n";
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
$command = "fail2ban_start.sh";
|
||||
$cmd = dirname(__FILE__)."/".$command;
|
||||
require_once("config.inc");
|
||||
require_once("functions.inc");
|
||||
if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
|
||||
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); $i++) {
|
||||
if (preg_match("/$command/", $config['rc']['postinit']['cmd'][$i])) break; }
|
||||
}
|
||||
$config['rc']['postinit']['cmd'][$i] = $config['cmd']."$cmd";
|
||||
write_config();
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
$command = "mcommander.sh";
|
||||
$cmd = dirname(__FILE__)."/".$command;
|
||||
require_once("config.inc");
|
||||
require_once("functions.inc");
|
||||
if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
|
||||
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); $i++) {
|
||||
if (preg_match("/$command/", $config['rc']['postinit']['cmd'][$i])) break; }
|
||||
}
|
||||
$config['rc']['postinit']['cmd'][$i] = $config['cmd']."$cmd";
|
||||
write_config();
|
||||
?>
|
||||
234
onebuttoninstaller/ext/extension-lib.inc
Normal file
234
onebuttoninstaller/ext/extension-lib.inc
Normal file
@@ -0,0 +1,234 @@
|
||||
<?php
|
||||
/*
|
||||
extension-lib.inc
|
||||
|
||||
Copyright (c) 2016 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
$extension_lib_version = "1.4";
|
||||
/* Version history:
|
||||
* 1.4 2019.05.14 new function ext_load_package
|
||||
* 1.3 2018.12.01 function ext_load_config: removed -> $config_data = utf8_encode($config_data); reason: wrong national character encoding
|
||||
* 1.2 2018.08.13 function ext_check_version: append line break to the output message
|
||||
* 1.1 2017.02.28 save config in ext_remove_rc_commands and ext_create_rc_commands
|
||||
* 1.0 2017.02.27 includes changes for PHP 7.1
|
||||
*/
|
||||
|
||||
/* function ext_load_package
|
||||
* load packages and compare already installed packages for updates
|
||||
* params:
|
||||
* $pkgName: plain package name
|
||||
* $pkgFileNameNeeded: unique string for pkg search to retrive the right package
|
||||
* $rootfolder: extension root location
|
||||
* return:
|
||||
* package manifest array
|
||||
*/
|
||||
if (!function_exists('ext_load_package')) {
|
||||
function ext_load_package($pkgName, $pkgFileNameNeeded, $rootfolder) {
|
||||
if (($manifest = ext_load_config("{$rootfolder}/bin/{$pkgName}/+MANIFEST")) !== false) $pkgInstalledVersion = "{$manifest['name']}-{$manifest['version']}"; // currently installed pkg
|
||||
else {
|
||||
$pkgNeeded = exec("pkg search {$pkgName} | awk '/{$pkgFileNameNeeded}/ {print $1}'", $execOutput, $return_val); // retrieve available packages
|
||||
$pkgFile = "{$rootfolder}/bin/All/{$pkgNeeded}.txz"; // create package file name
|
||||
if (!is_file($pkgFile)) exec("pkg fetch -y -o '{$rootfolder}/bin' {$pkgNeeded}", $execOutput, $return_val); // fetch necessary package
|
||||
$return_val += mwexec("mkdir -p '{$rootfolder}/bin/{$pkgName}' && tar -xf '{$pkgFile}' -C '{$rootfolder}/bin/{$pkgName}'", true); // extract package
|
||||
if (($manifest = ext_load_config("{$rootfolder}/bin/{$pkgName}/+MANIFEST")) !== false) $pkgInstalledVersion = "{$manifest['name']}-{$manifest['version']}";
|
||||
}
|
||||
echo "Needed : ".$pkgNeeded."\n";
|
||||
echo "Installed: ".$pkgInstalledVersion."\n";
|
||||
return $manifest;
|
||||
}
|
||||
}
|
||||
|
||||
/* function ext_check_release
|
||||
* checks current release against a minimal neccessary release
|
||||
* params:
|
||||
* $min_release: a float string to compare with the current used release, e.g.: 9.3, 10.3.0.3.2853 => 10.3032853, 11.0
|
||||
* return:
|
||||
* true => current release >= minimal release
|
||||
* false => current release < minimal release
|
||||
*/
|
||||
if (!function_exists('ext_check_release')) {
|
||||
function ext_check_release($min_release) {
|
||||
global $config;
|
||||
$product_version = explode(".", get_product_version()); // p.version = 10.3.0.3, p.revision = 2853
|
||||
$current_release = $product_version[0].".".$product_version[1].$product_version[2].$product_version[3].get_product_revision();
|
||||
if ($current_release < floatval($min_release)) return false; // release not supported
|
||||
else return true; // release supported
|
||||
}
|
||||
}
|
||||
|
||||
/* function ext_create_rc_commands
|
||||
* params:
|
||||
* $appname: extension name
|
||||
* $postinit: postinit command
|
||||
* $shutdown: shutdown command
|
||||
* $start_action: comment e.g. Start, Run, Initialize
|
||||
* $stop_action: comment e.g. Stop, Closedown
|
||||
* return:
|
||||
* $postinit: uuid or false
|
||||
* $shutdown: uuid or false
|
||||
*/
|
||||
if (!function_exists('ext_create_rc_commands')) {
|
||||
function ext_create_rc_commands($appname, &$postinit = false, &$shutdown = false, $start_action = "Start", $stop_action = "Stop") {
|
||||
global $config;
|
||||
if (ext_check_release(11.0)) { // new rc format
|
||||
unset($rc_param);
|
||||
// postinit command
|
||||
if (($postinit !== false) && !empty($postinit)) {
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "{$appname} Extension";
|
||||
$rc_param['value'] = $postinit;
|
||||
$rc_param['comment'] = "{$start_action} {$appname}";
|
||||
$rc_param['typeid'] = '2';
|
||||
$rc_param['enable'] = true;
|
||||
if (!is_array($config['rc'])) $config['rc'] = [];
|
||||
if (!is_array($config['rc']['param'])) $config['rc']['param'] = [];
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
$postinit = $rc_param['uuid'];
|
||||
unset($rc_param);
|
||||
}
|
||||
// shutdown command
|
||||
if (($shutdown !== false) && !empty($shutdown)) {
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "{$appname} Extension";
|
||||
$rc_param['value'] = $shutdown;
|
||||
$rc_param['comment'] = "{$stop_action} {$appname}";
|
||||
$rc_param['typeid'] = '3';
|
||||
$rc_param['enable'] = true;
|
||||
if (!is_array($config['rc'])) $config['rc'] = [];
|
||||
if (!is_array($config['rc']['param'])) $config['rc']['param'] = [];
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
$shutdown = $rc_param['uuid'];
|
||||
unset($rc_param);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (($postinit !== false) && !empty($postinit)) {
|
||||
$config['rc']['postinit']['cmd'][] = $postinit;
|
||||
$postinit = false;
|
||||
}
|
||||
if (($shutdown !== false) && !empty($shutdown)) {
|
||||
$config['rc']['shutdown']['cmd'][] = $shutdown;
|
||||
$shutdown = false;
|
||||
}
|
||||
}
|
||||
write_config();
|
||||
}
|
||||
}
|
||||
|
||||
/* function ext_remove_rc_commands
|
||||
* remove postinit / shutdown commands from rc array for both NAS4Free < 11.x and >= 11.x series
|
||||
* params:
|
||||
* $config_name: string to identify the rc command entry in rc|postinit/shutdown|cmd or rc|param|value
|
||||
*/
|
||||
if (!function_exists('ext_remove_rc_commands')) {
|
||||
function ext_remove_rc_commands($config_name) {
|
||||
global $config;
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$config_name}/", $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
if (is_array($config['rc']) && is_array($config['rc']['shutdown']) && is_array( $config['rc']['shutdown']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['shutdown']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$config_name}/", $config['rc']['shutdown']['cmd'][$i])) unset($config['rc']['shutdown']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param']['0'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$config_name}/", $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
write_config();
|
||||
}
|
||||
}
|
||||
|
||||
/* function ext_check_version
|
||||
* checks an extension if a new version exists against the currently installed version
|
||||
* params:
|
||||
* $test_filename: filename including the full path which holds the version number
|
||||
* $extension_name: extension name in URL format to retrive from Github
|
||||
* $current_version: string of current installed version
|
||||
* $button_name: gettext("name") to create a note for user action, e.g. Maintenance, Update
|
||||
* return:
|
||||
* empty: no new version found
|
||||
* or string: message for user action on new version found
|
||||
* or false: Github version could not be retrieved
|
||||
*/
|
||||
if (!function_exists('ext_check_version')) {
|
||||
function ext_check_version($test_filename, $extension_name, $current_version, $button_name) {
|
||||
global $config;
|
||||
if (!is_file($test_filename) || filemtime($test_filename) < time() - 86400) { // test if file exists or is older than 24 hours
|
||||
$return_val = mwexec("fetch -o {$test_filename} https://raw.github.com/crestAT/nas4free-{$extension_name}/master/{$extension_name}/version.txt", false);
|
||||
if ($return_val == 0) {
|
||||
$server_version = exec("cat {$test_filename}");
|
||||
if ($server_version != $current_version) return sprintf(gettext("New extension version %s available, push '%s' button to install the new version!"), $server_version, $button_name)."<br />";
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* function ext_load_config
|
||||
* loads a json formatted array from a standalone file
|
||||
* params:
|
||||
* $config_file: config file including full path
|
||||
* return:
|
||||
* data array: json formatted array
|
||||
* or false: config file not found or content not retrievable
|
||||
*/
|
||||
if (!function_exists('ext_load_config')) {
|
||||
function ext_load_config($config_file, $assoc = true, $depth = 512, $options = 0) {
|
||||
if (is_file($config_file)) {
|
||||
if (($config_data = file_get_contents($config_file)) === false) return false;
|
||||
$config_data = json_decode($config_data, $assoc, $depth, $options);
|
||||
return $config_data;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* function ext_save_config
|
||||
* loads a json formatted array from a standalone file
|
||||
* params:
|
||||
* $config_file: config file including full path
|
||||
* $config_data: php array with configuration data
|
||||
* return:
|
||||
* error condition
|
||||
*/
|
||||
if (!function_exists('ext_save_config')) {
|
||||
function ext_save_config($config_file, $config_data){
|
||||
header("Content-Type: application/json; UTF-8\n");
|
||||
file_put_contents($config_file, json_encode($config_data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ));
|
||||
return json_last_error();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,134 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
onebuttoninstaller-update_extension.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
require("auth.inc");
|
||||
require("guiconfig.inc");
|
||||
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale-obi");
|
||||
$pgtitle = array(gettext("Extensions"), gettext("OneButtonInstaller")." ".$config['onebuttoninstaller']['version'], gettext("Maintenance"));
|
||||
|
||||
if (is_file("{$config['onebuttoninstaller']['rootfolder']}log/oneload")) { require_once("{$config['onebuttoninstaller']['rootfolder']}log/oneload"); }
|
||||
|
||||
$return_val = mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}log/version.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/version.txt", true);
|
||||
if ($return_val == 0) {
|
||||
$server_version = exec("cat {$config['onebuttoninstaller']['rootfolder']}log/version.txt");
|
||||
if ($server_version != $config['onebuttoninstaller']['version']) { $savemsg .= sprintf(gettext("New extension version %s available, push '%s' button to install the new version!"), $server_version, gettext("Update Extension")); }
|
||||
mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}release_notes.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/release_notes.txt", false);
|
||||
}
|
||||
else { $server_version = gettext("Unable to retrieve version from server!"); }
|
||||
|
||||
if (isset($_POST['ext_remove']) && $_POST['ext_remove']) {
|
||||
// remove start/stop commands
|
||||
if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
|
||||
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); $i++) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) { unset($config['rc']['postinit']['cmd'][$i]);} else{}
|
||||
}
|
||||
}
|
||||
if ( is_array($config['rc']['shutdown'] ) && is_array( $config['rc']['shutdown']['cmd'] ) ) {
|
||||
for ($i = 0; $i < count($config['rc']['shutdown']['cmd']); $i++) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) { unset($config['rc']['shutdown']['cmd'][$i]); } else {}
|
||||
}
|
||||
}
|
||||
// remove extension pages
|
||||
mwexec("rm -rf /usr/local/www/ext/onebuttoninstaller");
|
||||
mwexec("rmdir -p /usr/local/www/ext"); // to prevent empty extensions menu entry in top GUI menu if there are no other extensions installed
|
||||
mwexec("rm -rf /usr/local/www/onebuttoninstaller*");
|
||||
// unlink created links
|
||||
if (is_link("/usr/local/share/locale-obi")) unlink("/usr/local/share/locale-obi");
|
||||
// remove application section from config.xml
|
||||
if ( is_array($config['onebuttoninstaller'] ) ) { unset( $config['onebuttoninstaller'] ); write_config();}
|
||||
header("Location:index.php");
|
||||
}
|
||||
|
||||
if (isset($_POST['ext_update']) && $_POST['ext_update']) {
|
||||
// download installer & install
|
||||
$return_val = mwexec("fetch -vo {$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-install.php 'https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/onebuttoninstaller-install.php'", true);
|
||||
if ($return_val == 0) {
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-install.php");
|
||||
header("Refresh:8");;
|
||||
}
|
||||
else { $input_errors[] = sprintf(gettext("Download of installation file %s failed, installation aborted!"), "onebuttoninstaller-install.php"); }
|
||||
}
|
||||
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale"); // to get the right main menu language
|
||||
include("fbegin.inc");
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?>
|
||||
<!-- 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">
|
||||
<tr><td class="tabnavtbl">
|
||||
<ul id="tabnav">
|
||||
<?php if (isset($config['onebuttoninstaller']['enable'])) { ?>
|
||||
<li class="tabinact"><a href="onebuttoninstaller.php"><span><?=gettext("Install");?></span></a></li>
|
||||
<li class="tabinact"><a href="onebuttoninstaller-config.php"><span><?=gettext("Configuration");?></span></a></li>
|
||||
<li class="tabact"><a href="onebuttoninstaller-update_extension.php"><span><?=gettext("Maintenance");?></span></a></li>
|
||||
<?php } else { ?>
|
||||
<li class="tabinact"><a href="onebuttoninstaller-config.php"><span><?=gettext("Configuration");?></span></a></li>
|
||||
<li class="tabact"><a href="onebuttoninstaller-update_extension.php"><span><?=gettext("Maintenance");?></span></a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</td></tr>
|
||||
<tr><td class="tabcont">
|
||||
<?php if (!empty($input_errors)) print_input_errors($input_errors);?>
|
||||
<?php if (!empty($savemsg)) print_info_box($savemsg);?>
|
||||
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
||||
<?php html_titleline(gettext("Extension Update"));?>
|
||||
<?php html_text("ext_version_current", gettext("Installed version"), $config['onebuttoninstaller']['version']);?>
|
||||
<?php html_text("ext_version_server", gettext("Latest version"), $server_version);?>
|
||||
<?php html_separator();?>
|
||||
</table>
|
||||
<div id="update_remarks">
|
||||
<?php html_remark("note_remove", gettext("Note"), gettext("Removing OneButtonInstaller integration from NAS4Free will leave the installation folder untouched - remove the files using Windows Explorer, FTP or some other tool of your choice. <br /><b>Please note: this page will no longer be available.</b> You'll have to re-run OneButtonInstaller extension installation to get it back on your NAS4Free."));?>
|
||||
<br />
|
||||
<input id="ext_update" name="ext_update" type="submit" class="formbtn" value="<?=gettext("Update Extension");?>" onclick="return confirm('<?=gettext("The selected operation will be completed. Please do not click any other buttons!");?>')" />
|
||||
<input id="ext_remove" name="ext_remove" type="submit" class="formbtn" value="<?=gettext("Remove Extension");?>" onclick="return confirm('<?=gettext("Do you really want to remove the extension from the system?");?>')" />
|
||||
</div>
|
||||
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
||||
<?php html_separator();?>
|
||||
<?php html_separator();?>
|
||||
<?php html_titleline(gettext("Extension")." ".gettext("Release Notes"));?>
|
||||
<tr>
|
||||
<td class="listt">
|
||||
<div>
|
||||
<textarea style="width: 98%;" id="content" name="content" class="listcontent" cols="1" rows="25" readonly="readonly"><?php unset($lines); exec("/bin/cat {$config['onebuttoninstaller']['rootfolder']}release_notes.txt", $lines); foreach ($lines as $line) { echo $line."\n"; }?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php include("formend.inc");?>
|
||||
</td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include("fend.inc");?>
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
spinner.inc
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2018 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Uses spin.js by Felix Gnass (fgnass) at http://spin.js.org
|
||||
@@ -1,10 +1,22 @@
|
||||
Extended GUI###<font color="green">RELEASE<br>0.5.3</font>###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###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><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=6405' target='_blank'>NAS4Free Forum</a>###10.3032853###
|
||||
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, rpi3, bananapi###
|
||||
Syncthing###<font color="green">RELEASE<br>0.1.5</font>###syncthing_start.php###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><font color="blue"><b>Note:</b> The current 10.3 and 10.2 series of NAS4Free contain Syncthing already out of the box so this extensions is mainly for older releases OR if one need older Syncthing versions (e.g. before 0.14.x for compatibility reasons with other devices.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=11110#p69469' target='_blank'>NAS4Free Forum</a>###-###
|
||||
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, rpi3, bananapi###
|
||||
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, rpi3, bananapi###
|
||||
Virtual Machine 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 to bhyve for NAS4Free. Based on vm-bhyve.<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>###x86, 10.2, rpi, rpi2, rpi3, bananapi###
|
||||
Plex Media Server###<font color="green">RELEASE<br>4.1</font>###plexinit###mkdir -p plex && cd plex && fetch https://raw.githubusercontent.com/JRGTH/nas4free-plex-extension/master/plex/plexinit && chmod 755 plexinit && ./plexinit -o###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=11184#p69861' target='_blank'>NAS4Free Forum</a>###x86, 10.0, rpi, rpi2, rpi3, bananapi###
|
||||
Extended GUI###<font color="red">BETA<br>0.6-b1</font>###extended-gui-devel###mkdir -p extended-gui/backup && mkdir -p extended-gui/log && cd extended-gui && fetch https://raw.github.com/crestAT/nas4free-extended-gui/development/extended-gui/extended-gui-install.php && chmod 770 extended-gui*install.php###extended-gui/extended-gui-install.php###<font color="red"><b><h2>This is a development version, use it only for testing!</h2></b></font><h3>Resolved issues in v0.6-b1:</h3><b>Pools duplication:</b><br>=> <a href='http://forums.nas4free.org/viewtopic.php?p=66903#p66903' target='_blank'>http://forums.nas4free.org/viewtopic.php?p=66903#p66903</a><br>=> <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=6405&start=390#p67189' target='_blank'>http://forums.nas4free.org/viewtopic.php?f=71&t=6405&start=390#p67189</a><br><br><b>Dataset names:</b><br>=> <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=6405&start=390#p68026' target='_blank'>http://forums.nas4free.org/viewtopic.php?f=71&t=6405&start=390#p68026</a><br>=> <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=6405&start=420#p70077' target='_blank'>http://forums.nas4free.org/viewtopic.php?f=71&t=6405&start=420#p70077</a><br><br><font color="red"><b>Note 1:</b> THIS BETA VERSION SHOWS NEVER TO BE INSTALLED THUS IT IS POSSIBLE TO INSTALL NEWER BETA VERSIONS !</font><br><font color="blue"><b>Note 2:</b> One can revert to the most recent release of eGUI at any time via the WebGUI | Extensions | Extended GUI | Extension Maintenance => Update extension.</font><br><br><hr><br>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>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=6405' target='_blank'>NAS4Free Forum</a>###10.3032853###
|
||||
Extended GUI###<font color="green">RELEASE<br>0.7.x</font>###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###extended-gui/extended-gui-install.php###<b><font color="red">THE EXTENSION IS NOT COMPATIBLE WITH CURRENT XIGMANAS RELEASES 11.2, 11.3 AND 12.X. IT WILL BE MAYBE IN FUTURE AFTER A COMPLETE REDESIGN, PLEASE BE PATIENT ...</font></b><br><br>Extension for XigmaNAS with many improvements for Status > System and additional functions.<br><br>The extension improves the Status > System page to a "Dashboard" like page and provides a comprehensive set of monitoring and alarming features (CPU & Harddisk temperature, free disk space monitoring, ZFS health, User login, alarm history, audible alarming, notifications via email) as well as additional tools like USB Automount, Purge for CIFS/SMB shares and the integration of user defined log files and action buttons on Status > System.<br><br>The extension works on all plattforms (x86 & x64, ARM, embedded & full), does not need jail or pkg_add, enhance pages of the XigmaNAS 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><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=6405' target='_blank'>XigmaNAS Forum</a>###99.9###
|
||||
RRDGraphs###<font color="orange">DEPRECIATED<br>0.3.3</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><b><font color="red">Version 0.3.3 will be the last update for the RRDGraphs Extension since RRDGraphs goes to be native in NAS4Free 11.x series. This v0.3.3 was the base for the native implementation and all statistical data from the extension can be used further in the native NAS4Free implementation which will be called Monitoring and is located under System > Advanced. A description for the transition to native RRDGraphs can be found in the XigmaNAS forum.</font></b><br><br>The extension is compatible with all versions up to 10.3 of NAS4Free 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='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=8299' target='_blank'>XigmaNAS Forum</a>###-###
|
||||
BitTorrent Sync###<font color="green">RELEASE<br>0.7.x</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 the Resilio Sync application on XigmaNAS servers.<br><br>The extension is compatible with all versions (9.1.x - 11.x) of XigmaNAS except on ARM boxes, works on all plattforms (embedded, full), does not need jail or pkg_add, add pages to XigmaNAS Web GUI extensions, features configuration, application update & backup management, extension mantenance (update & removal) and log view with filter and search capability.<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=5704' target='_blank'>XigmaNAS Forum</a>###rpi, rpi2, rpi3, bananapi###
|
||||
Syncthing###<font color="green">RELEASE<br>0.2.x</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 XigmaNAS (N4F) servers.<br><br>The extension works on all plattforms, does not need jail or pkg_add, add pages to XigmaNAS WebGUI extensions, features configuration, application update & backup management, scheduling and log view with filter / search capabilities.<br><br><font color="blue"><b>Note:</b> The current 10.3 and 11.x series of XigmaNAS contain Syncthing already out of the box so this extensions is mainly for older releases OR if one need to upgrade/rollback Syncthing versions without upgrade/downgrade the XigmaNAS firmware for compatibility reasons with other devices.</font><br><br>Read more ... <a href='https://github.com/crestAT/nas4free-syncthing/wiki' target='_blank'>GitHub Wiki</a>###-###
|
||||
TheBrig###<font color="green">RELEASE<br>0.9x</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 XigmaNAS.<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='https://www.xigmanas.com/forums/viewtopic.php?f=79&t=3894' target='_blank'>XigmaNAS Forum</a>###10.3###
|
||||
DNSMasq DHCP Server###<font color="green">RELEASE<br>0.4x</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 XigmaNAS.<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='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=3002' target='_blank'>XigmaNAS Forum</a>###rpi, rpi2, rpi3, bananapi###
|
||||
Virtual Machine BHYVE###<font color="red">ALPHA<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 to bhyve for XigmaNAS. Based on vm-bhyve.<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='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=10433#p65157' target='_blank'>XigmaNAS Forum</a>###x86, 10.2, rpi, rpi2, rpi3, bananapi###
|
||||
Plex Media Server###<font color="green">RELEASE<br>4.3.x</font>###plexinit###mkdir -p plex && cd plex && fetch https://raw.githubusercontent.com/JRGTH/xigmanas-plex-extension/master/plex/plexinit && chmod +x plexinit && ./plexinit -o###plex/postinit###Plex Media Server Add-On for XigmaNAS 11.0 and later.<br><br>The extension works on XigmaNAS 11.0 and later versions, 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 the actual Plex configuration.<br><br><b>Note: Plex Pass is available at the beta channel in OneButtonInstaller - activate 'Beta releases' in Extensions > OneButtonInstaller > Configuration to get it in shown in the extensions list!<br>To install Plex Pass a previous standard Plex installation must be uninstalled with Extensions > Plex Media Server > Uninstall (Plexdata can stay intact - don't tick to delete the user data as well) and afterwards the Plex Pass package can be installed!</b><br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=11184#p69861' target='_blank'>XigmaNAS Forum</a>###x86, 10.3, rpi, rpi2, rpi3, bananapi###
|
||||
Downloady###<font color="green">RELEASE<br>0.1.x</font>###downloady###mkdir -p downloady && cd downloady && fetch https://raw.github.com/crestAT/nas4free-downloady/master/downloady/downloady-install.php && chmod 770 downloady*install.php###downloady/downloady-install.php###Simple PHP Download Manager for http/https/ftp sites based on Downloady by CyberLeo|cyberLeo Projects.<br><br>The extension fully integrates a wget based download manager into the XigmaNAS WebGUI, works on all plattforms (x86 & x64, ARM, embedded & full), does not need jail or pkg_add, enhance pages of the XigmaNAS WebGUI and features configuration and extension maintenance (update & removal inside the WebGUI). Based on Downloady by CyberLeo it has been extended and offers restart on server reboot, bandwidth limits for downloads as well as a daily scheduler to start/stop Downloady at a specific time.<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=11719&hilit=downloady' target='_blank'>XigmaNAS Forum</a>
|
||||
NextOnwCloud###<font color="green">RELEASE<br>0.3.x</font>###owncloud###mkdir -p owncloud && cd owncloud && fetch https://raw.github.com/crestAT/nas4free-owncloud/master/owncloud/owncloud-install.php && chmod 770 owncloud*install.php ###owncloud/owncloud-install.php###Extension to install OwnCloud and/or NextCloud with a minimal set of prerequisites (ensures to have the right permissions on the used paths and an upload file size of 2GB) on XigmaNAS servers.<br><br>The extension works on all plattforms, does not need jail or pkg_add and add pages to XigmaNAS WebGUI extensions.<br><font color="blue"><b>NextCloud/ownCloud can use the built-in SQLite database server as well as the MySQL server extension or the upcoming XigmaNAS MariaDB server.</b></font><br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=11718' target='_blank'>XigmaNAS Forum</a>
|
||||
Plex Pass Media Server###<font color="blue">COMMERCIAL<br>4.2.x</font>###plex###mkdir -p plexpass && cd plexpass && fetch https://raw.githubusercontent.com/JRGTH/xigmanas-plex-extension/master/plex/plexinit && chmod +x plexinit && ./plexinit -ao###plexpass/postinit###Plex Pass Media Server Add-On for XigmaNAS.<br><br><font color="blue">Plex Pass is the bleeding edge channel containing the latest innovative and cutting edge features for the premium (paid) users.<br>The Plex Pass package is an Early Access & Preview Release, this means that this version is targeted for Premium Paid Plex users who want to preview/test newer and upcoming features earlier, and all users should bear in mind that this preview/bleeding edge releases may or may not work as expected, things can work just partially or even not work at all, in this case/scenario the user should use the Plex Forums for support and/or report any bugs/malfunction encountered in such releases.</font><br><br>Read more about Plex Pass at the Plex Website ... <a href='https://support.plex.tv/hc/en-us/articles/200288566-What-is-Plex-Pass-' target='_blank'>What is Plex Pass?</a><br><br><b>To install Plex Pass a previous standard Plex installation must be uninstalled with Extensions > Plex Media Server > Uninstall (Plexdata can stay intact - don't tick to delete the user data as well) and afterwards the Plex Pass package can be installed!</b><br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=11184#p69861' target='_blank'>XigmaNAS Forum</a>###x86, 10.3, rpi, rpi2, rpi3, bananapi###
|
||||
Zrep###<font color="green">RELEASE<br>0.2.x</font>###zrep-init###mkdir -p zrep && cd zrep && fetch https://raw.githubusercontent.com/JRGTH/xigmanas-zrep-extension/master/zrep-init && chmod +x zrep-init && ./zrep-init -o###zrep/postinit###XigmaNAS Zrep Extension which seamlessly integrates enterprise-grade ZFS replication and failover features.<br><br>Zrep is an enterprise-grade, single-program solution for handling asynchronous, continuous replication of a zfs filesystem, to another filesystem. That filesystem can be on another machine, or on the same machine. It also handles 'failover', as simply as "zrep failover datapool/yourfs". This will conveniently handle all the details of <ul><li>Making 'yourfs' be a data destination, rather than a source</li><li>Making 'yourfs' be read-only</li><li>Making the destination fs be "live", and ready to transfer data to yourfs</li></ul>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=13966#p86545' target='_blank'>XigmaNAS Forum</a>###10.3, x86, rpi, rpi2, rpi3, bananapi###
|
||||
MySQL###<font color="green">RELEASE<br>0.2</font>###mysql-start###mkdir -p mysql && cd mysql && fetch https://raw.github.com/crestAT/nas4free-mysql/master/mysql/mysql-install.php && chmod +x mysql* ###mysql/mysql-install.php###MySQL database server extension with optional SQL database administration client (Adminer).<br><br>The MySQL™ software delivers a very fast, multithreaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.<br><br>Adminer (formerly phpMinAdmin) is a full-featured database management tool written in PHP. Conversely to phpMyAdmin, it consist of a single file ready to deploy to the target server. Adminer is available for MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Firebird, SimpleDB, Elasticsearch and MongoDB.<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=11189&start=300#p86808' target='_blank'>XigmaNAS Forum</a>###11.0, x86, rpi, rpi2, rpi3, bananapi###
|
||||
Rclone###<font color="green">RELEASE<br>1.x</font>###rclone-start###mkdir -p rclone && cd rclone && fetch https://raw.github.com/crestAT/nas4free-rclone/master/rclone/rclone-install.php && chmod +x rclone* ###rclone/rclone-install.php###XigmaNAS extension for setup and upgrade Rclone as well as creating/executing task scripts from the WebGUI and scheduling to cron.<br><br>Rclone ("rsync for cloud storage") is a command line program to sync files and directories to and from different cloud storage providers:<br>Amazon Drive, Amazon S3, Backblaze B2, Box, Ceph, DigitalOcean Spaces, Dreamhost, Dropbox, FTP, Google Cloud Storage, Google Drive, HTTP, Hubic, Jottacloud, IBM COS S3, Memset Memstore, Mega, Microsoft Azure Blob Storage, Microsoft OneDrive, Minio, Nextcloud, OVH, OpenDrive, Openstack Swift, Oracle Cloud Storage, ownCloud, pCloud, put.io, QingStor, Rackspace Cloud Files, SFTP, Wasabi, WebDAV, Yandex Disk, The local filesystem<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=56&t=12698&sid=881da3d66a380f6a02e1ded0aecf22c9#p87447' target='_blank'>XigmaNAS Forum</a>###11.0, x86, rpi, rpi2, rpi3, bananapi###
|
||||
Telegraf###<font color="green">RELEASE<br>0.3.x</font>###telegraf-init###mkdir -p telegraf && cd telegraf && fetch https://raw.githubusercontent.com/JRGTH/xigmanas-telegraf-extension/master/telegraf-init && chmod +x telegraf-init && ./telegraf-init -o###telegraf/postinit###XigmaNAS Telegraf Extension, the Agent for Collecting & Reporting Metrics & Data.<br><br>Telegraf has plugins or integrations to source a variety of metrics directly from the system it is running on, pull metrics from third-party APIs, or even listen for metrics via a StatsD and Kafka consumer services. It also has output plugins to send metrics to a variety of other datastores, services, and message queues, including InfluxDB, Graphite, OpenTSDB, Datadog, Librato, Kafka, MQTT, NSQ, and many others.<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=14127#p87594' target='_blank'>XigmaNAS Forum</a>###10.3, x86, rpi, rpi2, rpi3, bananapi###
|
||||
PyTivo###<font color="green">RELEASE<br>0.1.x</font>###pytivoinit###mkdir -p pytivo && cd pytivo && fetch https://raw.githubusercontent.com/JRGTH/xigmanas-pytivo-extension/master/pytivoinit && chmod +x pytivoinit && ./pytivoinit -o###pytivo/postinit###XigmaNAS PyTivo Extension<br><br>pyTivo is both an HMO and GoBack server. Similar to TiVo Desktop, pyTivo loads many standard video compression codecs and outputs mpeg2 (or in some cases, h.264) video to the TiVo. However, pyTivo is able to load many more file types than TiVo Desktop.<br><br>pyTivo is in no way affiliated with TiVo, Inc.<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=14566' target='_blank'>XigmaNAS Forum</a>###11.0, x86, rpi, rpi2, rpi3, bananapi###
|
||||
BE Manager###<font color="green">RELEASE<br>0.2.x</font>###beminit###mkdir -p bemanager && cd bemanager && fetch https://raw.githubusercontent.com/JRGTH/xigmanas-bem-extension/master/beminit && chmod +x beminit && ./beminit -o###bemanager/postinit###Boot Environments Manager extension for XigmaNAS.<br><br>Utility to manage Boot Environments with ZFS compliant platforms.<br><br><font color="red"><b>Note:</b> This extension is compatible with RootOnZFS platforms only.</font><br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=14585#p90458' target='_blank'>XigmaNAS Forum</a>###11.0, x86, rpi, rpi2, rpi3, bananapi###
|
||||
Themes###<font color="green">RELEASE<br>1.x</font>###themes-start###mkdir -p themes && cd themes && fetch https://raw.github.com/crestAT/nas4free-themes/master/themes/themes-install.php && chmod +x themes* ###themes/themes-install.php###XigmaNAS themes extension.<br><br>The extension consists of a theme manager to choose from different as well as a simple theme designer. The themes are based on the original XigmaNAS WebGUI - the theme designer provide the means to change colors in an easy-to-use way and also to choose different device size bar types for Status > System and swap devices.<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=14778#p91734' target='_blank'>XigmaNAS Forum</a>###11.2, x86, rpi, rpi2, rpi3, bananapi###
|
||||
Bastille Manager###<font color="green">RELEASE<br>1.x</font>###bastille-init###mkdir -p -m 0750 bastille && cd bastille && fetch --no-verify-peer https://git.familie-berner.de/Xigmanas/xigmanas-bastille-extension/raw/branch/master/bastille-init && chmod +x bastille-init && ./bastille-init -o###bastille/postinit###XigmaNAS Bastille Extension<br><br>A ZERO dependency Bastille Jail/Container Manager Extension for XigmaNAS. Containers creation and management made easy!<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=71&t=14848&p=92140#p92140' target='_blank'>XigmaNAS Forum</a>###11.2, x86, rpi, rpi2, rpi3, bananapi###
|
||||
NCurses Disk Usage###<font color="green">RELEASE<br>1.x</font>###ncdu-start.php###chmod u+x /usr/local/www/ext/onebuttoninstaller/../apps/*###onebuttoninstaller/apps/ncdu.postinit###NCurses Disk Usage CLI extension<br><br>Ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote server where you don't have an entire graphical setup available, but it is a useful tool even on regular desktop systems.<br><br>After successful installation you can use NCDU in the system console shell or if you connect via ssh. To start NCDU just enter the command <b>ncdu</b> in the CLI.<br><br>Read more ... <a href='https://www.xigmanas.com/forums/viewtopic.php?f=70&t=13704&hilit=ncdu' target='_blank'>XigmaNAS Forum</a>###12.1, rpi, rpi2, rpi3, bananapi###
|
||||
Midnight Commander###<font color="green">RELEASE<br>4.x</font>###mc-start.php###chmod u+x /usr/local/www/ext/onebuttoninstaller/../apps/*###onebuttoninstaller/apps/mcommander.postinit###Midnight Commander CLI extension<br><br>GNU Midnight Commander is a visual file manager, licensed under GNU General Public License and therefore qualifies as Free Software. It's a feature rich full-screen text mode application that allows you to copy, move and delete files and whole directory trees, search for files and run commands in the subshell. Internal viewer and editor are included.<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='https://www.xigmanas.com/forums/viewtopic.php?f=70&t=187' target='_blank'>XigmaNAS Forum</a>###12.1, rpi, rpi2, rpi3, bananapi###
|
||||
Htop###<font color="green">RELEASE<br>2.x</font>###htop-start.php###chmod u+x /usr/local/www/ext/onebuttoninstaller/../apps/*###onebuttoninstaller/apps/htop.postinit###htop CLI extension<br><br>htop is an interactive text-mode process viewer for Unix systems. It aims to be a better 'top'.<br><br>After successful installation you can use htop in the system console shell or if you connect via ssh. To start htop just enter the command <b>htop</b> in the CLI.<br><br>Read more ... <a href='https://github.com/hishamhm/htop' target='_blank'>Github</a>###12.1, rpi, rpi2, rpi3, bananapi###
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-config.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -24,23 +24,34 @@
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
*/
|
||||
require("auth.inc");
|
||||
require("guiconfig.inc");
|
||||
|
||||
$configName = "onebuttoninstaller";
|
||||
$configFile = "ext/{$configName}/{$configName}.conf";
|
||||
require_once("ext/{$configName}/extension-lib.inc");
|
||||
|
||||
$domain = strtolower(get_product_name());
|
||||
$localeOSDirectory = "/usr/local/share/locale";
|
||||
$localeExtDirectory = "/usr/local/share/locale-{$configName}";
|
||||
bindtextdomain($domain, $localeExtDirectory);
|
||||
|
||||
// Dummy standard message gettext calls for xgettext retrieval!!!
|
||||
$dummy = gettext("The changes have been applied successfully.");
|
||||
$dummy = gettext("The configuration has been changed.<br />You must apply the changes in order for them to take effect.");
|
||||
$dummy = gettext("The following input errors were detected");
|
||||
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale-obi");
|
||||
$pgtitle = array(gettext("Extensions"), gettext("OneButtonInstaller")." ".$config['onebuttoninstaller']['version'], gettext("Configuration"));
|
||||
if (($configuration = ext_load_config($configFile)) === false) $input_errors[] = sprintf(gettext("Configuration file %s not found!"), "{$configName}.conf");
|
||||
if (!isset($configuration['rootfolder']) && !is_dir($configuration['rootfolder'] )) $input_errors[] = gettext("Extension installed with fault");
|
||||
|
||||
if (!isset($config['onebuttoninstaller']) || !is_array($config['onebuttoninstaller'])) $config['onebuttoninstaller'] = array();
|
||||
$platform = $g['platform'];
|
||||
if ($platform == "livecd" || $platform == "liveusb")
|
||||
$input_errors[] = sprintf(gettext("Attention: the used XigmaNAS platform '%s' is not recommended for extensions! After a reboot all extensions will no longer be available, use XigmaNAS embedded or full platform instead!"), $platform);
|
||||
|
||||
$pgtitle = array(gettext("Extensions"), $configuration['appname']." ".$configuration['version'], gettext("Configuration"));
|
||||
|
||||
if (!isset($configuration) || !is_array($configuration)) $configuration = array();
|
||||
|
||||
/* Check if the directory exists, the mountpoint has at least o=rx permissions and
|
||||
* set the permission to 775 for the last directory in the path
|
||||
@@ -70,7 +81,7 @@ function change_perms($dir) {
|
||||
}
|
||||
else
|
||||
{
|
||||
$input_errors[] = sprintf(gettext("OneButtonInstaller needs at least read & execute permissions at the mount point for directory %s! Set the Read and Execute bits for Others (Access Restrictions | Mode) for the mount point %s (in <a href='disks_mount.php'>Disks | Mount Point | Management</a> or <a href='disks_zfs_dataset.php'>Disks | ZFS | Datasets</a>) and hit Save in order to take them effect."), $path, "/{$path_check[1]}/{$path_check[2]}");
|
||||
$input_errors[] = sprintf(gettext("{$configName} needs at least read & execute permissions at the mount point for directory %s! Set the Read and Execute bits for Others (Access Restrictions | Mode) for the mount point %s (in <a href='disks_mount.php'>Disks | Mount Point | Management</a> or <a href='disks_zfs_dataset.php'>Disks | ZFS | Datasets</a>) and hit Save in order to take them effect."), $path, "/{$path_check[1]}/{$path_check[2]}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,44 +90,41 @@ function change_perms($dir) {
|
||||
if (isset($_POST['save']) && $_POST['save']) {
|
||||
unset($input_errors);
|
||||
if (empty($input_errors)) {
|
||||
$config['onebuttoninstaller']['enable'] = isset($_POST['enable']) ? true : false;
|
||||
$configuration['enable'] = isset($_POST['enable']) ? true : false;
|
||||
if (isset($_POST['enable'])) {
|
||||
$config['onebuttoninstaller']['storage_path'] = !empty($_POST['storage_path']) ? $_POST['storage_path'] : $g['media_path'];
|
||||
$config['onebuttoninstaller']['storage_path'] = rtrim($config['onebuttoninstaller']['storage_path'],'/'); // ensure to have NO trailing slash
|
||||
if (!isset($_POST['path_check']) && (strpos($config['onebuttoninstaller']['storage_path'], "/mnt/") === false)) {
|
||||
$configuration['storage_path'] = !empty($_POST['storage_path']) ? $_POST['storage_path'] : $g['media_path'];
|
||||
$configuration['storage_path'] = rtrim($configuration['storage_path'],'/'); // ensure to have NO trailing slash
|
||||
if (!isset($_POST['path_check']) && (strpos($configuration['storage_path'], "/mnt/") === false)) {
|
||||
$input_errors[] = gettext("The common directory for all extensions MUST be set to a directory below <b>'/mnt/'</b> to prevent to loose the extensions after a reboot on embedded systems!");
|
||||
}
|
||||
else {
|
||||
if (!is_dir($config['onebuttoninstaller']['storage_path'])) mkdir($config['onebuttoninstaller']['storage_path'], 0775, true);
|
||||
if (!is_dir($configuration['storage_path'])) mkdir($configuration['storage_path'], 0775, true);
|
||||
change_perms($_POST['storage_path']);
|
||||
$config['onebuttoninstaller']['path_check'] = isset($_POST['path_check']) ? true : false;
|
||||
$config['onebuttoninstaller']['re_install'] = isset($_POST['re_install']) ? true : false;
|
||||
$config['onebuttoninstaller']['auto_update'] = isset($_POST['auto_update']) ? true : false;
|
||||
$config['onebuttoninstaller']['show_beta'] = isset($_POST['show_beta']) ? true : false;
|
||||
$savemsg .= get_std_save_message(write_config())." ";
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
|
||||
$configuration['path_check'] = isset($_POST['path_check']) ? true : false;
|
||||
$configuration['re_install'] = isset($_POST['re_install']) ? true : false;
|
||||
$configuration['auto_update'] = isset($_POST['auto_update']) ? true : false;
|
||||
$configuration['show_beta'] = isset($_POST['show_beta']) ? true : false;
|
||||
$savemsg .= get_std_save_message(ext_save_config($configFile, $configuration))." ";
|
||||
require_once("{$configuration['rootfolder']}/{$configName}-start.php");
|
||||
}
|
||||
}
|
||||
else $savemsg .= get_std_save_message(write_config())." ";
|
||||
else $savemsg .= get_std_save_message(ext_save_config($configFile, $configuration))." ";
|
||||
} // end of empty input_errors
|
||||
}
|
||||
|
||||
$pconfig['enable'] = isset($config['onebuttoninstaller']['enable']) ? true : false;
|
||||
$pconfig['storage_path'] = !empty($config['onebuttoninstaller']['storage_path']) ? $config['onebuttoninstaller']['storage_path'] : $g['media_path'];
|
||||
$pconfig['path_check'] = isset($config['onebuttoninstaller']['path_check']) ? true : false;
|
||||
$pconfig['re_install'] = isset($config['onebuttoninstaller']['re_install']) ? true : false;
|
||||
$pconfig['auto_update'] = isset($config['onebuttoninstaller']['auto_update']) ? true : false;
|
||||
$pconfig['show_beta'] = isset($config['onebuttoninstaller']['show_beta']) ? true : false;
|
||||
$pconfig['enable'] = $configuration['enable'];
|
||||
$pconfig['storage_path'] = !empty($configuration['storage_path']) ? $configuration['storage_path'] : $g['media_path'];
|
||||
$pconfig['path_check'] = $configuration['path_check'];
|
||||
$pconfig['re_install'] = $configuration['re_install'];
|
||||
$pconfig['auto_update'] = $configuration['auto_update'];
|
||||
$pconfig['show_beta'] = $configuration['show_beta'];
|
||||
|
||||
$return_val = mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}log/version.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/version.txt", false);
|
||||
if ($return_val == 0) {
|
||||
$server_version = exec("cat {$config['onebuttoninstaller']['rootfolder']}log/version.txt");
|
||||
if ($server_version != $config['onebuttoninstaller']['version']) { $savemsg .= sprintf(gettext("New extension version %s available, push '%s' button to install the new version!"), $server_version, gettext("Maintenance")); }
|
||||
} //EOversion-check
|
||||
if (($message = ext_check_version("{$configuration['rootfolder']}/version_server.txt", "{$configName}", $configuration['version'], gettext("Maintenance"))) !== false) $savemsg .= $message;
|
||||
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale"); // to get the right main menu language
|
||||
bindtextdomain($domain, $localeOSDirectory);
|
||||
include("fbegin.inc");
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?>
|
||||
bindtextdomain($domain, $localeExtDirectory);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function enable_change(enable_change) {
|
||||
@@ -130,26 +138,23 @@ function enable_change(enable_change) {
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<form action="onebuttoninstaller-config.php" method="post" name="iform" id="iform">
|
||||
<form action="<?php echo $configName; ?>-config.php" method="post" name="iform" id="iform" onsubmit="spinner()">
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td class="tabnavtbl">
|
||||
<ul id="tabnav">
|
||||
<?php if (isset($config['onebuttoninstaller']['enable'])) { ?>
|
||||
<?php if ($configuration['enable']) { ?>
|
||||
<li class="tabinact"><a href="onebuttoninstaller.php"><span><?=gettext("Install");?></span></a></li>
|
||||
<li class="tabact"><a href="onebuttoninstaller-config.php"><span><?=gettext("Configuration");?></span></a></li>
|
||||
<li class="tabinact"><a href="onebuttoninstaller-update_extension.php"><span><?=gettext("Maintenance");?></span></a></li>
|
||||
<?php } else { ?>
|
||||
<li class="tabact"><a href="onebuttoninstaller-config.php"><span><?=gettext("Configuration");?></span></a></li>
|
||||
<li class="tabinact"><a href="onebuttoninstaller-update_extension.php"><span><?=gettext("Maintenance");?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<li class="tabact"><a href="onebuttoninstaller-config.php"><span><?=gettext("Configuration");?></span></a></li>
|
||||
<li class="tabinact"><a href="onebuttoninstaller-update_extension.php"><span><?=gettext("Maintenance");?></span></a></li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
<tr><td class="tabcont">
|
||||
<?php if (!empty($input_errors)) print_input_errors($input_errors);?>
|
||||
<?php if (!empty($savemsg)) print_info_box($savemsg);?>
|
||||
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
||||
<?php html_titleline_checkbox("enable", gettext("OneButtonInstaller"), $pconfig['enable'], gettext("Enable"), "enable_change(false)");?>
|
||||
<?php html_text("installation_directory", gettext("Installation directory"), sprintf(gettext("The extension is installed in %s"), $config['onebuttoninstaller']['rootfolder']));?>
|
||||
<?php html_titleline_checkbox("enable", gettext($configuration['appname']), $pconfig['enable'], gettext("Enable"), "enable_change(false)");?>
|
||||
<?php html_text("installation_directory", gettext("Installation directory"), sprintf(gettext("The extension is installed in %s"), $configuration['rootfolder']));?>
|
||||
<?php html_filechooser("storage_path", gettext("Common directory"), $pconfig['storage_path'], gettext("Common directory for all extensions (a persistant place where all extensions are/should be - a directory below <b>/mnt/</b>)."), $pconfig['storage_path'], true, 60);?>
|
||||
<?php html_checkbox("path_check", gettext("Path check"), $pconfig['path_check'], gettext("If this option is selected no examination of the common directory path will be carried out (whether it was set to a directory below /mnt/)."), "<b><font color='red'>".gettext("Please use this option only if you know what you are doing!")."</font></b>", false);?>
|
||||
<?php html_checkbox("re_install", gettext("Re-install"), $pconfig['re_install'], gettext("If enabled it is possible to install extensions even if they are already installed."), "<b><font color='red'>".gettext("Please use this option only if you know what you are doing!")."</font></b>", false);?>
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-install.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -24,19 +24,16 @@
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
$v = "v0.3.2"; // extension version
|
||||
$appname = "OneButtonInstaller";
|
||||
$v = "v0.4.1"; // extension version
|
||||
$appName = "OneButtonInstaller";
|
||||
$configName = "onebuttoninstaller";
|
||||
|
||||
require_once("config.inc");
|
||||
|
||||
$arch = $g['arch'];
|
||||
$platform = $g['platform'];
|
||||
// no check necessary since the extension is for all archictectures/platforms/releases
|
||||
// no check necessary since the extension is for all archictectures/platforms/releases => N: warnings for livecd && liveusb within the pages
|
||||
//if (($arch != "i386" && $arch != "amd64") && ($arch != "x86" && $arch != "x64" && $arch != "rpi" && $arch != "rpi2")) { echo "\f{$arch} is an unsupported architecture!\n"; exit(1); }
|
||||
//if ($platform != "embedded" && $platform != "full" && $platform != "livecd" && $platform != "liveusb") { echo "\funsupported platform!\n"; exit(1); }
|
||||
|
||||
@@ -44,8 +41,7 @@ $platform = $g['platform'];
|
||||
global $input_errors;
|
||||
global $savemsg;
|
||||
|
||||
$install_dir = dirname(__FILE__)."/"; // get directory where the installer script resides
|
||||
if (!is_dir("{$install_dir}log")) { mkdir("{$install_dir}log", 0775, true); }
|
||||
$install_dir = dirname(__FILE__); // get directory where the installer script resides
|
||||
|
||||
// check FreeBSD release for fetch options >= 9.3
|
||||
$release = explode("-", exec("uname -r"));
|
||||
@@ -54,14 +50,16 @@ else $verify_hostname = "";
|
||||
// create stripped version name
|
||||
$vs = str_replace(".", "", $v);
|
||||
// fetch release archive
|
||||
$return_val = 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-{$configName}/releases/download/{$v}/{$configName}-{$vs}.zip'", false);
|
||||
if ($return_val == 0) {
|
||||
$return_val = 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"; }
|
||||
require_once("{$install_dir}/ext/extension-lib.inc");
|
||||
$configFile = "{$install_dir}/ext/{$configName}.conf";
|
||||
if (is_file("{$install_dir}/version.txt")) $file_version = exec("cat {$install_dir}/version.txt");
|
||||
else $file_version = "n/a";
|
||||
$savemsg = sprintf(gettext("Update to version %s completed!"), $file_version);
|
||||
}
|
||||
else {
|
||||
@@ -74,47 +72,41 @@ else {
|
||||
return;
|
||||
}
|
||||
|
||||
// uninstall old OBI files < v0.4 and remove the application section from config.xml
|
||||
if (is_array($config['onebuttoninstaller'])) {
|
||||
mwexec("rm -Rf /usr/local/www/onebuttoninstaller*", false);
|
||||
mwexec("rm -Rf /usr/local/www/ext/onebuttoninstaller", false);
|
||||
mwexec("rm -Rf {$install_dir}/locale-obi", false);
|
||||
mwexec("rm -Rf {$install_dir}/log", false);
|
||||
if (is_link("/usr/local/share/locale-obi")) unlink("/usr/local/share/locale-obi");
|
||||
$configuration = $config['onebuttoninstaller'];
|
||||
unset($config['onebuttoninstaller']);
|
||||
write_config();
|
||||
}
|
||||
|
||||
// install / update application on NAS4Free
|
||||
if ( !isset($config['onebuttoninstaller']) || !is_array($config['onebuttoninstaller'])) {
|
||||
// new installation
|
||||
$config['onebuttoninstaller'] = array();
|
||||
$config['onebuttoninstaller']['appname'] = $appname;
|
||||
$config['onebuttoninstaller']['version'] = exec("cat {$install_dir}version.txt");
|
||||
$config['onebuttoninstaller']['rootfolder'] = $install_dir;
|
||||
$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('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) break; ++$i; }
|
||||
if (!is_array($configuration)) { // from an old OBI < 0.4 installation
|
||||
if (($configuration = ext_load_config($configFile)) === false) { // from an OBI >= 0.4 installation
|
||||
$configuration = array(); // new installation
|
||||
$new_installation = true;
|
||||
}
|
||||
$config['rc']['postinit']['cmd'][$i] = $config['onebuttoninstaller']['rootfolder']."onebuttoninstaller_start.php";
|
||||
$i =0;
|
||||
if ( is_array($config['rc']['shutdown'] ) && is_array( $config['rc']['shutdown']['cmd'] ) ) {
|
||||
for ($i; $i < count($config['rc']['shutdown']['cmd']); ) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) break; ++$i; }
|
||||
}
|
||||
$config['rc']['shutdown']['cmd'][$i] = $config['onebuttoninstaller']['rootfolder']."onebuttoninstaller_stop.php";
|
||||
write_config();
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
|
||||
}
|
||||
else {
|
||||
// update release
|
||||
$config['onebuttoninstaller']['version'] = exec("cat {$install_dir}version.txt");
|
||||
$config['onebuttoninstaller']['rootfolder'] = $install_dir;
|
||||
$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('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) break; ++$i; }
|
||||
}
|
||||
$config['rc']['postinit']['cmd'][$i] = $config['onebuttoninstaller']['rootfolder']."onebuttoninstaller_start.php";
|
||||
$i =0;
|
||||
if ( is_array($config['rc']['shutdown'] ) && is_array( $config['rc']['shutdown']['cmd'] ) ) {
|
||||
for ($i; $i < count($config['rc']['shutdown']['cmd']); ) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) break; ++$i; }
|
||||
}
|
||||
$config['rc']['shutdown']['cmd'][$i] = $config['onebuttoninstaller']['rootfolder']."onebuttoninstaller_stop.php";
|
||||
write_config();
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
|
||||
}
|
||||
$configuration['appname'] = $appName;
|
||||
$configuration['version'] = exec("cat {$install_dir}/version.txt");
|
||||
$configuration['rootfolder'] = $install_dir;
|
||||
$configuration['postinit'] = "/usr/local/bin/php-cgi -f {$install_dir}/{$configName}-start.php";
|
||||
$configuration['shutdown'] = "/usr/local/bin/php-cgi -f {$install_dir}/{$configName}-stop.php";
|
||||
|
||||
// remove start/stop commands and existing old rc format entries
|
||||
ext_remove_rc_commands($configName);
|
||||
$configuration['rc_uuid_start'] = $configuration['postinit'];
|
||||
$configuration['rc_uuid_stop'] = $configuration['shutdown'];
|
||||
ext_create_rc_commands($appName, $configuration['rc_uuid_start'], $configuration['rc_uuid_stop']);
|
||||
ext_save_config($configFile, $configuration);
|
||||
|
||||
require_once("{$install_dir}/{$configName}-start.php");
|
||||
if ($new_installation) echo "\nInstallation completed, use WebGUI | Extensions | {$appName} to configure the application!\n";
|
||||
|
||||
// finally fetch the most recent extensions list to get the latest changes if not already in the master release
|
||||
$return_val = mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}extensions.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/extensions.txt", true);
|
||||
$return_val = mwexec("fetch -o {$install_dir}/extensions.txt https://raw.github.com/crestAT/nas4free-{$configName}/master/{$configName}/extensions.txt", false);
|
||||
?>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-start.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -24,15 +24,30 @@
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
$extension_dir = "/usr/local/www";
|
||||
require_once("config.inc");
|
||||
|
||||
mwexec("ln -sf {$config['onebuttoninstaller']['rootfolder']}locale-obi /usr/local/share/", true); // create link to languages
|
||||
$return_val = mwexec("cp -R {$config['onebuttoninstaller']['rootfolder']}ext/* {$extension_dir}/", true);
|
||||
if ($return_val == 0) exec("logger onebuttoninstaller: started");
|
||||
else exec("logger onebuttoninstaller: error during startup, file copy to {$extension_dir} failed");
|
||||
$configName = "onebuttoninstaller";
|
||||
$rootfolder = dirname(__FILE__);
|
||||
|
||||
if (is_link("/usr/local/share/locale-{$configName}")) unlink("/usr/local/share/locale-{$configName}");
|
||||
if (is_link("/usr/local/www/{$configName}.php")) unlink("/usr/local/www/{$configName}.php");
|
||||
if (is_link("/usr/local/www/{$configName}-config.php")) unlink("/usr/local/www/{$configName}-config.php");
|
||||
if (is_link("/usr/local/www/{$configName}-update_extension.php")) unlink("/usr/local/www/{$configName}-update_extension.php");
|
||||
if (is_link("/usr/local/www/ext/{$configName}")) unlink("/usr/local/www/ext/{$configName}");
|
||||
mwexec("rmdir -p /usr/local/www/ext");
|
||||
$return_val = 0;
|
||||
// create links to extension files
|
||||
$return_val += mwexec("ln -sw {$rootfolder}/locale-{$configName} /usr/local/share/", true);
|
||||
$return_val += mwexec("ln -sw {$rootfolder}/{$configName}.php /usr/local/www/{$configName}.php", true);
|
||||
$return_val += mwexec("ln -sw {$rootfolder}/{$configName}-config.php /usr/local/www/{$configName}-config.php", true);
|
||||
$return_val += mwexec("ln -sw {$rootfolder}/{$configName}-update_extension.php /usr/local/www/{$configName}-update_extension.php", true);
|
||||
$return_val += mwexec("mkdir -p /usr/local/www/ext", true);
|
||||
$return_val += mwexec("ln -sw {$rootfolder}/ext /usr/local/www/ext/{$configName}", true);
|
||||
// check for product name and eventually rename translation files for new product name (XigmaNAS)
|
||||
$domain = strtolower(get_product_name());
|
||||
if ($domain <> "nas4free") $return_val += mwexec("find {$rootfolder}/locale-{$configName} -name nas4free.mo -execdir mv nas4free.mo {$domain}.mo \;", true);
|
||||
|
||||
if ($return_val == 0) exec("logger {$configName}-extension: started");
|
||||
else exec("logger {$configName}-extension: error(s) during startup, failed with return value = {$return_val}");
|
||||
?>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-stop.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -24,13 +24,17 @@
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
$extension_dir = "/usr/local/www";
|
||||
mwexec("rm -Rf {$extension_dir}/onebuttoninstaller*", true);
|
||||
mwexec("rm -Rf {$extension_dir}/ext/onebuttoninstaller", true);
|
||||
exec("logger onebuttoninstaller: stopped");
|
||||
require_once("config.inc");
|
||||
|
||||
$configName = "onebuttoninstaller";
|
||||
|
||||
if (is_link("/usr/local/share/locale-{$configName}")) unlink("/usr/local/share/locale-{$configName}");
|
||||
if (is_link("/usr/local/www/{$configName}.php")) unlink("/usr/local/www/{$configName}.php");
|
||||
if (is_link("/usr/local/www/{$configName}-config.php")) unlink("/usr/local/www/{$configName}-config.php");
|
||||
if (is_link("/usr/local/www/{$configName}-update_extension.php")) unlink("/usr/local/www/{$configName}-update_extension.php");
|
||||
if (is_link("/usr/local/www/ext/{$configName}")) unlink("/usr/local/www/ext/{$configName}");
|
||||
mwexec("rmdir -p /usr/local/www/ext");
|
||||
|
||||
exec("logger onebuttoninstaller-extension: stopped");
|
||||
?>
|
||||
|
||||
119
onebuttoninstaller/onebuttoninstaller-update_extension.php
Normal file
119
onebuttoninstaller/onebuttoninstaller-update_extension.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/*
|
||||
onebuttoninstaller-update_extension.php
|
||||
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
require("auth.inc");
|
||||
require("guiconfig.inc");
|
||||
|
||||
$configName = "onebuttoninstaller";
|
||||
$configFile = "ext/{$configName}/{$configName}.conf";
|
||||
require_once("ext/{$configName}/extension-lib.inc");
|
||||
|
||||
$domain = strtolower(get_product_name());
|
||||
$localeOSDirectory = "/usr/local/share/locale";
|
||||
$localeExtDirectory = "/usr/local/share/locale-{$configName}";
|
||||
bindtextdomain($domain, $localeExtDirectory);
|
||||
|
||||
if (($configuration = ext_load_config($configFile)) === false) $input_errors[] = sprintf(gettext("Configuration file %s not found!"), "{$configName}.conf");
|
||||
if (!isset($configuration['rootfolder']) && !is_dir($configuration['rootfolder'] )) $input_errors[] = gettext("Extension installed with fault");
|
||||
|
||||
$pgtitle = array(gettext("Extensions"), gettext($configuration['appname'])." ".$configuration['version'], gettext("Maintenance"));
|
||||
|
||||
if (is_file("{$configuration['rootfolder']}/oneload")) { require_once("{$configuration['rootfolder']}/oneload"); }
|
||||
|
||||
$return_val = mwexec("fetch -o {§configuration['rootfolder']}/version_server.txt https://git.familie-berner.de/Xigmanas/{$configName}/raw/branch/master/{$configName}/version.txt", false);
|
||||
if ($return_val == 0) {
|
||||
$server_version = exec("cat {$configuration['rootfolder']}/version_server.txt");
|
||||
if ($server_version != $configuration['version']) { $savemsg .= sprintf(gettext("New extension version %s available, push '%s' button to install the new version!"), $server_version, gettext("Update Extension")); }
|
||||
mwexec("fetch -o {$configuration['rootfolder']}/release_notes.txt https://git.familie-berner.de/Xigmanas/{$configName}/raw/branch/master/{$configName}/release_notes.txt
|
||||
}
|
||||
else { $server_version = gettext("Unable to retrieve version from server!"); }
|
||||
|
||||
if (isset($_POST['ext_remove']) && $_POST['ext_remove']) {
|
||||
// remove start/stop commands
|
||||
ext_remove_rc_commands($configName);
|
||||
// remove extension pages/links
|
||||
require_once("{$configuration['rootfolder']}/{$configName}-stop.php");
|
||||
header("Location:index.php");
|
||||
}
|
||||
|
||||
if (isset($_POST['ext_update']) && $_POST['ext_update']) {
|
||||
// download installer & install
|
||||
$return_val = mwexec("fetch -vo {$configuration}['rootfolder']}/{configName}-install.php 'https://git.familie-berner.de/Xigmanas/{$configName}/raw/branch/master/{$configName}/{$configName}-install.php'", false);
|
||||
if ($return_val == 0) {
|
||||
require_once("{$configuration['rootfolder']}/{$configName}-install.php");
|
||||
header("Refresh:8");;
|
||||
}
|
||||
else { $input_errors[] = sprintf(gettext("Download of installation file %s failed, installation aborted!"), "{$configName}-install.php"); }
|
||||
}
|
||||
|
||||
bindtextdomain($domain, $localeOSDirectory);
|
||||
include("fbegin.inc");
|
||||
bindtextdomain($domain, $localeExtDirectory);
|
||||
?>
|
||||
<form action="<?php echo $configName; ?>-update_extension.php" method="post" name="iform" id="iform" onsubmit="spinner()">
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td class="tabnavtbl">
|
||||
<ul id="tabnav">
|
||||
<?php if ($configuration['enable']) { ?>
|
||||
<li class="tabinact"><a href="onebuttoninstaller.php"><span><?=gettext("Install");?></span></a></li>
|
||||
<?php } ?>
|
||||
<li class="tabinact"><a href="onebuttoninstaller-config.php"><span><?=gettext("Configuration");?></span></a></li>
|
||||
<li class="tabact"><a href="onebuttoninstaller-update_extension.php"><span><?=gettext("Maintenance");?></span></a></li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
<tr><td class="tabcont">
|
||||
<?php if (!empty($input_errors)) print_input_errors($input_errors);?>
|
||||
<?php if (!empty($savemsg)) print_info_box($savemsg);?>
|
||||
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
||||
<?php html_titleline(gettext("Extension Update"));?>
|
||||
<?php html_text("ext_version_current", gettext("Installed version"), $configuration['version']);?>
|
||||
<?php html_text("ext_version_server", gettext("Latest version"), $server_version);?>
|
||||
<?php html_separator();?>
|
||||
</table>
|
||||
<div id="update_remarks">
|
||||
<?php html_remark("note_remove", gettext("Note"), gettext("Removing {$configuration['appname']} integration from NAS4Free will leave the installation folder untouched - remove the files using Windows Explorer, FTP or some other tool of your choice. <br /><b>Please note: this page will no longer be available.</b> You'll have to re-run {$configuration['appname']} extension installation to get it back on your NAS4Free."));?>
|
||||
<br />
|
||||
<input id="ext_update" name="ext_update" type="submit" class="formbtn" value="<?=gettext("Update Extension");?>" onclick="return confirm('<?=gettext("The selected operation will be completed. Please do not click any other buttons!");?>')" />
|
||||
<input id="ext_remove" name="ext_remove" type="submit" class="formbtn" value="<?=gettext("Remove Extension");?>" onclick="return confirm('<?=gettext("Do you really want to remove the extension from the system?");?>')" />
|
||||
</div>
|
||||
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
||||
<?php html_separator();?>
|
||||
<?php html_separator();?>
|
||||
<?php html_titleline(gettext("Extension")." ".gettext("Release Notes"));?>
|
||||
<tr>
|
||||
<td class="listt">
|
||||
<div>
|
||||
<textarea style="width: 100%;" id="content" name="content" class="listcontent" cols="1" rows="25" readonly="readonly"><?php unset($lines); exec("/bin/cat {$configuration['rootfolder']}/release_notes.txt", $lines); foreach ($lines as $line) { echo $line."\n"; }?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php include("formend.inc");?>
|
||||
</td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include("fend.inc");?>
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2020 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -24,27 +24,45 @@
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
require("auth.inc");
|
||||
require("guiconfig.inc");
|
||||
|
||||
if (is_file("/usr/local/www/bar_left.gif")) $image_path = '';
|
||||
else $image_path = 'images/';
|
||||
|
||||
require("auth.inc");
|
||||
require("guiconfig.inc");
|
||||
if (!isset($config['onebuttoninstaller']['enable'])) header("Location:onebuttoninstaller-config.php");
|
||||
$configName = "onebuttoninstaller";
|
||||
$configFile = "ext/{$configName}/{$configName}.conf";
|
||||
require_once("ext/{$configName}/extension-lib.inc");
|
||||
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale-obi");
|
||||
$pgtitle = array(gettext("Extensions"), gettext("OneButtonInstaller")." ".$config['onebuttoninstaller']['version']);
|
||||
$domain = strtolower(get_product_name());
|
||||
$localeOSDirectory = "/usr/local/share/locale";
|
||||
$localeExtDirectory = "/usr/local/share/locale-{$configName}";
|
||||
bindtextdomain($domain, $localeExtDirectory);
|
||||
|
||||
if (($configuration = ext_load_config($configFile)) === false) $input_errors[] = sprintf(gettext("Configuration file %s not found!"), "{$configName}.conf");
|
||||
if (!isset($configuration['rootfolder']) && !is_dir($configuration['rootfolder'] )) $input_errors[] = gettext("Extension installed with fault");
|
||||
|
||||
if (!$configuration['enable']) header("Location:onebuttoninstaller-config.php");
|
||||
$configurationStoragePath = $configuration['storage_path']; // to prevent collisions with installed extension definitions
|
||||
|
||||
$platform = $g['platform'];
|
||||
if ($platform == "livecd" || $platform == "liveusb")
|
||||
$input_errors[] = sprintf(gettext("Attention: the used XigmaNAS platform '%s' is not recommended for extensions! After a reboot all extensions will no longer be available, use XigmaNAS embedded or full platform instead!"), $platform);
|
||||
|
||||
$pgtitle = array(gettext("Extensions"), $configuration['appname']." ".$configuration['version']);
|
||||
|
||||
$pingServer = "github.com";
|
||||
$pingReturnVal = mwexec("ping -c1 {$pingServer}", true);
|
||||
if ($pingReturnVal != 0) $input_errors[] = sprintf(gettext("Internet connection or the server '%s' is not available, please check your DNS settings under %s > %s | %s.
|
||||
Currently the first IPv4 DNS server address is set to '%s'"), $pingServer, gettext("System"), gettext("General Setup"), gettext("DNS"), $config['system']['dnsserver'][0]);
|
||||
|
||||
$log = 0;
|
||||
$loginfo = array(
|
||||
array(
|
||||
"visible" => TRUE,
|
||||
"desc" => gettext("Extensions"),
|
||||
"logfile" => "{$config['onebuttoninstaller']['rootfolder']}extensions.txt",
|
||||
"logfile" => "{$configuration['rootfolder']}/extensions.txt",
|
||||
"filename" => "extensions.txt",
|
||||
"type" => "plain",
|
||||
"pattern" => "/^(.*)###(.*)###(.*)###(.*)###(.*)###(.*)###(.*)$/",
|
||||
@@ -82,20 +100,34 @@ function log_get_contents($logfile) {
|
||||
|
||||
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; }
|
||||
$rc_cmd_entry_found = false;
|
||||
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) { // old rc format
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$cmd_entry}/", $config['rc']['postinit']['cmd'][$i])) {
|
||||
$rc_cmd_entry_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//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
|
||||
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) { // new rc format 11.x
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$cmd_entry}/", $config['rc']['param'][$i]['value'])) {
|
||||
$rc_cmd_entry_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($rc_cmd_entry_found) return 1; // 0 = no entry, extension is not installed
|
||||
else return 0; // 1 = entry found, extension is already installed
|
||||
}
|
||||
|
||||
function log_display($loginfo) {
|
||||
global $g;
|
||||
global $config;
|
||||
global $savemsg;
|
||||
global $image_path;
|
||||
global $g, $config, $configuration, $savemsg, $image_path;
|
||||
|
||||
if (!is_array($loginfo)) return;
|
||||
|
||||
@@ -132,7 +164,7 @@ function log_display($loginfo) {
|
||||
if ((FALSE === $result) || (0 == $result)) continue;
|
||||
echo "<tr valign=\"top\">\n";
|
||||
for ($i = 0; $i < count($loginfo['columns']); $i++) { // handle pmids (columns)
|
||||
if (!isset($config['onebuttoninstaller']['show_beta']) && (strpos($result[1], "RELEASE") === false)) continue; //check for beta state
|
||||
if (!$configuration['show_beta'] && (strpos($result[1], "RELEASE") === false)) continue; //check for beta state
|
||||
else {
|
||||
if ($i == count($loginfo['columns']) - 1) {
|
||||
if (!empty($result[6])) { // something unsupported exist
|
||||
@@ -140,28 +172,25 @@ function log_display($loginfo) {
|
||||
for ($k = 0; $k < count($unsupported); $k++) { // check for unsupported release / architecture / platforms
|
||||
if (!check_min_release($unsupported[$k]) || ($unsupported[$k] == $g['arch']) || ($unsupported[$k] == $g['platform'])) {
|
||||
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/release').': '.$unsupported[$k]."' /></td>\n";
|
||||
break;
|
||||
continue 2; // unsupported, therefore we leave and proceed to the next extension in the list
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if extension is already installed (existing config.xml or postinit cmd entry)
|
||||
$already_installed = false;
|
||||
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}' ";
|
||||
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}' ";
|
||||
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";
|
||||
echo "><img src='{$image_path}status_enabled.png' border='0' alt='' title='".gettext('Enabled')."' /";
|
||||
$already_installed = true;
|
||||
}
|
||||
if (($already_installed === false) || isset($config['onebuttoninstaller']['re_install']) ) {
|
||||
if (!$already_installed || $configuration['re_install']) {
|
||||
// data for installation
|
||||
// echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}' title='".gettext('Select to install')."' >
|
||||
echo "><input title='".gettext('Select to install')."' 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";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</td>\n";
|
||||
} // EOcount
|
||||
else echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}'>" . $result[$loginfo['columns'][$i]['pmid']] . "</td>\n";
|
||||
} //EObeta-check
|
||||
@@ -171,26 +200,43 @@ echo "</td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['cleanup'], $_POST['name'])) {
|
||||
foreach($_POST['name'] as $line) {
|
||||
if (isset($line['extension'])) {
|
||||
ext_remove_rc_commands($line['extension']); // remove entry from command scripts
|
||||
unset($config[$line['extension']]); // remove entry from config.xml
|
||||
if ($line['extension'] == "plexinit") $line['extension'] = "plex-gui"; // special treatment for plex gui
|
||||
if (file_exists("/usr/local/www/ext/{$line['extension']}/menu.inc"))
|
||||
unlink("/usr/local/www/ext/{$line['extension']}/menu.inc"); // remove entry from extensions menu
|
||||
write_config();
|
||||
$savemsg .= gettext("Cleanup").": <b>{$line['truename']} ({$line['extension']})</b>"."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['install'], $_POST['name'])) {
|
||||
foreach($_POST['name'] as $line) {
|
||||
if (isset($line['extension'])) {
|
||||
ext_remove_rc_commands($line['extension']); // to force correct command script entries in case of recovered/changed config/directories for extensions
|
||||
unset($config[$line['extension']]);
|
||||
write_config();
|
||||
$savemsg .= gettext("Installation").": <b>{$line['truename']}</b>"."<br />";
|
||||
unset($result);
|
||||
exec("cd {$config["onebuttoninstaller"]["storage_path"]} && {$line['command1']}", $result, $return_val);
|
||||
exec("cd {$configurationStoragePath} && {$line['command1']}", $result, $return_val);
|
||||
if ($return_val == 0) {
|
||||
foreach ($result as $msg) $savemsg .= $msg."<br />"; // output on success
|
||||
unset($result);
|
||||
if ("{$line['command2']}" != "-") { // check if a PHP script must be executed
|
||||
if (file_exists("{$config["onebuttoninstaller"]["storage_path"]}/{$line['command2']}")) {
|
||||
if (file_exists("{$configurationStoragePath}/{$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']}");
|
||||
include("{$configurationStoragePath}/{$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 .= sprintf(gettext("PHP script %s not found!"), "{$configurationStoragePath}/{$line['command2']}")."<br />";
|
||||
}
|
||||
} // EOcommand1 OK
|
||||
else { // throw error message for command1
|
||||
@@ -201,30 +247,23 @@ if (isset($_POST['install'], $_POST['name'])) {
|
||||
} // EOforeach
|
||||
} // EOinstall
|
||||
|
||||
if (isset($_POST['update']) || (isset($config['onebuttoninstaller']['auto_update']) && !isset($_POST['install']))) {
|
||||
$return_val = mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}extensions.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/extensions.txt", true);
|
||||
$configuration = ext_load_config("ext/onebuttoninstaller/onebuttoninstaller.conf"); // to prevent collisions with installed extension definitions
|
||||
// extensions list file handling for => manual update | auto update | missing file | file older than 24 hours
|
||||
if (isset($_POST['update']) || ($configuration['auto_update'] && !isset($_POST['install'])) || !is_file("{$configuration['rootfolder']}/extensions.txt") || filemtime("{$configuration['rootfolder']}/extensions.txt") < time() - 86400) {
|
||||
$return_val = mwexec("fetch -o {$configuration['rootfolder']}/extensions.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/extensions.txt", false);
|
||||
if ($return_val == 0) $savemsg .= gettext("New extensions list successfully downloaded!")."<br />";
|
||||
else $errormsg .= gettext("Unable to retrieve extensions list from server!")."<br />";
|
||||
} // EOupdate
|
||||
|
||||
$return_val = mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}log/version.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/version.txt", false);
|
||||
if ($return_val == 0) {
|
||||
$server_version = exec("cat {$config['onebuttoninstaller']['rootfolder']}log/version.txt");
|
||||
if ($server_version != $config['onebuttoninstaller']['version']) { $savemsg .= sprintf(gettext("New extension version %s available, push '%s' button to install the new version!"), $server_version, gettext("Maintenance")); }
|
||||
} //EOversion-check
|
||||
if (($message = ext_check_version("{$configuration['rootfolder']}/version_server.txt", "onebuttoninstaller", $configuration['version'], gettext("Maintenance"))) !== false) $savemsg .= $message;
|
||||
|
||||
if (!is_file("{$config['onebuttoninstaller']['rootfolder']}extensions.txt")) $errormsg .= sprintf(gettext("File %s not found!"), "{$config['onebuttoninstaller']['rootfolder']}extensions.txt")."<br />";
|
||||
if (isset($config['onebuttoninstaller']['re_install'])) $savemsg .= sprintf(gettext("Option '%s' in '%s' is enabled!"), gettext("Re-install"), gettext("Configuration"));
|
||||
if (!is_file("{$configuration['rootfolder']}/extensions.txt")) $errormsg .= sprintf(gettext("File %s not found!"), "{$configuration['rootfolder']}/extensions.txt")."<br />";
|
||||
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale"); // to get the right main menu language
|
||||
bindtextdomain($domain, $localeOSDirectory);
|
||||
include("fbegin.inc");
|
||||
bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?>
|
||||
<!-- 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()">
|
||||
bindtextdomain($domain, $localeExtDirectory);
|
||||
?>
|
||||
<form action="<?php echo $configName; ?>.php" method="post" name="iform" id="iform" onsubmit="spinner()">
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td class="tabnavtbl">
|
||||
<ul id="tabnav">
|
||||
@@ -234,8 +273,14 @@ bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?>
|
||||
</ul>
|
||||
</td></tr>
|
||||
<tr><td class="tabcont">
|
||||
<?php if (!empty($input_errors)) print_input_errors($input_errors);?>
|
||||
<?php if (!empty($savemsg)) print_info_box($savemsg);?>
|
||||
<?php if (!empty($errormsg)) print_error_box($errormsg);?>
|
||||
<?php
|
||||
if ($configuration['re_install']) $remarkmsg .= "<li>".sprintf(gettext("Option '%s' in '%s' is enabled!"), gettext("Re-install"), gettext("Configuration"))."</li>";
|
||||
if ($configuration['show_beta']) $remarkmsg .= "<li>".sprintf(gettext("Option '%s' in '%s' is enabled!"), gettext("Beta releases"), gettext("Configuration"))."</li>";
|
||||
html_remark("storage_path", gettext("Common directory")." - {$configuration['storage_path']}", $remarkmsg);
|
||||
?><br />
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<?php
|
||||
log_display($loginfo[$log]);
|
||||
@@ -249,6 +294,9 @@ bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?>
|
||||
</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?");?>')" />
|
||||
<?php if ($configuration['re_install']) { ?>
|
||||
<input name="cleanup" type="submit" class="formbtn" title="<?=gettext("Cleanup of config and command scripts for selected entries - THIS DOES NOT PERFORM ANY UNINSTALL PROCEDURE NOR REMOVE FILES/DIRECTORIES FROM THE SERVER! Regular uninstallation should be done inside of the extensions!");?>" value="<?=gettext("Cleanup");?>" onclick="return confirm('<?=gettext("Ready to cleanup selected entries?");?>')" />
|
||||
<?php } ?>
|
||||
<input name="update" type="submit" class="formbtn" title="<?=gettext("Update extensions list");?>" value="<?=gettext("Update");?>" />
|
||||
</div>
|
||||
<?php include("formend.inc");?>
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/local/bin/php-cgi -f
|
||||
<?php
|
||||
require_once("config.inc");
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
|
||||
?>
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/local/bin/php-cgi -f
|
||||
<?php
|
||||
require_once("config.inc");
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-stop.php");
|
||||
?>
|
||||
@@ -1,14 +1,67 @@
|
||||
Version Date Description
|
||||
0.3.2 2016.08.25 N: configuration - add checkbox to enable the installation of extensions even if they are already installed
|
||||
0.4.1 2020.06.01 N: Htop CLI extension
|
||||
C: MidnightCommander & NCDU - improved startup with checks/updates for new releases & changed XigmaNAS firmware
|
||||
C: update Czech translation
|
||||
C: update Spanish translation
|
||||
C: update French translation
|
||||
C: update Ukrainian translation
|
||||
C: update Chinese translation
|
||||
C: update Turkish translation
|
||||
|
||||
0.4.0.2 2018.10.18 F: installation errors on multiple installations in some cases
|
||||
C: update Russian translation
|
||||
C: update Ukrainian translation
|
||||
|
||||
0.4.0.1 2018.09.19 F: false 'new version' messages after installation of extensions
|
||||
C: update German translation
|
||||
C: update Greek translation
|
||||
C: update Swedish translation
|
||||
C: update Ukrainian translation
|
||||
|
||||
0.4 2018.08.15 N: Ncurses Disk Usage (ncdu) shell app
|
||||
N: use dedicated config file
|
||||
N: check and warn if on LiveUSB/LiveCD
|
||||
N: check for working internet connection
|
||||
N: cleanup button on install page - usable in conjunction with the option 'Re-install' to only perform a cleanup
|
||||
without new installation of extensions
|
||||
C: improvements for option 'Re-install', cleanup of config and command scripts prior to the installation process
|
||||
F: GUI translations not working due to name change to XigmaNAS
|
||||
|
||||
0.3.4.1 2017.02.17 F: installation fails on vanilla systems => http://forums.nas4free.org/viewtopic.php?f=71&t=11189&p=75515#p75357
|
||||
|
||||
0.3.4 2016.11.23 N: command scripts rc format for NAS4Free 11.x compatibility
|
||||
N: MidnightCommander: command scripts rc format for NAS4Free 11.x compatibility
|
||||
N: Chinese (Simplified) translation
|
||||
C: update Dutch translation
|
||||
C: update Italian translation
|
||||
C: update Romanian translation
|
||||
C: update Spanish translation
|
||||
C: update Ukrainian translation
|
||||
C: MidnightCommander: symlinks for NAS4Free 11.x compatibility
|
||||
|
||||
0.3.3 2016.09.01 N: Turkish translation
|
||||
N: Ukrainian translation
|
||||
C: update Dutch translation
|
||||
C: update French translation
|
||||
C: update Greek translation
|
||||
C: update Russian translation
|
||||
C: update Spanish translation
|
||||
C: update Swedish translation
|
||||
F: Configuration - fix table view if unsupported extension exists
|
||||
|
||||
0.3.2 2016.08.25 N: Configuration - add checkbox to enable the installation of extensions even if they are already installed
|
||||
N: Swedish translation
|
||||
C: update Greek translation
|
||||
C: update German translation
|
||||
0.3.1 2016.08.15 F: OBI installer - add checkbox to override restriction for extensions installation path
|
||||
0.3 2016.08.14 N: configuration - checkbox to override restriction for extensions installation path
|
||||
|
||||
0.3 2016.08.14 N: Configuration - checkbox to override restriction for extensions installation path
|
||||
(limited to a directory under /mnt/)
|
||||
0.2 2016.08.09 N: configuration - enable/disable beta releases in extensions list
|
||||
|
||||
0.2 2016.08.09 N: Configuration - enable/disable beta releases in extensions list
|
||||
N: check hardware platform to use midnightcommander on i386 too
|
||||
F: disabling extension not possible, leads to an error message
|
||||
|
||||
0.1 2016.08.01 initial release
|
||||
|
||||
N: ... new feature
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.3.2
|
||||
0.4.1
|
||||
Reference in New Issue
Block a user