*New 12.1 series Release:
2020-03-24: XigmaNAS 12.1.0.4.7389 - released

*New 11.3 series Release:
2020-03-24: XigmaNAS 11.3.0.4.7383 - released!


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

[EXTENSION] Downloady

XigmaNAS Extensions / Add-ons

Moderator: crest

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
crest
Hardware & Software Guru
Hardware & Software Guru
Posts: 529
Joined: 02 Jul 2012 22:25
Location: Vienna, Austria - GMT+1
Status: Offline

[EXTENSION] Downloady

#1

Post by crest »

I'm very pleased to announce the new extension Downloady (DLY) which provieds a simple PHP Download Manager for http/https/ftp sites based on Downloady by CyberLeo | cyberLeo Projects.

Based on an old extension I found in an archived forum (at FreeNAS 0.6 or maybe 0.7 times ... don't remember where I found it - anyway, credits goes to the unknown developer!) I rewrote and extended it to work with NAS4Free.

DESCRIPTION

The extension
- fully integrates a wget based download manager into the NAS4Free WebGUI
- offers download restart on server reboot
- includes bandwidth limits for downloads
- has a daily scheduler to start/stop Downloady at a specific time
- is fully compatible with the new 11.x series of NAS4Free (runs on all 9.1.x - 11.x series)
- works on all architectures
- works on all plattforms (embedded, full)
- does not need jail or pkg_add.
- add pages to NAS4Free WebGUI extensions
- includes configuration and extension maintenance (update & removal) without the need to work with the system console or shell CLI

INSTALLATION / UPDATE

Prior to the installation perform a backup of the NAS4Free configuration via SYSTEM > BACKUP/RESTORE > Download configuration.

This extension can be easily installed with the OneButtonInstaller.
Update the extensions list manually prior to the installation if the switch Update extensions list automatically is not checked in OneButtonInstaller.

TRANSLATIONS

Downloady is on Launchpad - if someone wants to contribute please go to Downloady on Launchpad for translation!

DISCLAIMER

This extension is provided AS-IS, I'm NOT responsible for any data loss or damage caused by the use of it, use it solely at your own risk.

VERSION HISTORY

Version 0.1.1 - 2016.11.27
N: command scripts rc format for NAS4Free 11.x compatibility
N: add Swedish translation
N: add Ukrainian translation
C: update French translation
C: update German translation
C: update Greek translation
C: update Italian translation
C: update Russian translation
C: update Spanish translation

Version 0.1 - 2016.09.17
first public release

N: ... new feature
C: ... changes
F: ... bug fix

Some screenshots:
OBI INSTALLATION page
screen_20161203_064307.png
After the successful installation the new entry in the extensions menu
screen_20161203_064431.png
CONFIGURATION tab
Just enable the extension, choose your settings and hit Save & Restart. After that one can perform downloads under the tab Download.
screen_20161203_064802.png
DOWNLOAD tab
I hope this page is self-explanatory, here one can add one or more URLs at a time, start paused for scheduling, stop/restart/delete jobs etc ...
screen_20161203_065253.png
FILES tab
Just a simple file list of the download directory.
screen_20161203_065647.png
MAINTENANCE tab
Here one can update to new versions of the extension or remove it from the system. There is also the revision history up to the most recent (perhaps not already installed) version.
screen_20161203_065742.png

Any feedback is highly appreciated!

Regards
crest
You do not have the required permissions to view the files attached to this post.
NAS1: 11.2.0.4 - Omnius (Revision 6766) x64-embedded; MSI 760GM-P23; AMD Athlon(tm) II X2 250 7.58GiB RAM
NAS2: 11.2.0.4 - Omnius (Revision 6766) x64-embedded; MSI MS-7369; AMD Sempron(tm) LE-1250 8022MiB RAM
UPS: APC Back-UPS ES 550G
Extensions: OneButtonInstaller, Extended GUI, NextOwnCloud, BitTorrent Sync, Syncthing, Downloady, Midnight Commander, NCDU, MySQL, Rclone, Themes:

doktornotor
Advanced User
Advanced User
Posts: 200
Joined: 16 May 2017 00:22
Status: Offline

Re: [EXTENSION] Downloady

#2

Post by doktornotor »

Thanks for the nice addon, however, can you please remove the annoying automated chmods/chowns or at least make them optional? Screws my share permissions reliably. :(

User avatar
crest
Hardware & Software Guru
Hardware & Software Guru
Posts: 529
Joined: 02 Jul 2012 22:25
Location: Vienna, Austria - GMT+1
Status: Offline

Re: [EXTENSION] Downloady

#3

Post by crest »

Hello doktornotor,

doktornotor wrote:
22 May 2017 19:53
Thanks for the nice addon, however, can you please remove the annoying automated chmods/chowns or at least make them optional? Screws my share permissions reliably. :(
Thanks ;)
The point for the automated chmods is to ensure that the permissions are right to run the extension for not so experienced users - therefore it is necessary to have at least +r and +x set down to the download path (set in Extensions > Downloady 0.1.1 > Configuration > Download directory).
Can you please mention / give me an example what's the problem in more detail - would be interesting to avoid such things in future!

Best regards
crest
NAS1: 11.2.0.4 - Omnius (Revision 6766) x64-embedded; MSI 760GM-P23; AMD Athlon(tm) II X2 250 7.58GiB RAM
NAS2: 11.2.0.4 - Omnius (Revision 6766) x64-embedded; MSI MS-7369; AMD Sempron(tm) LE-1250 8022MiB RAM
UPS: APC Back-UPS ES 550G
Extensions: OneButtonInstaller, Extended GUI, NextOwnCloud, BitTorrent Sync, Syncthing, Downloady, Midnight Commander, NCDU, MySQL, Rclone, Themes:

doktornotor
Advanced User
Advanced User
Posts: 200
Joined: 16 May 2017 00:22
Status: Offline

Re: [EXTENSION] Downloady

#4

Post by doktornotor »

Talking about this offending code mainly:

Code: Select all

                $path_elements = $path_elements - 1;
                $directory = $directory."/$path_check[$path_elements]"; // add last level
                exec("chmod 775 {$directory}");                         // set permissions to 775
                exec("chown {$_POST['who']} {$directory}*");

and this thing goes recursively up right to the share (mountpoint) root. Well, I have the downloads share set as 2775 (sgid) with owner and group being administrator/staff (AD user/group) . So, any messing with that is obviously undesired.

I simply did stick return true; at the top of change_perms() function meanwhile. At minimum, I'd suggest using is_writable()/is_readable()/is_executable() to only touch the perms if really required.

P.S. No need for exec() there, you can use chmod("/somedir/somefile", 0775) (do not omit the 0!) and chown() native.

User avatar
crest
Hardware & Software Guru
Hardware & Software Guru
Posts: 529
Joined: 02 Jul 2012 22:25
Location: Vienna, Austria - GMT+1
Status: Offline

Re: [EXTENSION] Downloady

#5

Post by crest »

doktornotor wrote:
27 May 2017 09:19
Talking about this offending code mainly:

Code: Select all

                $path_elements = $path_elements - 1;
                $directory = $directory."/$path_check[$path_elements]"; // add last level
                exec("chmod 775 {$directory}");                         // set permissions to 775
                exec("chown {$_POST['who']} {$directory}*");

and this thing goes recursively up right to the share (mountpoint) root. Well, I have the downloads share set as 2775 (sgid) with owner and group being administrator/staff (AD user/group) . So, any messing with that is obviously undesired.

I simply did stick return true; at the top of change_perms() function meanwhile. At minimum, I'd suggest using is_writable()/is_readable()/is_executable() to only touch the perms if really required.
Good point, will implement it in the next release of the extension!

P.S. No need for exec() there, you can use chmod("/somedir/somefile", 0775) (do not omit the 0!) and chown() native.
:lol: Yes, I know this code part is a rather old one, not improved during the years ...
NAS1: 11.2.0.4 - Omnius (Revision 6766) x64-embedded; MSI 760GM-P23; AMD Athlon(tm) II X2 250 7.58GiB RAM
NAS2: 11.2.0.4 - Omnius (Revision 6766) x64-embedded; MSI MS-7369; AMD Sempron(tm) LE-1250 8022MiB RAM
UPS: APC Back-UPS ES 550G
Extensions: OneButtonInstaller, Extended GUI, NextOwnCloud, BitTorrent Sync, Syncthing, Downloady, Midnight Commander, NCDU, MySQL, Rclone, Themes:

Malussilvestris
NewUser
NewUser
Posts: 6
Joined: 29 Oct 2017 13:32
Status: Offline

Re: [EXTENSION] Downloady

#6

Post by Malussilvestris »

Thanks for this nice little addon.

Unfortunately after updating to 12.1.0.4 - Ingva (revision 7091), it does not work anymore. Probably due to share library issues:

xigmanas-backup: ~# wget
ld-elf.so.1: Shared object "libssl.so.7" not found, required by "wget"

Best regards
Malussilvestris

Post Reply

Return to “Extensions / Add-ons”