New zypkg: MetaRepository

Projektleiter: Mijzelf

Basically it's an CGI script which runs locally on the NAS. Using the web_prefix file the package manager is pointed to it.
Antworten
Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

New zypkg: MetaRepository

Beitrag von Mijzelf »

What is this?
Basically that is a CGI script which runs locally on the NAS, and disguises itself as a http package repository. Using the web_prefix file the firmware 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
Step 1
Download the file web_prefix, and put it in the directory \\<NAS>\admin\zy-pkgs\ on the NAS. Make sure your browser doesn't add any extensions to the file. The filename is web_prefix, without extension, all lowercase characters.
NAS5xx, NAS326
(Firmware 5.10+ only) On this NAS there is no subdirectory zy-pkgs in \\<NAS>\admin\. Just add it.
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 (see below), login over telnet (as root), and execute

Code: Alles auswählen

echo http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/Medion >/etc/package_src_url
Step 2
NSA series
In the packages menu in the webinterface execute 'Retreive list from Internet'. Install MetaRepository. Execute 'Retreive list from Internet' again.
NAS series
On the webinterface desktop, open the 'App Centre'. Goto 'Browse->All Apps'. Now there is a cycle icon on the page. Push it. install MetaRepository. Push the cycle icon again.
Medion
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. Make sure you first install dropbear, and test it, to have an entrance if the webinterface fails.

How to configure
NSA series, Medion
In the package menu you can open the configuration page of MetaRepository.
NAS series
On the desktop you'll find a MetaRepository icon to open the configuration page.

Here you can enter the source repositories. When a package with the same name and version can be found in several repositories, the repository highest in this list is used. Further you can blacklist packages.
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.

Telnet backdoor
On Medion boxes it is possible to start a telnet daemon on the NAS, by requesting a webpage:
Firmware 1.00:[/code]
http://<ip-of-nas>/r32694,/adv,/cgi-bin/remote_help-cgi?type=backdoor
Firmware 1.01(UZD.0):[/code]
http://<ip-of-nas>/r34814,/adv,/cgi-bin/remote_help-cgi?type=backdoor
Firmware 1.01(UZD.2):[/code]
http://<ip-of-nas>/r36258,/adv,/cgi-bin/remote_help-cgi?type=backdoor
You can login as admin, or as root, using the admin web password.

If your firmware version is not listed here, login on the webinterface of your nas, and have a look at the url to find out the 'r value' of your firmware version. Some browsers won't show this, in that case copy the url and paste it in notepad, or something like that.

(On most NSA boxes this telnet backdoor also works. Just find the 'r value' of your firmware. For other options read this.)

Benutzeravatar
shv
Beiträge: 66
Registriert: Sa 10. Nov 2018, 17:36

Re: New zypkg: MetaRepository

Beitrag von shv »

Further information from the wiki of nas-central.org can be found on archive.org with the following links:
https://web.archive.org/web/20180425025 ... rty_zypkgs
Mijzelf hat geschrieben:If you want to put this mirror in an existing MetaRepository installation, use
http://zyxel.diskstation.eu/Users/Mijze ... -repo/fw4/ for NSA devices, and
http://zyxel.diskstation.eu/Users/Mijze ... -repo/fw5/ for NAS devices.
Upgrade MetaRepository, as it knows some new tricks to handle mirror repos.

Benutzeravatar
shv
Beiträge: 66
Registriert: Sa 10. Nov 2018, 17:36

Re: New zypkg: MetaRepository

Beitrag von shv »

Das Repository war vorübergehend nur per SSL erreichbar. Bei Bedarf kann man das zu verwendende Protokoll auf https://... umstellen. Nun können sowohl http://... als auch https://... verwendet werden.
Mijzelf hat geschrieben:If you want to put this mirror in an existing MetaRepository installation, use
https://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ for NSA devices, and
https://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw5/ for NAS devices.
Upgrade MetaRepository, as it knows some new tricks to handle mirror repos.

bjoern.metz
Beiträge: 6
Registriert: Di 24. Sep 2019, 03:06

Re: New zypkg: MetaRepository

Beitrag von bjoern.metz »

Hello everybody and i need your help :-D

sorry for my english in advance, unfortunately had to use the google translator :-D

I tried to install the metarepository on my nas540 (firmware V5.21 (AATB.4)) but unfortunately it's as it always is with me, it depends directly on the beginning :-( ... there is no "admin" folder on my nas like \\<NAS>\admin\zy-pkgs\ ... but i found an admin folder ( see the picktures )

I tried my luck with this folder, but nas did not want to start up after creating the web_prefix. it has beeped 1x but winscp and webinterface have no access.

So thank you in advance for your help
Dateianhänge
0001.png
0001.png (33.74 KiB) 5028 mal betrachtet
0002.png
0002.png (18.72 KiB) 5028 mal betrachtet

Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

Re: New zypkg: MetaRepository

Beitrag von Mijzelf »

The backslashes in \\<NAS>\admin\zy-pkgs\ should tell this directory can be found using the samba entry. Yet you found the same directory using winscp. /i-data/<some-hex-code>/admin is the same directory.
bjoern.metz hat geschrieben:
So 22. Mär 2020, 17:49
I tried my luck with this folder, but nas did not want to start up after creating the web_prefix. it has beeped 1x but winscp and webinterface have no access.
I really hope that is unrelated. The content of admin is mostly ignored by the firmware, except the file zy-pkgs/web_prefix, which is only read when attempting to update the package list.
So when booting it should not matter.

I think you damaged something else, or it's a coincidence. I suggest you try a factory reset.

bjoern.metz
Beiträge: 6
Registriert: Di 24. Sep 2019, 03:06

Re: New zypkg: MetaRepository

Beitrag von bjoern.metz »

The backslashes in \\<NAS>\admin\zy-pkgs\ should...
of course, was only meant as an example so that you know what I mean or where I could not find the admin folder
you found the same directory
ok great !
I think you damaged something else, or it's a coincidence. I suggest you try a factory reset.
I used an old hard drive to try it out, so if it is damaged it is not bad!
I had the web_prefix as * .txt in another folder, maybe it was because of it !?

I've deleted both files and the nas runs as usual. I'll try it again right away, without a duplicate file :-D



****
think I've already found the mistake. probably copied the wrong url (with / fw5)

on to the next attempt :-D

Thanks for your help !

bjoern.metz
Beiträge: 6
Registriert: Di 24. Sep 2019, 03:06

Re: New zypkg: MetaRepository

Beitrag von bjoern.metz »

WORKS !

nice ! thx !

Antworten