3rd party zypkgs

MetaRepository
The package which makes all others possible.

What it is
Basically it's a CGI script which runs locally on the NAS. Using the web_prefix file the package manager is pointed to it. The script downloads the ZYPKG_INFO.tgz or ZYPKGS file from several repositories, and combines that to a single file, on base of (alphabetically) sorting the packages. Further it keeps a database of origin of all those packages, and when requested it downloads and offers them.

How to install
Enter the url http://downloads.zyxel.nas-central.org/Users/Mijzelf/zypkg-repo/ in a text file web_prefix, or download the text file here, and put the text file in \\\admin\zy-pkgs\. Then in the package menu press on the 'Retreive List From Internet' button. (On firmware 5.20+ this is the 'Cycle icon' in 'App Center->Browse->All Apps'). Only the MetaRepository package should show up. Install it, and re-request the list. You should see the official Taiwanese repository, merged with mine (ffp, btsync, anyterm, MetaRepository, Tweaks, Dropbear, MidnightCommander). If you still see only MetaRepository, disable it, enable it again, and retry.

NAS5xx, NAS326
(Firmware 5.10+ only) On this NAS there is no subdirectory \\\admin\zy-pkgs\. Just add the zy-pkgs subdirectory.

NSA-212 (Medion)
For the NSA212, there is no support for the web_prefix file, so the procedure is a bit different. Enable the Telnet Backdoor, login over telnet (as root), and execute echo http://downloads.zyxel.nas-central.org/Users/Mijzelf/zypkg-repo/package >/etc/package_src_url In the package menu in the webinterface execute 'Retreive list from Internet'. Do not try to install anything else than MetaRepository. When MetaRepsitory is installed, goto the MetaRepository page, and change 'ftp://ftp2.zyxel.com/+' in 'ftp://ftp2.zyxel.com/NSA310/4.40/zypkg/' (without the quotes), and if you also want the Medion repository add a line 'ftp://nas-download:sEhtalr@download.medion.de/package/'. Now hit apply, and re-retreive the package list.

Warning: not all ZyXEL packages run on a Medion. Here you can find a list of working packages.

How to configure
In the package menu you can see the configuration page of MetaRepositoy. Here you can enter the source repositories. Further you can blacklist packages, and 'pushlist' them. A word on 'pushlisting': As said, the packages are sorted alphabetically, and then the 'highest value' is chosen. Now the official repository contains a nzbget 9.x, while the beta repository contains a nzbget 11.x. Unfortunately 11 has a lower alphabetically value than 9. You can push nzbget 11, which actually means it's exchange by nzbget z11, restoring the wanted sequence.

How to create your own (local) repository
Just put the package(s) in a share, in combination with a describing ZYPKGS file (case sensitive). Add the full path to the 'Repositories' list. Done. You can also supply a ZYPKG_INFO.tgz if you like. The script first tries to download/copy the ZYPKG_INFO.tgz file, and if that fails it tries ZYPKGS.

Release notes

 * 20161021zypkg014:
 * Added support for firmware 5.20
 * 20160513zypkg013
 * Added support for the curl downloader
 * Squashed a small bug causing a 'permission denied' line in the logs
 * 20151005zypkg012
 * Added repo names which show up in the package manager webinterface
 * Added multithreading. The repos are fetched simultaneously instead of sequnetially
 * 20150916zypkg011:
 * Added support for the NAS500 series, firmware 5.10 and newer
 * Removed the 'donate' button
 * 20140529zypkg010
 * The firmware really doesn't like it when more instances of httpd are running. When it's running as httpd it's killed sometimes. When using symlinks or bindmounts the firmware webserver will not be restarted when needed, because start-stop-daemon detects it's already running. Solved it by using inetd, which directly calls the cgi script. Who needs a webserver?
 * 20140520zypkg009
 * Changed sort strategy. Instead of sorting on some-versionzypkgpkg-version, now is sorted on pkg-version, just like the zypkg-manager does. So the pushlist is no longer necessary.
 * Added repo priority. When two equal packages are offered by different repo's, it was unpredictable which one was used. Now the sequence in the repo-list is also the priority sequence.
 * Found what was killing my server. The firmware did sometimes a 'killall httpd'. Solved it by using a symlink
 * 20140418zpkg008
 * Fixed a bug which kept a Medion from installing original Medion packages
 * Limited the number of retries of wget, to protect the script against a non-existing host.
 * 20140407zpkg007
 * Fixed this bug by using ftp passive mode
 * 20140405zpkg005
 * Some internal database files weren't cleaned up in time
 * Added support for Medion boxes
 * When an installed package is dropped from the upstream repo, it's no longer maintainable in the packages menu. On a Medion the whole list vanishes. To solve this, I add these orphaned packages to the generated repo file.
 * 20140401zpkg004
 * Fixed this bug, ownership and accessrights of certain directories were borked.
 * 20140310zpkg003
 * Fixed a bug which kept the package from upgrading itself.
 * 20140308zpkg002
 * Some cosmetical updates
 * The used webserver was killed by *something*. Solved it by wrapping it in a script, and automatically restart it.
 * 20140303zpkg001
 * Initial release.

