Skip to content

Commit 5b4d0ce

Browse files
committed
Disable app_api unless configured
1 parent 9c8414d commit 5b4d0ce

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

bin/ncp-update-nc.d/update-nc.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ then
240240
source /usr/local/etc/library.sh
241241
fi
242242

243+
if { ncc app_api:daemon:list || true; } 2> /dev/null | grep 'No registered daemon configs.' > /dev/null 2>&1
244+
then
245+
ncc app:disable app_api
246+
fi
247+
243248
# refresh completions
244249
ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp
245250

bin/ncp/CONFIG/nc-init.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ EOF
171171
# we handle this ourselves
172172
ncc app:disable updatenotification
173173

174+
# Not supported in Nextcloudpi without manual setup
175+
ncc app:disable app_api
176+
174177
# ncp-previewgenerator
175178
local ncver
176179
ncver="$(ncc status 2>/dev/null | grep "version:" | awk '{ print $3 }')"

updates/1.56.0.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
if { ncc app_api:daemon:list || true; } 2> /dev/null | grep 'No registered daemon configs.' > /dev/null 2>&1
4+
then
5+
ncc app:disable app_api
6+
fi
7+
8+
exit 0

0 commit comments

Comments
 (0)