57 Commits

Author SHA1 Message Date
crestAT
696e2768f2 v0.4.0.1 2018-09-19 07:41:57 +02:00
crestAT
83f6711b2b add Zrep 2018-09-09 19:22:29 +02:00
crestAT
805071a104 cosmetic cahnges 2018-09-04 10:28:07 +02:00
crestAT
1ba4dbceb9 change RRDGraphs & remove eGUI beta 2018-09-04 10:22:06 +02:00
crestAT
7a8016176d update eGUI v0.7 2018-08-25 10:34:23 +02:00
crestAT
535e73b3b4 v0.4 2018-08-15 20:31:44 +02:00
crestAT
98f5593f45 update Extended GUI 0.6.3-b1 description 2017-07-06 03:38:00 +02:00
crestAT
513cec5256 amended Plex and Extended GUI descriptions 2017-07-01 07:21:18 +02:00
crestAT
a4d27c34c3 add Plex Pass and Extended GUI 0.6.3-b1 to the beta channel 2017-06-30 05:23:54 +02:00
crestAT
850a73a0b4 amend DNSMasq version numbering 2017-04-26 07:20:23 +03:00
crestAT
4c5ea3ab16 remove compatibility notes for all RELEASE (non beta) extensions 2017-04-22 08:41:48 +03:00
crestAT
8e15be5ad5 update compatibility release notes to r4141 and DNSMasq 0.4 2017-03-29 09:15:07 +02:00
crestAT
c4fd186662 update NOC v0.3 2017-03-27 15:23:59 +02:00
crestAT
35b9cee955 updated compatibility release notes to r4124 2017-03-27 08:14:08 +02:00
crestAT
eae7031298 updated compatibility release notes to r4067 2017-03-19 08:10:39 +01:00
crestAT
f0d035866a updated compatibility release notes to r4066 2017-03-18 07:05:15 +01:00
crestAT
d71d4b77a6 update NOC v0.2.2 2017-03-15 09:40:47 +01:00
crestAT
33aad8d171 update eGUI v0.6.2 2017-03-13 08:52:54 +01:00
crestAT
c9dcb9e1c6 updated compatibility release notes 2017-03-11 07:33:30 +01:00
crest
ad45a13fb9 Create LICENSE.txt (#3) 2017-03-09 08:04:51 +01:00
crestAT
a7807fd115 updated PHP 7.1 check marks 2017-03-08 10:41:32 +01:00
crestAT
a7166fcb33 updated BTS description (Resilio Sync) 2017-03-06 05:28:19 +01:00
crestAT
9431f59704 update BTS v0.7.2 2017-03-05 10:08:03 +01:00
crestAT
7b15775f15 mark extensions checked with PHP 7.1 2017-03-03 09:41:29 +01:00
crestAT
cd7b98b5ae update eGUI v0.6.1, remove eGUI v0.6.1-beta 2017-02-28 10:09:42 +01:00
crestAT
7169a5df11 v0.3.4.1
F: installation fails on vanilla systems
2017-02-17 09:10:41 +01:00
crestAT
afac4582a3 add eGUI v0.6.1-b1 2017-01-13 08:10:28 +01:00
crestAT
e13d0697aa add TheBrig installation restriction 2017-01-07 13:24:25 +01:00
crestAT
e099e6a1a3 change description to GitHub Wiki for Syncthing v0.2 2017-01-04 05:48:01 +01:00
crestAT
5dce9f59a5 update Syncthing v0.2 2017-01-03 09:27:51 +01:00
crestAT
5dd9f9b9d7 update TheBrig version 2016-12-31 08:02:48 +01:00
crestAT
537f0d1e35 update eGUI v0.6 2016-12-11 11:23:54 +01:00
crestAT
e436f7b6f0 changed Plex, reverted to Github repo 2016-12-06 06:52:49 +01:00
crestAT
f9c222824e changed Plex installation path and procedure 2016-12-05 05:39:14 +01:00
crestAT
7deac353e3 update OwnCloud to NextOwnCloud 2016-12-02 06:30:41 +01:00
crestAT
b620e047a2 Development (#2)
* v0.3.4

* v0.3.4

* v0.3.4

* v0.3.4

* v0.3.4

* v0.3.4
2016-11-25 08:31:08 +01:00
crestAT
d8e1934620 new RRDG v0.3.3 2016-11-20 12:16:04 +01:00
crestAT
60442895f6 new plex sf path 2016-11-10 10:06:22 +01:00
crestAT
45a7f7ca05 changed Plex to new SF installation path 2016-11-10 08:26:58 +01:00
crestAT
7042e5958a changed Plex restriction
Plex Extension 4.1.054 needs at least N4F 10.3
2016-11-07 06:32:00 +01:00
crestAT
d07c88c4c4 add eGUI v0.6-b9 2016-10-08 06:34:01 +02:00
crestAT
4659cb77cb add eGUI v0.6-b8 2016-10-05 07:08:56 +02:00
crestAT
3405a8b116 add eGUI v06-b7 2016-09-30 08:55:52 +02:00
crestAT
2c7cfd1c2b update OwnCloud 2016-09-22 08:16:08 +02:00
crestAT
b9f2003020 add eGUI v0.6-b3 2016-09-19 09:18:25 +02:00
crestAT
4019d157d9 add eGUI v06-b2 2016-09-18 12:17:03 +02:00
crestAT
96081af83e change Downloady entry 2016-09-17 09:31:06 +02:00
crestAT
c0fae3308d add Downloady beta 2016-09-15 09:17:33 +02:00
crestAT
4fd79c7566 add OwnCloud beta 2016-09-13 09:27:14 +02:00
crestAT
bd93001678 update Plex revision number 2016-09-10 14:40:29 +02:00
crestAT
2eff3da6a6 update RRDG beta 2016-09-10 08:25:07 +02:00
crestAT
57933c9359 add beta eGUI and RRDG 2016-09-06 15:47:53 +02:00
crestAT
d9a2d132b3 v0.3.3
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
2016-09-01 07:55:40 +02:00
crestAT
6cebc0d1d2 v0.3.2
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
2016-08-25 07:15:55 +02:00
crestAT
4f8c2385f0 v0.3.1 (#1)
* v0.3.1

update for path_check

* v0.3.1

update strings

* v0.3.1

remove test code

* v0.3.1

update release strings
2016-08-15 07:47:46 +02:00
crestAT
db32583c34 v0.3 2016-08-14 09:13:25 +02:00
crestAT
061867ff8b v0.3
N: configuration - checkbox to override restriction for extensions
installation path (limited to a directory under /mnt/)
2016-08-14 08:55:54 +02:00
54 changed files with 943 additions and 424 deletions

17
.gitattributes vendored
View File

@@ -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
View File

@@ -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
View File

@@ -0,0 +1,25 @@
BSD 2-Clause License
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:
* 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.

20
OBI.php
View File

@@ -2,7 +2,7 @@
/*
OBI.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2015 - 2018 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
*/
@@ -76,22 +76,23 @@ if (isset($_POST['save']) && $_POST['save']) {
if (empty($input_errors)) {
$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 (strpos($config['onebuttoninstaller']['storage_path'], "/mnt/") === false) {
if (!isset($_POST['path_check']) && (strpos($config['onebuttoninstaller']['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);
change_perms($config['onebuttoninstaller']['storage_path']);
$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");
}
else {
$input_errors[] = sprintf(gettext("Installation file %s not found, installation aborted!"), "{$install_dir}onebuttoninstaller/onebuttoninstaller-install.php");
exit;
return;
}
mwexec("rm -Rf ext/OBI; rm -f OBI.php", true);
header("Location:onebuttoninstaller-config.php");
@@ -107,6 +108,7 @@ if (isset($_POST['cancel']) && $_POST['cancel']) {
}
$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;
include("fbegin.inc"); ?>
<form action="OBI.php" method="post" name="iform" id="iform">
@@ -117,7 +119,7 @@ include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<?php html_titleline($application);?>
<?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);?>
</table>
<?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);?> </table>
<div id="submit">
<input id="save" name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>"/>
<input id="cancel" name="cancel" type="submit" class="formbtn" value="<?=gettext("Cancel");?>"/>

View File

@@ -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>

View 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();
?>

View File

@@ -0,0 +1,69 @@
<?php
/*
universal postinit file for CLI extensions
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.
*/
require_once("config.inc");
$appName = "Midnight Commander";
$command = "mcommander.sh";
$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'] = "{$cmd}";
$rc_param['comment'] = "Start {$appName}";
$rc_param['typeid'] = '2';
$rc_param['enable'] = true;
$config['rc']['param'][] = $rc_param;
}
else {
$config['rc']['postinit']['cmd'][] = "{$cmd}";
}
write_config();
?>

View File

@@ -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

View File

@@ -0,0 +1,69 @@
<?php
/*
universal postinit file for CLI extensions
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.
*/
require_once("config.inc");
$appName = "NCurses Disk Usage";
$command = "ncdu.sh";
$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'] = "{$cmd}";
$rc_param['comment'] = "Start {$appName}";
$rc_param['typeid'] = '2';
$rc_param['enable'] = true;
$config['rc']['param'][] = $rc_param;
}
else {
$config['rc']['postinit']['cmd'][] = "{$cmd}";
}
write_config();
?>

View 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'.

View File

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

View File

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

View File

@@ -0,0 +1,208 @@
<?php
/*
extension-lib.inc
Copyright (c) 2016 - 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.
*/
$extension_lib_version = "1.2";
/* Version history:
* 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_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 = utf8_encode($config_data);
$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();
}
}
?>

View File

@@ -1,135 +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']);) {
if (preg_match('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) { unset($config['rc']['postinit']['cmd'][$i]);} else{}
++$i;
}
}
if ( is_array($config['rc']['shutdown'] ) && is_array( $config['rc']['shutdown']['cmd'] ) ) {
for ($i = 0; $i < count($config['rc']['shutdown']['cmd']); ) {
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) { unset($config['rc']['shutdown']['cmd'][$i]); } else {}
++$i;
}
}
// remove extension pages
mwexec ("rm -rf /usr/local/www/ext/onebuttoninstaller");
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");?>

View File

@@ -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

View File

@@ -1,9 +1,14 @@
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="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###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><font color="blue">PLEASE NOTE: Extended GUI versions older then v0.5.3 should be uninstalled and v0.6.x afterwards newly installed!</font><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>###11.1044517###
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###
Midnight Commander###<font color="green">RELEASE<br>4.8.8</font>###mcommander.sh###mkdir -p midnightcommander && cd midnightcommander && cp /usr/local/www/ext/onebuttoninstaller/../apps/mcommander.* . && chmod u+x mcommander.sh && `pwd`/mcommander.sh###midnightcommander/mcommander.postinit###Midnight Commander for XigmaNAS.<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>###rpi, rpi2, rpi3, bananapi###
NCurses Disk Usage###<font color="green">RELEASE<br>1.12</font>###ncdu.sh###mkdir -p ncdu && cd ncdu && cp /usr/local/www/ext/onebuttoninstaller/../apps/ncdu.* . && chmod u+x ncdu.sh && `pwd`/ncdu.sh###ncdu/ncdu.postinit###NCurses Disk Usage<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>###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 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.2.x</font>###plexinit###mkdir -p plex && cd plex && fetch https://raw.githubusercontent.com/JRGTH/nas4free-plex-extension/master/plex/plexinit && chmod +x plexinit && ./plexinit -o###plex/postinit###Plex Media Server Add-On for XigmaNAS 10.3 and later.<br><br>The extension works on XigmaNAS 10.3 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 actual Plex config, Plex IP address will be locally visible by any devices.<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 && echo "Installation file successfully downloaded"###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>At the moment no SQL database system will be installed so the XigmaNAS built-in SQLite or an existing mySQL or MariaDB installation can be used.</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">BETA<br>4.2.x</font>###plex###mkdir -p plexpass && cd plexpass && fetch https://raw.githubusercontent.com/JRGTH/nas4free-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###

View File

@@ -1 +1 @@
c143308bd6f18d8d4c42c1daaab553cb1eeadca1e89db29909b93dfb80b0dc69ed5ea3e5cc91813f3598a9edf414750a101e2a0449d945eedeb448f1252a6132
39825b1603898d0fd2e541c8ecf47b7d2664c6e4cf0db0d508d7f22926263a0059e09c7ebcea805b8d528bef3d660e05d6b22436a38eed5516fab4cea06d328b

View File

@@ -2,7 +2,7 @@
/*
onebuttoninstaller-config.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2015 - 2018 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,39 +90,49 @@ 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 (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']['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());
$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['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'];
bindtextdomain("nas4free", "/usr/local/share/locale"); // to get the right main menu language
if (($message = ext_check_version("{$configuration['rootfolder']}/version_server.txt", "{$configName}", $configuration['version'], gettext("Maintenance"))) !== false) $savemsg .= $message;
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) {
var endis = !(document.iform.enable.checked || enable_change);
document.iform.storage_path.disabled = endis;
document.iform.storage_pathbrowsebtn.disabled = endis;
document.iform.path_check.disabled = endis;
document.iform.re_install.disabled = endis;
document.iform.auto_update.disabled = endis;
document.iform.show_beta.disabled = endis;
}
@@ -121,23 +142,22 @@ function enable_change(enable_change) {
<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);?>
<?php html_checkbox("auto_update", gettext("Update"), $pconfig['auto_update'], gettext("Update extensions list automatically."), "", false);?>
<?php html_checkbox("show_beta", gettext("Beta releases"), $pconfig['show_beta'], gettext("If enabled, extensions in beta state will be shown in the extensions list."), "", false);?>
</table>

View File

@@ -2,7 +2,7 @@
/*
onebuttoninstaller-install.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2015 - 2018 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.2"; // extension version
$appname = "OneButtonInstaller";
$v = "v0.4.0.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);
?>

View File

@@ -2,7 +2,7 @@
/*
onebuttoninstaller-start.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2015 - 2018 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}");
?>

View File

@@ -2,7 +2,7 @@
/*
onebuttoninstaller-stop.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2015 - 2018 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");
?>

View File

@@ -0,0 +1,124 @@
<?php
/*
onebuttoninstaller-update_extension.php
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.
*/
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://raw.github.com/crestAT/nas4free-{$configName}/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://raw.github.com/crestAT/nas4free-{$configName}/master/{$configName}/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
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://raw.github.com/crestAT/nas4free-{$configName}/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);
?>
<!-- The Spinner Elements -->
<?php include("ext/{$configName}/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 ($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: 98%;" 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");?>

View File

@@ -2,7 +2,7 @@
/*
onebuttoninstaller.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2015 - 2018 Andreas Schmidhuber
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -24,27 +24,44 @@
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");
$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 +99,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,37 +163,33 @@ 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) {
// check if extension is already installed (existing config.xml or postinit cmd entry)
if ((isset($config[$result[2]])) || (log_get_status($result[2]) == 1)) {
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}'> <img src='{$image_path}status_enabled.png' border='0' alt='' title='".gettext('Enabled')."' /></td>\n";
}
else { // not installed
$supported_app = true;
if (!empty($result[6])) { // something unsupported exist
$unsupported = explode(",", str_replace(" ", "", $result[6]));
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";
$supported_app = false;
break;
}
if (!empty($result[6])) { // something unsupported exist
$unsupported = explode(",", str_replace(" ", "", $result[6]));
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";
continue 2; // unsupported, therefore we leave and proceed to the next extension in the list
}
}
if ($supported_app === true) {
// data for installation
echo "<td {$loginfo['columns'][$i]['param']} class='{$loginfo['columns'][$i]['class']}' title='".gettext('Select to install')."' >
<input type='checkbox' name='name[".$j."][extension]' value='".$result[2]."' />
<input type='hidden' name='name[".$j."][truename]' value='".$result[0]."' />
<input type='hidden' name='name[".$j."][command1]' value='".$result[3]."' />
<input type='hidden' name='name[".$j."][command2]' value='".$result[4]."' />
</td>\n";
}
} // EOnot-installed
}
}
// 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']}' ";
if ((isset($config[$result[2]])) || (log_get_status($result[2]) == 1)) {
echo "><img src='{$image_path}status_enabled.png' border='0' alt='' title='".gettext('Enabled')."' /";
$already_installed = true;
}
if (!$already_installed || $configuration['re_install']) {
// data for installation
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]."' />";
}
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
@@ -172,26 +199,43 @@ function log_display($loginfo) {
}
}
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 {$configuration['storage_path']} && {$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("{$configuration['storage_path']}/{$line['command2']}")) {
$savemsg_old = $savemsg; // save messages for use after output buffering ends
ob_start(); // start output buffering
include("{$config['onebuttoninstaller']['storage_path']}/{$line['command2']}");
include("{$configuration['storage_path']}/{$line['command2']}");
$ausgabe = ob_get_contents(); // get outputs from include command
ob_end_clean(); // close output buffering
$savemsg = $savemsg_old; // recover saved messages ...
$savemsg .= str_replace("\n", "<br />", $ausgabe)."<br />"; // ... and append messages from include command
}
else $errormsg .= sprintf(gettext("PHP script %s not found!"), "{$config["onebuttoninstaller"]["storage_path"]}/{$line['command2']}")."<br />";
else $errormsg .= sprintf(gettext("PHP script %s not found!"), "{$configuration['storage_path']}/{$line['command2']}")."<br />";
}
} // EOcommand1 OK
else { // throw error message for command1
@@ -202,17 +246,22 @@ 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
if (!is_file("{$config['onebuttoninstaller']['rootfolder']}extensions.txt")) $errormsg .= sprintf(gettext("File %s not found!"), "{$config['onebuttoninstaller']['rootfolder']}extensions.txt")."<br />";
if (($message = ext_check_version("{$configuration['rootfolder']}/version_server.txt", "onebuttoninstaller", $configuration['version'], gettext("Maintenance"))) !== false) $savemsg .= $message;
bindtextdomain("nas4free", "/usr/local/share/locale"); // to get the right main menu language
if (!is_file("{$configuration['rootfolder']}/extensions.txt")) $errormsg .= sprintf(gettext("File %s not found!"), "{$configuration['rootfolder']}/extensions.txt")."<br />";
bindtextdomain($domain, $localeOSDirectory);
include("fbegin.inc");
bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?>
bindtextdomain($domain, $localeExtDirectory);
?>
<!-- The Spinner Elements -->
<?php include("ext/onebuttoninstaller/spinner.inc");?>
<script src="ext/onebuttoninstaller/spin.min.js"></script>
@@ -228,8 +277,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]);
@@ -243,6 +298,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");?>

View File

@@ -1,5 +0,0 @@
#!/usr/local/bin/php-cgi -f
<?php
require_once("config.inc");
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
?>

View File

@@ -1,5 +0,0 @@
#!/usr/local/bin/php-cgi -f
<?php
require_once("config.inc");
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-stop.php");
?>

View File

@@ -1,7 +1,54 @@
Version Date Description
0.2 2016.08.09 N: configuration - enable/disable beta releases in extensions list
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
(limited to a directory under /mnt/)
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

View File

@@ -1 +1 @@
0.2
0.4.0.1