Tweaks
Firmware tweaks

Cron
Add your own cronjobs

FTP daemon
Change advertised IP address, and/or force FTPS

Change homedir
of admin and/or root to a non-volatile place

Shutdown daemon
Shutdown the box at certain time, when the disks are sleeping, when no network activity is pending, when some host is down, ...

Telnet daemon
Enable the telnet daemon on a configurable port. Possibly loginless.

Packages on usb stick
Move the whole zypkg system (actually the /i-data/md0/.system/ directory) to USB stick. It will use the advantages of usb_key_func.sh to hotpatch /etc/init.d/rcS at boot. Because usb_key_func.sh can be suffering from the timing problem, you can optionally apply a patch

Notes:
 * This won't work on the NSA325 USB3 (front) port.
 * At the moment it won't work on an NSA221 either. The NSA221 has some internal USB connected memory, which can confuse the script. Need a volunteer to check that.

USB Disk somnifacient
Put the USB disks asleep after a adjustable amount of idle time. The deamon probes (using cron) once a minute the file /sys/block/sdx/stat, to find the activity in past minute. When no activity was found for an adjustable amount of time, sg_start is used to put the disk asleep.

Webserver
You can change the http and/or https port of the firmware webserver. Because this can bring down the webserver, you have to confirm the setting after the port change is applied. Without confirmation the old setting will be reverted in 3 minutes.

Network info
Shows information about IP addresses, open server ports and active connections.

Disk monitor
This daemon starts kernel logging by executing echo 1 >/proc/sys/vm/block_dump and executes 'dmesg' regularly to write the kernel log ringbuffer to a logfile (in ram). The last 100 lines of the log can be seen in the webinterface, and you can also download the whole logfile. (Max 8MB).

On my Medion for some reason sometimes the daemon refuses to start. In that case disable and enable the Tweaks package, and retry.

Process monitor
Basically the 'top' output converted to HTML.

Disable unneeded daemons
Of course not all this daemons are unneeded for everyone.

Intercept copy button
You can execute your own scripts on pressing the copy button. The button has two different functions, for a short press and a long press.

Shell access for any user
Enable shell access for any selected user.

Medion tweaks
NSA-212 only. The NSA-212 doesn't have a way to properly shutdown the box. Enable fake poweroff (disk unmounted and spinned down, network down, leds off) Enable WOL (When enabled, the network won't be shut down) Enable a fix for this samba issue.

Force webinterface desktop
The NAS automatically chooses a desktop for the webinterface, based on the user agent of your browser, mobile or PC. Using this tweak you can force it to PC. Only available on certain NSA3xx boxes.

