Page 1 of 294

[QPKG] sherpa mini-package-manager (CLI) beta

Posted: Sat May 06, 2017 2:05 pm
by OneCD
Image
The world's first multi-action CLI package-manager!

Description

A mini-package-manager for QNAP® NAS.

Package management via sherpa provides extra features like easy application backup, upgrading, service and daemon management, self-checking and repair, and all operations may be automated via cron.

Please note: this is a command-line package and service manager, it's in beta status, and packages have been known to break due to auto-upgrades going wrong. If you would like-to (and are able-to) help by diagnosing and providing logs, and don't mind things breaking from time-to-time, please use this package. If you're looking for complete stability and want a "set-and-forget" solution, it won't be found here just yet. Do not use sherpa in production environments, unless you're pretty-handy with the CLI and debugging bash and Python scripts, and/or can afford for applications to be out-of-order for extended periods of time.

That said: the majority of development is now complete, and I'm currently working-on increasing stability during auto-package upgrades. So, sherpa will work beautifully on a fresh (or new) system, but can experience issues when individual application updates are released.

Click here for available packages

Installation
  1. Click here to download the sherpa QPKG.
  2. Install the QPKG manually through your QTS App Center UI. This QPKG is not digitally signed, so you'll need to allow unsigned packages to be installed in your App Center before installing it. It can "sign" itself (and all supported QPKGs) after installation.
Usage
  1. SSH into your NAS,
  2. Then at the command prompt, run:

    Code: Select all

    sudo sherpa
    ... and follow the help from there.
If 'sudo' is unavailable in your version of QTS, SSH into your NAS as the 'admin' user instead, and run:

Code: Select all

sherpa
Checkout the wiki for more information: https://github.com/OneCDOnly/sherpa/wiki

Re: [SCRIPT] nzb-multi-installer

Posted: Sat May 06, 2017 4:28 pm
by dirkonline
I will keep my eyes open and read along for now. This is so exciting. Thanks for the great work OneCD!

Re: [SCRIPT] nzb-multi-installer

Posted: Sun May 07, 2017 2:38 am
by Xmantium
Are you able to put this on GitHub so others can input into it?

Any chance Sonarr can be added? Its way better than Sickrage, try and see for yourself

nzb-multi installer is a confusing name, think its best to put "Sabnzbd+ and Addons Installer" would be a better fit

Re: [SCRIPT] nzb-multi-installer

Posted: Sun May 07, 2017 3:05 am
by OneCD
Xmantium wrote:Are you able to put this on GitHub so others can input into it?
Already there: https://github.com/OneCDOnly/sherpa
Xmantium wrote:Any chance Sonarr can be added? Its way better than Sickrage, try and see for yourself
Ah, personally not a fan of Mono - or anything that runs .NET code. So, there's not much chance of that happening.
Xmantium wrote:nzb-multi installer is a confusing name, think its best to put "Sabnzbd+ and Addons Installer" would be a better fit
I agree it's confusing - but I'm hoping to add NZBGet in there at some point - so can't call it 'SABnzbd' anything.

edit: Decided to call it 'sherpa'. Because it ventures first and guides other apps through the dangerous wilderness. Y'know, something terribly meaningful like that. :wink:

Re: [SCRIPT] sherpa

Posted: Sun May 07, 2017 9:41 pm
by The Mask
Hi OneCD,

I ran your sherpa script. It updated Sabnzbd and installed SR and CP. I encountered one issue.

Issue: I ran the command wget https://goo.gl/Qot9QK -qO sherpa.tar.gz && tar -zxvf sherpa.tar.gz but got an error

wget: not an http or ftp url: https://goo.gl/Qot9QK

I solved this by downloading it manually.

For the rest it ran smoothly, no problems at all.

Thanks for this script and the Qpkg packages.

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 2:22 am
by OneCD
Hi and thanks for the feedback. :)
The Mask wrote:Issue: I ran the command wget https://goo.gl/Qot9QK -qO sherpa.tar.gz && tar -zxvf sherpa.tar.gz but got an error

wget: not an http or ftp url: https://goo.gl/Qot9QK
If you're able, can you try these two and let me know if they work for you?

Code: Select all

/usr/bin/wget https://goo.gl/Qot9QK -O sherpa.tar.gz

Code: Select all

wget http://goo.gl/Qot9QK -O sherpa.tar.gz

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 3:10 am
by scorche
Thanks for your work on greatly simplifying the headache with keeping this stuff maintained!

I recently upgraded my QNAP and thought I'd try your script to get my SABNZBd updated to 2.x. However, the script fails at the pip modules. Below is the debug log:

Code: Select all

