occ app:list gives you a list of enabled and disabled apps but you only get the app-ids listed.
In the app store, however, apps are not sorted, searched and found by app-id, but by its name. These names are sometimes far away from the app-id, which is a pitfall, or at least a point of great confusion especially for newer admins. Itâs easy to get one app mixed up with another, or unintentionally install two apps that are actually mutually exclusive.
There are a number of shipped apps that are automatically supplied with the server and its update. These apps are in turn divided into those that are always enabled, those that are enabled by default and those that can be enabled by the admin. This is not clearly visible with the provided tools.
After an update from e.g. 28 to 29, one like to use the app_install_overwrite function for some apps because you either already know that the app runs without problems or you just want to try it first. Once an app is included in the app_install_overwrite array, many admins simply forget about it and leave it there. However, you can also delete the app_install_overwrite array after the app has been installed and activated. Nevertheless, it is sometimes desirable to get an overview of which apps are actually supported by your server version, which min/max php version is required and which databases are supported etc.
nc-apps was created to counter all of this
Once you get used to the wealth of information that this tool provides, you will hardly want to miss it.
It also gives you the ability to manipulate the version; If you are running Nextcloud 29, for example, you can tell the tool to simulate version 30 in order to see which of the apps already installed are suitable for 30 without any further updates. Because of the appstore integration, this filter is applicable on not installed apps too.
Here some functions:
auto detect nextcloud installation
clean up an existing app_install_overwrite array (if present) in config/config.php
supports configuration spread over multiple *.config.php files
Nextcloud All-in-One is supported, containerized solutions other than AIO are not (yet) supported
supports multiple php versions to enable updating old apps
Explanation:
- the first line downloads the script into the directory /usr/local/bin
- the second line makes it executable
You only need to install it once.
As all of my â ebtb â scripts, it comes signed and does an integrity check on the first run and checks for updates on every startup.
Simply run it:
nc-apps
The help-screen will guide you through your various queries:
nc-apps - version 2024-09-29 22:27 (latest version)
command line nextcloud-appstore browser with enhanced search functions and more
Usage:
nc-apps -h|--help [ --nopager ]
nc-apps -H|--filters
nc-apps install_overwrite [ -u [ --allow-unstable ]]
nc-apps shipped [ *'section' ] [ --version=NC-VER ] [ --min_version=NC-VER ] [ --nopager ]
nc-apps not_shipped [ *'section' ] [ --version=NC-VER ] [ --min_version=NC-VER ] [ --(un)supported ] [ --markdown ] [ --nopager ]
nc-apps all_apps [ *'section' ] [ --version=NC-VER ] [ --min_version=NC-VER ] [ --(un)supported ] [ --markdown ] [ --nopager ]
nc-apps id=[pattern] [ --version=NC-VER ] [ --min_version=NC-VER ] [ --(un)supported ] [ --markdown ]
nc-apps name=[pattern] [ --version=NC-VER ] [ --min_version=NC-VER ] [ --(un)supported ] [ --markdown ]
nc-apps lang=[ISO 639-1]
nc-apps updatable [ *'section' ] [ --version=NC-VER ] [ --min_version=NC-VER ]
nc-apps update [ *'section' ] [ --allow-unstable ]
nc-apps rebuild_db
nc-apps integrity_check
Options:
*) 'section' can be eather one of:
enabled - installed and enabled apps (default)
disabled - installed but disabled apps
local - enabled and disabled combined
store - not installed, available in appstore
all - all sections
-h | --help this page
-H | --filters examples of JSON filters (for experts)
install_overwrite [ -u [ --allow-unstable ]]
write actual 'app_install_overwrite' array in config/*config.php file.
If invoked with -u, it will first perform an update of al installed apps.
This script supports multiple *.config.php files.
shipped [section*)] list shipped apps (no 'store' section)
not_shipped [section*)] list not shipped apps
all_apps [section*)] list all apps
name=[pattern] list apps where name matches "pattern"
id=[pattern] list apps where id matches "pattern"
lang=[ISO 639-1] language to be used for translations instead of the detected locale on your computer, which is "en"
updatable [section*)] list updatable apps (no store section)
update [section*)] update enabled, disabled or local apps
--allow-unstable allow updating to unstable releases (only for update and install_overwrite with option -u)
--supported only list apps supported by version
--unsupported only list apps not supported by version
--nopager don't use pager (only for long listing functions and -h|--help)
--markdown list as markdown table code
*) NC-VER = only 2 digits
--version=NC-VER*) simulates an assumed nextcloud version instead of actual installed real nextcloud version.
--min_version=NC-VER*) simulates an assumed minimum nextcloud version. Defaults to 11
example: --version=26 and/or --min_version=25
'--(min_)version=' has no effect on install_overwrite, shipped and update
rebuild_db Delete database and create new from scratch.
Use this after updates, (de)installation of packages or simply when results start to get weird.
integrity_check Verify the integrity of this script with signature
=================================================================================
Here some examples
=================================================================================
List all installed and enabled apps:
user@box:~# nc-apps all_apps enabled
List not shipped, installed and enabled apps, not supported by your nextcloud version,
not piped through pager:
user@box:~# nc-apps not_shipped enabled --unsupported --nopager
List updatable apps only for enabled apps:
user@box:~# nc-apps updatable
List all updatable apps:
user@box:~# nc-apps updatable local
Update all updatable apps, allow to update to unstable (beta) app-versions:
user@box:~# nc-apps update local --allow-unstable
Update all apps, allowing unstable versions and re-create the "apps_install_overwrite'
array in config/config.php:
user@box:~# nc-apps install_overwrite -u --allow-unstable
List all apps with the pattern âtextâ in App-Id:
user@box:~# nc-apps id=text
Show, which of your installed, not shipped apps are NOT (yet) supported by Nextcloud 29,
taking into account all installed and enabled apps supported by minimum Nextcloud 26,
not piped through pager:
user@box:~# nc-apps --version=29 --min_version=26 --unsupported not_shipped enabled --nopager
... many many more (hidden) features....
Iâm always a bit worried about downloading an executable this way. Would you mind providing a hash of the executable so we can verify we downloaded the correct script? I can read bash but itâs long enough that a review is probably not enough to spot something is wrong.
Being able to simulate a version bump is a killer feature.
Iâve greatly expanded the script in the meantime. Now it includes an integrated appstore browser/analyzer.
Since the beautified output is very slow with large masses of apps (currently 389 apps are listed in the Appstore), I added a (much faster) interface that outputs pure json.
The apps.json from apps.nextcloud.com, stored and maintained in data/appdata_$instanceid/appstore/ is used as the data source and filtered to the extent that only the translation of your locale (or the one passed as an argument) is displayed and only the latest version of an app.
I have created a help output that provides the most common filters as examples, so that not only command line junkies can get by with them:
# Query single app "appname" by id:
appstore '.[] | select(.id == "appname")'
# Field contains (int)
appstore '.[] | select(.phpMinIntSize | contains(64))'
# Field contains ("string")
appstore '.[] | select(.id | contains("string"))'
# Field contains ("string") Case insensitive!
appstore '.[] | select(.name | ascii_downcase | contains("string"))'
# Field equals "string"
appstore map(select(.id == "string"))
# All apps where NCmax is greater than "27"
appstore 'map(select(.NCmax > "27"))'
# Apps with NCmax less than "26" and NCmin greater than "20":
appstore 'map(select(.NCmax < "26" and .NCmin > "20"))'
# All apps where phpMax is less than 8.2:
appstore 'map(select(.phpMax < "8.2"))'
# All apps where phpMax is less than 8.2 and phpMax is not empty:
appstore 'map(select(.phpMax < "8.2" and (.phpMax | length > 0)))'
# All apps where phpMin is greater than 7.0 and phpMin is not empty:
appstore 'map(select(.phpMin > "7.0" and (.phpMin | length > 0)))'
# Apps with phpMax less than 8.2 and phpMax is not empty, and phpMin greater than 7.0 and phpMin is not empty:
appstore 'map(select(.phpMax < "8.2" and (.phpMax | length > 0) and .phpMin > "7.0" and (.phpMin | length > 0)))'
# Apps with phpMax less than 8.2 or phpMin greater than 7.0 and either phpMax or phpMin is not empty:
appstore 'map(select((.phpMax < "8.2" or .phpMin > "7.0") and ((.phpMax | length > 0) or (.phpMin | length > 0))))'
# Apps with phpMax less than 8.2 and phpMin greater than 7.0, and both phpMax and phpMin are not empty:
appstore 'map(select(.phpMax < "8.2" and .phpMin > "7.0" and (.phpMax | length > 0) and (.phpMin | length > 0)))'
# Apps with a specific pattern in the name or id:
appstore 'map(select(.name | test("pattern")))'
appstore 'map(select(.id | test("pattern")))'
# Apps with specific categories:
appstore 'map(select(.categories | contains("category1") or contains("category2")))'
# Apps with NCmax less than 26 and NCmin greater than 20, and phpMax less than 8.2:
appstore 'map(select(.NCmax < "26" and .NCmin > "20" and .phpMax < "8.2"))'
# phpExtensions is not empty
appstore 'map(select(.phpExtensions | length > 0))'
# Show only selected fields (id, name, and NCmax) for each app:
appstore 'map({id, name, NCmax})'
# in Combination
appstore 'map(select(.NCmax > "26" and .NCmin > "20" and .phpMax > "8.1" and (.phpMax | length > 0) and (.phpExtensions | length > 0))) | map({id, name, NCmax})'
# Sort by last modified, oldest first
appstore 'sort_by(.lastModified)'
# newest first
appstore 'sort_by(.lastModified) | reverse'
# in Combination
appstore 'map(select(.NCmax > "26" and .NCmin > "20" and .phpMax < "8.2")) | sort_by(.lastModified)'
# Apps created after January 1, 2023:
appstore 'map(select(.created > "2023-01-01"))'
# Apps last modified after January 1, 2023:
appstore 'map(select(.lastModified > "2023-01-01"))'
# Apps created before January 1, 2023:
appstore 'map(select(.created < "2023-01-01"))'
# Apps last modified before January 1, 2023:
appstore 'map(select(.lastModified < "2023-01-01"))'
# Apps that haven't been modified after January 1, 2023 (possibly "stale" apps):
appstore 'map(select(.lastModified < "2023-01-01"))'
# Apps created before January 1, 2023 and haven't been modified after that date (potentially "stale" apps):
appstore 'map(select(.created < "2023-01-01" and .lastModified < "2023-01-01"))'
Professionals who want a json object to work with get pure (presorted) validated json with this script.
Besides updating apps and maintaining a custom install_overwrite array in my config.php (fully automatic), searching for single app informations like website or issue-tracker with the options name=âpatternâ or id=âpatternâ has proven to be extremely helpful in day-to-day use.
Integrated the script into my nextcloud container (via Dockerfile +) and it throws this:
root@NCapp:/var/www/html# nc-apps
First run, checking integrity:
===========================================================================
gpg: using RSA key 3EE43A84D2BA635A94E1033B0B145139A170715C
---------------------------------------------------------------------------
- Integrity check failed. The script may have been modified or tampered with!
---------------------------------------------------------------------------
You should run:
sudo wget -O /usr/local/bin/nc-apps https://global-social.net/apps/raw/s/nc-apps
to fix this.
===========================================================================
Of course I didnât modify the script.
Any idea how to circumvent this?
gpg is installed along with the other dependencies xmlstarlet jq sqlite3 sudo less. v=true helped get past the integrity check but somehow the directory structure of the container does not resemble the one you seem to expect in a bare metal installation:
root@NCapp:/var/www/html# nc-apps all_apps
This step is required once after a new installation or sometimes after an update:
Hello, this is the first run wizard of "nc-apps"
enter the directory where your Nextcloud is installed (or [q] to quit):
--> /var/www/html
- first run wizard completed successfully.
ls: cannot access '/usr/local/bin/php[78].[0-4]': No such file or directory
no php with version number tacked:
root@NCapp:/var/www/html# ls -la /usr/local/bin/
total 5856
drwxr-xr-x 1 root root 3 Dec 21 22:06 .
drwxr-xr-x 1 root root 4 Dec 16 05:15 ..
-rwxrwxr-x 1 root root 122 Dec 16 05:12 docker-php-entrypoint
-rwxrwxr-x 1 root root 1449 Dec 16 05:12 docker-php-ext-configure
-rwxrwxr-x 1 root root 2669 Dec 16 05:12 docker-php-ext-enable
-rwxrwxr-x 1 root root 2963 Dec 16 05:12 docker-php-ext-install
-rwxrwxr-x 1 root root 587 Nov 27 23:12 docker-php-source
-rwxr-xr-x 1 root root 69459 Dec 21 22:06 nc-apps
-rwxr-xr-x 1 root root 817 Dec 16 05:15 pear
-rwxr-xr-x 1 root root 838 Dec 16 05:15 peardev
-rwxr-xr-x 1 root root 751 Dec 16 05:15 pecl
lrwxrwxrwx 1 root root 9 Dec 16 05:15 phar -> phar.phar
-rwxr-xr-x 1 root root 15245 Dec 16 05:15 phar.phar
-rwxr-xr-x 1 root root 18901488 Dec 16 05:15 php
-rwxr-xr-x 1 root root 3046 Dec 16 05:15 php-config
-rwxr-xr-x 1 root root 4535 Dec 16 05:15 phpize
A pity. Seemed promising.
Thanks for sharing anyway!
Edit:
The script could not be tricked into working by creating a symlink lrwxrwxrwx 1 root root 18 Dec 21 22:22 php8.2 -> /usr/local/bin/php either:
--------------------------------------------------------------------------------
command = "all_apps enabled", markdown = false, nopager = false, lang =
Versions: assumed = 27.1.5, is = 27.1.5.1, min = 11.0.8, php = 8.2
--------------------------------------------------------------------------------
================================================================================
. . . . . . . . . . . create and update json objects . . . . . . . . . . .
json objects created
================================================================================
. . . . . . . . . . . stocking up arrays with data . . . . . . . . . . .
all arrays stocked up
================================================================================
That is a good one. I added support for multiple php versions, to enable handling apps with older php requirements (specially thought for the nearer future, when people start to switch to php8.3 and lots of apps still require php8.2).
The script needs php for some tasks, like reading config values from config.php etc.
I will look at this and create a fix for you next days.
If you are planing to update your server to Nextcloud 28 and you want to monitor, if all of your installed apps are already supported and you donât want to search in extensive tables like â here â but you want verbose information, simply run:
Show, which of your installed, not shipped apps are NOT (yet) supported for Nextcloud 28, taking into account all installed and enabled apps supported by minimum Nextcloud 26:
List all shipped apps for Nextcloud 28, taking into account all enabled and disabled apps:
nc-apps --version=28 shipped all --nopager
That will show you, that there are 48 shipped apps for nextcloud 28, while there are 49 for nextcloud 27. Then it is easy to compare and find out, that the files_rightclick app has stopped to be an app on its own, since it is integrated into the nextcloud files app as of Nextcloud 28.
Here some more random examples:
List all installed and enabled apps:
nc-apps all_apps enabled --nopager
List all updatable apps:
nc-apps updatable all
Update all updatable apps, allow to update to unstable (beta) app-versions:
nc-apps update all --allow-unstable
List all apps with the pattern âtextâ in App-Id:
nc-apps id="text"
and much much more documented and hidden featuresâŚ
At the Nextcloud Conference, it was noted that itâs a pity this script wasnât supported by All-In-One. Iâm excited to announce that this is now a thing of the past! nc-apps no longer requires a bare-metal installation and can now run on Debian or Ubuntu hosts where All-In-One is installed.
Please test it thoroughly, and I look forward to your feedback.