Release notes

 * 20171124zypkg030
 * Added a 'Force webinterface desktop' option to get rid of the mobile interface. Idea of MrDini. Only available on certain NSA3xx boxes.
 * 20170630zypkg029
 * Solved this issue; it was not possible to use another homedir for admin or root than the predefined onces.
 * On firmware 5.21 syslog-ng is no longer started, which made the shutdown tool fail in detecting disk spindown.
 * 20161216zypkg028
 * Added an entry to 'Disable unneeded daemons', ntpdate_sync.sh.
 * 20161106zypkg027
 * Added a 'Disable autoinstall of myZyXELcloud-Agent' to 'Disable daemons'.
 * 20161030zypkg026
 * Removed webserver tweaks for firmware 5.20, as it has firmware support for the same functions
 * Added a 'Disable rbm.sh daemon' option, as it can wakeup external disks.
 * Added a desktop icon for firmware 5.20. Created by Timm0.
 * 20160923zypkg025
 * Solved an issue with disabling python daemons on firmware 5.20
 * 20160725zypkg024
 * Solved a bug which prevented to delete the last remaining line in the crond edit field
 * Added a daemon filter in the TCP/IP settings of the shutdown daemon
 * 20160515zypkg023
 * Solved this issue: On certain firmware(s?) a busybox shell script rather calls an internal applet than an extern binary, which made the /bin/ln hook fail. Now /sbin/zyshd.sh is hooked instead.
 * Added 'Packages on usb-stick' (or SD card) support for firmware 5. (NAS5xx and NAS326)
 * 20151123zypkg022
 * Added 'Intercept Copy Button' support for the NAS5xx.
 * Added 'pass to stock daemon' to 'Intercept Copy Button', to run both the firmware daemon, and your own.
 * Added disk sleep detection in the 'Shutdown daemon' for the NAS5xx.
 * 20151017zypkg021
 * Fixed a bug which made the background daemon unreachable on a Medion.
 * Some weird behaviour of /bin/top made 'Disable unneeded daemons' fail on a NAS5xx. Worked around the problem.
 * Since version 20150430 'Intercept copy button' didn't work anymore. Fixed.
 * 20150919zypkg020
 * Added zypkg support for the NAS500 series, firmware 5.10 and newer
 * 20150625zypkg019, 20150625.opk
 * Added FTP FXP support.
 * 20150622zypkg018, 20150622.opk
 * Solved this issue. Now Admin users can also have shell access enabled.
 * The (hooked by 'Shell access') /bin/passwd pointed to a wrong script location on the 540.
 * /bin/passwd was not restored when disabling Tweaks or Shell access.
 * 20150430.opk
 * Ported to the NAS540
 * 20141213zypkg017
 * Clarified some 'Shutdown daemon' text
 * Implemented a workaround for this samba issue on the Medion
 * 20140912zpkg016
 * Squashed the bug in the shutdown time interval reported here.
 * 20140905zpkg015
 * Enhancements to the shutdown daemon. For the TCP/IP and NFS filter you can now use wildcard addresses (subnets), and specify ports to in- or exclude. Further the status shows which clients are retarding the shutdown.
 * 20140812zpkg014
 * Added shell access for selected users.
 * 20140719zpkg013
 * Added an 'Intercept copy button' tool.
 * 20140705zpkg012
 * Added a 'Disable unneeded daemons' tool.
 * 20140601zpkg011
 * Added a disk monitor, to see which processes are accessing the disk(s)
 * Added a process monitor. Basically a webinterface for 'top'
 * 20140521zpkg010
 * Added Webserver tweaks. Change http and https port
 * Added USB disk sleep daemon
 * Added USB disk status to shutdown daemon
 * Changed layout. Page became far too large
 * Added Network info page. (Open ports, current connections, ...)
 * 20140429zpkg009
 * Bugfix on 'Packages on usb stick'. On some systems the creation of the stick failed, due to a mounting problem.
 * 20140427zpkg008
 * Added some Ajax stuff.
 * Added a 'Packages on usb stick' plugin
 * 20140416zpkg007
 * Added probe interval and hit counter to Shutdown daemon.
 * 20140414zpkg006
 * Added check for No_Disk in disk activity checker in Shutdown daemon.
 * 20140411zpkg005
 * Added ping to Shutdown daemon
 * Added 'fakepoweroff' and '-WOL' for Medion boxes
 * 20140408zpkg004
 * Added Shutdown daemon
 * 20140407zpkg003
 * Busybox shell of Medion appears not to be able to run functions in background. Daemonizing is now done by invoking the script again
 * 20140402zpkg002
 * Minor bugfixes
 * 20140327zpkg001
 * Initial release

FFP
The Fonz Funplug