# ./SABnzbdplus --debug
[ dbug ] (>>) <Init>
[ dbug ] (II) ====================================================================
[ dbug ] (**) SCRIPT:          started: Sun May 7 12:04:22 MST 2017
[ dbug ] (**) SCRIPT:             file: sherpa.sh
[ dbug ] (**) SCRIPT:          version: 2017.05.07b
[ dbug ] (**) SCRIPT:      launched as: ./SABnzbdplus
[ dbug ] (**) SCRIPT:       target app: SABnzbdplus
[ dbug ] (II) --------------------------------------------------------------------
[ dbug ] (II) Markers: (**) detected, (II) information, (WW) warning, (EE) error,
[ dbug ] (II)          (--) done, (>>) function entry, (<<) function exit,
[ dbug ] (II)          (vv) variable name & value, ($1) positional argument value.
[ dbug ] (II) --------------------------------------------------------------------
[ dbug ] (**) NAS:               model: TS-869 Pro
[ dbug ] (**) NAS:    firmware version: 4.3.3
[ dbug ] (**) NAS:      firmware build: 20170413
[ dbug ] (**) NAS:              kernel: 3.4.6 x86_64
[ dbug ] (**) NAS:           OS uptime: 30 min
[ dbug ] (**) NAS:         system load: 1 min=0.12, 5 min=0.28, 15 min=0.39
[ dbug ] (**) NAS:      default volume: /share/CACHEDEV1_DATA
[ dbug ] (**) NAS:               $PATH: /bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11
[ dbug ] (**) NAS:                /opt: /share/CACHEDEV1_DATA/.qpkg/Entware-ng
[ dbug ] (**) NAS:     /share/Download: CACHEDEV1_DATA/Download
[ dbug ] (II) --------------------------------------------------------------------
[ dbug ] (**) QPKG:     'QSabNZBdPlus': not installed
[ dbug ] (**) QPKG:       'Entware-ng': installed
[ dbug ] (**) QPKG:       'Entware-3x': not installed
[ dbug ] (II) found a suitable ARCH for Clinton's QPKG (x64)
[ dbug ] (II) found a suitable ARCH for Stephane's QPKG (x64)
[ dbug ] (**) QPKG:       'Entware-ng': installed
[ dbug ] (II) found a suitable Entware package (Entware-ng)
[ dbug ] (<<) <Init> [0]
[ dbug ] (>>) <PauseSabs>
[ dbug ] (**) QPKG:      'SABnzbdplus': installed
[ dbug ] (--) paused existing SABnzbd queue
[ dbug ] (<<) <PauseSabs> [0]
[ dbug ] (>>) <DownloadQPKGs>
[ dbug ] (**) QPKG:       'Entware-ng': installed
[ dbug ] (**) QPKG:   'Par2cmdline-MT': installed
[ dbug ] (>>) <DownloadQPKG>
[ dbug ] (II) existing QPKG checksum correct (SABnzbdplus_170131.qpkg)
[ dbug ] (<<) <DownloadQPKG> [0]
[ dbug ] (<<) <DownloadQPKGs> [0]
[ dbug ] (>>) <RemovePackageInstallers>
[ dbug ] (**) QPKG:          'Optware': not installed [250]
[ dbug ] (<<) <RemovePackageInstallers> [0]
[ dbug ] (>>) <InstallEntware>
[ dbug ] (**) QPKG:       'Entware-ng': installed
[ dbug ] (II) patch: do the "opt shuffle" - already done
[ dbug ] (<<) <InstallEntware> [0]
[ dbug ] (>>) <InstallOther>
[ dbug ] (**) QPKG:   'Par2cmdline-MT': installed
[ dbug ] (>>) <InstallFakeQPKGs>
[ dbug ] (**) QPKG:           'Python': installed
[ dbug ] (**) QPKG:              'git': installed
[ dbug ] (vv) fakeQPKG_python [false]
[ dbug ] (vv) fakebin_python [false]
[ dbug ] (vv) fakeQPKG_git [false]
[ dbug ] (vv) fakebin_git [false]
[ dbug ] (<<) <InstallFakeQPKGs> [0]
[ dbug ] (>>) <InstallIPKs>
[ dbug ] (>>) <UpdateEntware>
[ proc ] updating 'Entware' ...
[ done ] updated 'Entware'
[ dbug ] (<<) <UpdateEntware> [0]
[ dbug ] (--) reloaded environment
[ proc ] downloading & installing IPKs (various) ...
[ done ] downloaded & installed IPKs (various)
[ proc ] downloading & installing IPK (python-dev) ...
[ done ] downloaded & installed IPK (python-dev)
[ dbug ] (<<) <InstallIPKs> [0]
[ dbug ] (>>) <InstallPIPs>
[ proc ] downloading & installing (pip modules) ...
[ fail ] Download & install failed (pip modules) [1]
[ dbug ] (<<) <InstallPIPs> [17]
[ dbug ] (<<) <InstallOther> [17]
[ dbug ] (>>) <Cleanup>
[ dbug ] (**) QPKG:      'SABnzbdplus': installed
[ dbug ] (--) resumed existing SABnzbd queue
[ dbug ] (<<) <Cleanup> [17]
[ dbug ] (>>) <DisplayResult>
[ fail ] SABnzbdplus install failed! :S [17]
[ dbug ] (**) SCRIPT:         finished: Sun May  7 12:04:49 MST 2017
[ dbug ] (**) SCRIPT:     elapsed time: 00h:00m:27s
[ dbug ] (II) ====================================================================
[ dbug ] (<<) <DisplayResult> [17]

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 3:23 am
by OneCD
scorche wrote:However, the script fails at the pip modules.
Okiedoke, there's a separate log for pip modules. You can view this with:

Code: Select all

cat /share/Public/sherpa.tmp/pip_modules.install.log
Can you please post it back here?

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 3:26 am
by scorche
Looks like I need to get CXXABI_1.3.9 on my QNAP...

Code: Select all

Requirement already up-to-date: pip in /share/CACHEDEV1_DATA/.qpkg/Entware-ng/lib/python2.7/site-packages
Requirement already up-to-date: setuptools in /share/CACHEDEV1_DATA/.qpkg/Entware-ng/lib/python2.7/site-packages
Requirement already up-to-date: packaging>=16.8 in /share/CACHEDEV1_DATA/.qpkg/Entware-ng/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: appdirs>=1.4.0 in /share/CACHEDEV1_DATA/.qpkg/Entware-ng/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: six>=1.6.0 in /share/CACHEDEV1_DATA/.qpkg/Entware-ng/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: pyparsing in /share/CACHEDEV1_DATA/.qpkg/Entware-ng/lib/python2.7/site-packages (from packaging>=16.8->setuptools)
Collecting sabyenc
  Using cached sabyenc-3.0.2.tar.gz
Collecting cheetah
  Using cached Cheetah-2.4.4.tar.gz
Collecting Markdown>=2.0.1 (from cheetah)
  Using cached Markdown-2.6.8.tar.gz
Installing collected packages: sabyenc, Markdown, cheetah
  Running setup.py install for sabyenc: started
    Running setup.py install for sabyenc: finished with status 'error'
    Complete output from command /opt/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/share/CACHEDEV1_DATA/.qpkg/Entware-ng/tmp/pip-build-qbGM6r/sabyenc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record /opt/tmp/pip-6qg2mo-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'sabyenc' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    x86_64-openwrt-linux-gnu-gcc -fno-strict-aliasing -O2 -pipe -fomit-frame-pointer -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -DNDEBUG -fno-inline -DNDEBUG -O2 -pipe -fomit-frame-pointer -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -fPIC -I/opt/include/python2.7 -c src/sabyenc.c -o build/temp.linux-x86_64-2.7/src/sabyenc.o -O2
    x86_64-openwrt-linux-gnu-gcc: /opt/lib/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by x86_64-openwrt-linux-gnu-gcc)
    error: command 'x86_64-openwrt-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/opt/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/share/CACHEDEV1_DATA/.qpkg/Entware-ng/tmp/pip-build-qbGM6r/sabyenc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record /opt/tmp/pip-6qg2mo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /share/CACHEDEV1_DATA/.qpkg/Entware-ng/tmp/pip-build-qbGM6r/sabyenc/
result=[1]

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 3:35 am
by OneCD
Hmmm... are you able to use Entware-3x instead of Entware-ng?

If so, please uninstall Entware-ng via the QTS App Center and re-run sherpa. It will install Entware-3x itself.

If not, please uninstall Entware-ng and reinstall it manually. Then re-run sherpa.

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 3:56 am
by scorche
Looks good! Thanks!

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 4:06 am
by The Mask
OneCD wrote: If you're able, can you try these two and let me know if they work for you?

Code: Select all

/usr/bin/wget https://goo.gl/Qot9QK -O sherpa.tar.gz

Code: Select all

wget http://goo.gl/Qot9QK -O sherpa.tar.gz
Only the first one works for me, the other one is giving the following error:

Connecting to goo.gl (216.58.212.206:80)
wget: not an http or ftp url: https://github.com/OneCDOnly/sherpa/blo ... z?raw=true

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 4:29 am
by OneCD
scorche wrote:Looks good! Thanks!
So, which one did you end up using? 3x or ng? :geek:

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 4:32 am
by OneCD
The Mask wrote:Only the first one works for me, the other one is giving the following error:

Connecting to goo.gl (216.58.212.206:80)
wget: not an http or ftp url: https://github.com/OneCDOnly/sherpa/blo ... z?raw=true
Thanks for checking that. I'll change the download link code to specify the full path to the wget binary.

I think the second one failed on your NAS as it was trying to use BusyBox wget which doesn't support HTTPS. ;)

Code: Select all

which wget; echo; wget -V

Re: [SCRIPT] sherpa

Posted: Mon May 08, 2017 5:00 am
by scorche
OneCD wrote: So, which one did you end up using? 3x or ng? :geek:
I just removed ng and let the script install 3x. I figured I would address any issues that popped up separately if there was a reason why I needed ng for something else.