btsync
[http://www.bittorrent.com/sync Secure, unlimited file-syncing. No cloud required.]

anyterm
A terminal in a webshell.

Dropbear
A lightweigth ssh and scp server

MidnightCommander
A text based file manager for use in telnet, ssh or anyterm

RandomTools
Some random tools. Currently

unrar 5.4.5
A tool to extract rar archives.

screen 4.2.1
A full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Website

nano 2.2.6
GNU nano is designed to be a free replacement for the Pico text editor, part of the Pine email suite from The University of Washington. It aims to "emulate Pico as closely as possible and perhaps include extra functionality". Website

su 8.15
Run a shell with substitute user and group IDs. In most cases used to elevate to a root shell.

sudo 1.6.8p12
Sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.

iftop 1.0pre4
iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts. Handy for answering the question "why is our ADSL link so slow?". Website

htop 1.0.3
An interactive process viewer for Linux. Website

hdparm 9.43
Get/set SATA/IDE device parameters

nmon 14i
This systems administrator, tuner, benchmark tool gives you a huge amount of important performance information in one go. Website

iperf 2.0.5
A tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss. Website

iperf3 3.0.3
A tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss. Website

ldd 2.8
Prints the shared libraries required by each program or shared library specified on the command line.

curlftpfs 0.9.2
CurlFtpFS is a filesystem for accessing FTP hosts. Website

iana /etc/services & /etc/protocols
/etc/services and /etc/protocols are databases containing assigned ports and protocols.

strace 4.9
strace is a system call tracer, i.e. a debugging tool which prints out a trace of all the system calls made by a another process/program.

rsync 3.1.1
rsync is an open source utility that provides fast incremental file transfer.

file 5.25
file is an open source utitily that recognizes many file types.

ncdu 1.12
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. Ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed.

ca-certificates 20161130
Extracted from Debian.

Note:
This package adds a TERMINFO variable to /etc/profile. As a bonus, MidnightCommander suddenly has colors, due to that TERMINFO variable.

EncryptedShares
Create and maintain encrypted shares on your box, using encfs. The package uses the backend of Tweaks, so that needs to be installed too. After installing EncryptedShares, restart Tweaks.

It's not fast. On my NSA325 I can write at 1.5MB/sec to an encrypted share.



exFAT
exFAT is based on exfat-fuse. It contains the necessary binary to mount an exFAT volume, and hooks a few firmware scripts to enable auto-mounting. The volume will show up as 'ntfs' in the webinterface, because both ntfs and exFAT use fuseblk.

Pulse
Pulse, (previously Syncthing) replaces proprietary sync and cloud services with something open, trustworthy and distributed. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party, and how it's transmitted over the Internet.

PlexMediaServer
An installer/starter shell to install a Synology or Netgear Plex Media Server package on a ZyXEL.

(Calibre) COPS
Calibre OPDS (and HTML) PHP Server is web-based and light alternative to Calibre content server / Calibre2OPDS to serve ebooks in various formats.

Calibre COPS: Website | Wiki MobileRead: COPS: Calibre OPDS PHP Server

Package information
Requires: PHP-MySQL-phpMyAdmin Added feature: auto backup and restore of the .htaccess and config_local.php files

Installation
To download and install this package use MetaRepository by adding these lines to the Respository list http://downloads.zyxel.nas-central.org/Users/ariek/zpkgs/
 * 1) Ariek repository

Customization
Calibre OPS installs itself to the default package location: /usr/local/zy-pkgs

Calibre OPS location: /usr/local/zy-pkgs/gui/CalibreCOPS

To customize the package to your personal preferences all you have to do is edit the config_local.php file. Both files can be found in /usr/local/zy-pkgs/gui/CalibreCOPS. And if you want to modify the actual url rewriting rules then you should edit the .htaccess file too. These files are autmatically backuped when the user uninstalls the package and restored when the program gets reinstalled.

Default settings config_local.php $config['calibre_directory'] = '/i-data/md0/public/library/'; $config['cops_use_url_rewriting'] = "0"; /* $config['cops_full_url'] = "http://your.ip.address/pkg/CalibreCOPS/"; */

Sample library
A sample library with some open source books can be download from here, extract to the 'calibre_directory', the default location for the library is '/i-data/md0/public/library/'. To extract the sample library to the default location enter: tar zxf library.tar.gz -C /

Notes: There might occur issues with url rewriting with some devices. Known devices that won't work (yet) with Calibre COPS on ZyXEL NAS devices are Kobo ereaders (all models) and the Tolino Shine. They might work when the proper rewriting rules are added. However, is also possible that the current configuration of the build-in Apache Server is the source of the problems with these ereader devices. I do know that suggested solutions at the MobileRead thread do not solve the url rewriting issues for these devices.

enable/disable X-sendfile $config['cops_x_accel_redirect'] = "X-Sendfile"; $config['cops_x_accel_redirect'] = "";

specify full COPS path: $config['cops_full_url'] = "http://your.ip.address/adv,/pkg/CalibreCOPS/"; or $config['cops_full_url'] = "http://localhost/adv,/pkg/CalibreCOPS/";

these longer addresses do work but don't solve the url rewriting issues.

DokuWiki
DokuWiki is a simple to use and highly versatile Open Source wiki software that doesn't require a database. It is loved by users for its clean and readable syntax. The ease of maintenance, backup and integration makes it an administrator's favorite. Built in access controls and authentication connectors make DokuWiki especially useful in the enterprise context and the large number of plugins contributed by its vibrant community allow for a broad range of use cases beyond a traditional wiki.

Notes Dependency: PHP-MySQL-phpMyAdmin First run: Use the setup script to guide you through the initial DokuWiki setup. Visit: http:///pkg/DokuWiki/install.php. Multilingual support: added out-of-the-boxAdded basic multilingual support, which should display the user interface in browsers favorite language (the language of your clients operating system) change the UI language depending on leading namespace provide different start pages for every language

To download and install this package use MetaRepository by adding these lines to the Respository list http://downloads.zyxel.nas-central.org/Users/ariek/zpkgs/
 * 1) Ariek repository