standardize occ command documentation

Use `sudo -E -u www-data php occ` everywhere.
Motivation: this should work on more appliances like also inside docker containers.
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L.
2025-04-29 10:16:49 +02:00
parent bc9cdd184e
commit 495247ae4a
34 changed files with 247 additions and 249 deletions

View File

@@ -17,7 +17,7 @@ You can install the *assistant* app via the "Apps" page in Nextcloud, or by exec
.. code-block::
php occ app:enable assistant
sudo -E -u www-data php occ app:enable assistant
App store
---------

View File

@@ -87,7 +87,7 @@ After cloning this app *manually* (cloned via git to your apps directory) you wi
.. code-block::
sudo -u <the_user_the_webserver_is_running_as> php /path/to/your/nextcloud/webroot/occ app_api:app:unregister summary_bot
sudo -E -u www-data php occ app_api:app:unregister summary_bot
5. Register the Summary Bot so that your Nextcloud instance is aware of it
@@ -96,7 +96,7 @@ After cloning this app *manually* (cloned via git to your apps directory) you wi
.. code-block::
sudo -u <the_user_the_webserver_is_running_as> php ./occ app_api:app:register summary_bot manual_install --json-info '{ "id": "summary_bot", "name": "Summary Bot", "daemon_config_name": "manual_install", "version": "1.0.0", "secret": "12345", "host": "0.0.0.0", "port": 9031, "scopes": ["AI_PROVIDERS", "TALK", "TALK_BOT"], "protocol": "http"}' --force-scopes --wait-finish
sudo -E -u www-data php occ app_api:app:register summary_bot manual_install --json-info '{ "id": "summary_bot", "name": "Summary Bot", "daemon_config_name": "manual_install", "version": "1.0.0", "secret": "12345", "host": "0.0.0.0", "port": 9031, "scopes": ["AI_PROVIDERS", "TALK", "TALK_BOT"], "protocol": "http"}' --force-scopes --wait-finish
6. Enable the *Summary Bot* for the selected Chatroom via the three dots menu of the Chatroom (The Bots settings are located inside the *Bots* section)

View File

@@ -218,13 +218,13 @@ It would be best to run one command per screen session or per tmux window/pane t
.. code-block::
set -e; while true; do sudo -u www-data occ background-job:worker -v -t 60 "OC\TaskProcessing\SynchronousBackgroundJob"; done
set -e; while true; do sudo -E -u www-data php occ background-job:worker -v -t 60 "OC\TaskProcessing\SynchronousBackgroundJob"; done
For Nextcloud-AIO you should use this command on the host server.
.. code-block::
set -e; while true; do docker exec -u www-data -it nextcloud-aio-nextcloud php occ background-job:worker -v -t 60 "OC\TaskProcessing\SynchronousBackgroundJob"; done
set -e; while true; do docker exec -it nextcloud-aio-nextcloud sudo -E -u www-data php occ background-job:worker -v -t 60 "OC\TaskProcessing\SynchronousBackgroundJob"; done
You may want to adjust the number of workers and the timeout (in seconds) to your needs.
The logs of the worker can be checked by attaching to the screen or tmux session.
@@ -256,7 +256,7 @@ Systemd service
#!/bin/sh
echo "Starting Nextcloud AI Worker $1"
cd /path/to/nextcloud
sudo -u www-data php occ background-job:worker -t 60 'OC\TaskProcessing\SynchronousBackgroundJob'
sudo -E -u www-data php occ background-job:worker -t 60 'OC\TaskProcessing\SynchronousBackgroundJob'
You may want to adjust the timeout to your needs (in seconds).

View File

@@ -9,18 +9,18 @@ and activity table has to be triggered manually by a console command.
The command can safely be executed. It will show a success message when there is nothing to do::
sudo -u www-data php occ db:convert-filecache-bigint
sudo -E -u www-data php occ db:convert-filecache-bigint
All tables already up to date!
or otherwise ask for confirmation, before performing the heavy actions::
sudo -u www-data php occ db:convert-filecache-bigint
sudo -E -u www-data php occ db:convert-filecache-bigint
This can take up to hours, depending on the number of files in your instance!
Continue with the conversion (y/n)? [n]
to suppress the confirmation message append ``--no-interaction`` to the argument list::
sudo -u www-data php occ db:convert-filecache-bigint --no-interaction
sudo -E -u www-data php occ db:convert-filecache-bigint --no-interaction
.. note:: Similar to a normal update, you should shutdown your Apache or nginx server or enable maintenance

View File

@@ -34,7 +34,7 @@ The ``occ db:convert-type`` command handles all the tasks of the conversion. The
::
php occ db:convert-type [options] type username hostname database
sudo -E -u www-data php occ db:convert-type [options] type username hostname database
``type`` should be the target database type. The same values are available here as for the ``config.php`` ``dbtype`` parameter. It should be one of: ``mysql`` for MariaDB/MySQL,
``pgsql`` for PostgreSQL, or ``oci`` for Oracle.
@@ -55,7 +55,7 @@ Let's convert our existing (functioning) sqlite3 installation to be MariaDB/MySQ
::
php occ db:convert-type --password="<password>" --port="3306" --all-apps mysql <username> <hostname> nextcloud
sudo -E -u www-data php occ db:convert-type --password="<password>" --port="3306" --all-apps mysql <username> <hostname> nextcloud
.. note:: It was unnecessary to specify the port in this example because ``3306`` is already the default. We did so
merely for demonstration purposes and completeness in case the reader is using a non-standard port on their target
@@ -68,7 +68,7 @@ If you are converting to a MySQL/MariaDB database, you will also want to set ``m
::
php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -E -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
If you like, you can view the changes that were made by looking for the ``db*`` parameters in your ``config.php`` (you could also use this command before
doing the conversion to compare your configuration before/after):

View File

@@ -43,7 +43,7 @@ The result should look like this::
3. Open a shell, change dir (adjust ``/var/www/nextcloud`` to your nextcloud location if needed), and put your nextcloud instance in maintenance mode, if it isn't already::
$ cd /var/www/nextcloud
$ sudo -u www-data php occ maintenance:mode --on
$ sudo -E -u www-data php occ maintenance:mode --on
4. Change your databases character set and collation:
@@ -53,11 +53,11 @@ The result should look like this::
5. Set the ``mysql.utf8mb4`` config to true in your config.php::
$ sudo -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
$ sudo -E -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
6. Convert all existing tables to the new collation by running the repair step::
$ sudo -u www-data php occ maintenance:repair
$ sudo -E -u www-data php occ maintenance:repair
.. note::
@@ -65,7 +65,7 @@ The result should look like this::
7. Disable maintenance mode::
$ sudo -u www-data php occ maintenance:mode --off
$ sudo -E -u www-data php occ maintenance:mode --off
Now you should be able to use Emojis in your file names, calendar events, comments and many more.

View File

@@ -159,7 +159,7 @@ Adjust chunk size on Nextcloud side
For upload performance improvements in environments with high upload bandwidth, the server's upload chunk size may be adjusted::
sudo -u www-data php occ config:system:set --type int --value 20971520 files.chunked_upload.max_size
sudo -E -u www-data php occ config:system:set --type int --value 20971520 files.chunked_upload.max_size
Put in a value in bytes (in this example, 20MB). Set ``--value 0`` for no chunking at all.

View File

@@ -17,7 +17,7 @@ are on Ubuntu Linux::
Important: If you use consecutive commands, make sure, you are user ``www-data``::
sudo -u www-data bash
sudo -E -u www-data bash
cd /path/to/localdir
mkdir data

View File

@@ -158,7 +158,7 @@ Nextcloud may not always be able to find out what has been
changed remotely (files changed without going through Nextcloud), especially
when it's very deep in the folder hierarchy of the external storage.
You might need to setup a cron job that runs ``sudo -u www-data php occ files:scan --all``
You might need to setup a cron job that runs ``sudo -E -u www-data php occ files:scan --all``
(or replace ``--all`` with the user name, see also :doc:`../occ_command`)
to trigger a rescan of the user's files periodically (for example every 15 minutes), which includes
the mounted external storage.

View File

@@ -20,10 +20,10 @@ Once you have made changes to your ``mimetypealiases.json``, use the ``occ``
command to propagate the changes through the system. This example is for
Ubuntu Linux::
$ sudo -u www-data php occ maintenance:mimetype:update-js
$ sudo -E -u www-data php occ maintenance:mimetype:update-js
# you may also need to update the mimetype for existing files, see nextcloud/server#30566
$ sudo -u www-data php occ maintenance:mimetype:update-db --repair-filecache
$ sudo -E -u www-data php occ maintenance:mimetype:update-db --repair-filecache
See :doc:`../occ_command` to learn more about ``occ``.

View File

@@ -189,7 +189,7 @@ Get info about files in the scan queue
::
sudo -u www php occ files_antivirus:status [-v]
sudo -E -u www-data php occ files_antivirus:status [-v]
Manually trigger the background scan
@@ -197,21 +197,21 @@ Manually trigger the background scan
::
sudo -u www php occ files_antivirus:background-scan [-v] [-m MAX]
sudo -E -u www-data php occ files_antivirus:background-scan [-v] [-m MAX]
Manually scan a single file
~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
sudo -u www php occ files_antivirus:scan <path>
sudo -E -u www-data php occ files_antivirus:scan <path>
Mark a file as scanned or unscanned
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
sudo -u www php occ files_antivirus:mark <path> <scanned|unscanned>
sudo -E -u www-data php occ files_antivirus:mark <path> <scanned|unscanned>
Files marked as scanned will not be scanned for the next four weeks.
@@ -230,4 +230,4 @@ Disabling background scan task
You can disable background scan with occ to only scan files during upload::
sudo -u www php occ config:app:set files_antivirus av_background_scan --value="off"
sudo -E -u www-data php occ config:app:set files_antivirus av_background_scan --value="off"

View File

@@ -3497,7 +3497,7 @@ Allows to create external storages of type "Local" in the web interface and APIs
When disabled, it is still possible to create local storages with occ using
the following command:
% php occ files_external:create /mountpoint local null::null -c datadir=/path/to/data
% sudo -E -u www-data php occ files_external:create /mountpoint local null::null -c datadir=/path/to/data
Defaults to ``true``

View File

@@ -22,7 +22,7 @@ Nextcloud will delete unused passwords. Passwords set for *remote wipe* are dele
The time spans can be overwritten with configuration::
php occ config:system:set token_auth_wipe_token_retention --type=int --value 2592000 # 60*60*24*30 - 30 days
php occ config:system:set token_auth_token_retention --type=int --value 63072000 # 60*60*24*365*2 - 2 years
sudo -E -u www-data php occ config:system:set token_auth_wipe_token_retention --type=int --value 2592000 # 60*60*24*30 - 30 days
sudo -E -u www-data php occ config:system:set token_auth_token_retention --type=int --value 63072000 # 60*60*24*365*2 - 2 years
Values are set in **seconds**.

View File

@@ -17,7 +17,7 @@ learn more about using the ``occ`` command.
::
$ sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin
$ sudo -E -u www-data php /var/www/nextcloud/occ user:resetpassword admin
Enter a new password:
Confirm the new password:
Successfully reset password for admin

View File

@@ -82,7 +82,7 @@ Nextcloud will still consider the provider active for the user at login and show
The associations of removed providers can be cleaned up via :ref:`occ <occ>`::
sudo -u www-data php occ twofactorauth:cleanup <provider_id>
sudo -E -u www-data php occ twofactorauth:cleanup <provider_id>
.. warning:: This operation is irreversible. Only run it for providers you do not intend to enable again as then you have to setup the configuration for all users from scratch.
@@ -92,7 +92,7 @@ Disabling two-factor authentication
Two-factor providers can be disabled via :ref:`occ <occ>`::
sudo -u www-data php occ twofactorauth:disable <uid> <provider_id>
sudo -E -u www-data php occ twofactorauth:disable <uid> <provider_id>
This can be useful if the user forgot or lost their second factor.
Afterwards users are free to enable this provider again via their personal settings.
@@ -101,4 +101,4 @@ Afterwards users are free to enable this provider again via their personal setti
It is also possible to check the current two-factor user status via :ref:`occ <occ>`::
sudo -u www-data php occ twofactorauth:state <uid>
sudo -E -u www-data php occ twofactorauth:state <uid>

View File

@@ -473,7 +473,7 @@ In new Nextcloud installations the home folder rule is enforced. This means that
In migrated Nextcloud installations the old behavior still applies, which is using the Nextcloud username as the home folder when an LDAP attribute is not set. You may change this enforcing the home folder rule with the ``occ`` command in Nextcloud, like this example on Ubuntu::
sudo -u www-data php occ config:app:set user_ldap enforce_home_folder_naming_rule --value=1
sudo -E -u www-data php occ config:app:set user_ldap enforce_home_folder_naming_rule --value=1
.. _LDAP_User_Profile_Attributes:
@@ -494,7 +494,7 @@ Please be aware:
- Having misformatted data in LDAP will most probably leave you with empty user profile fields
- Setting the global ``profile.enabled => false`` on ``config.php`` skips the code
By calling ``php occ ldap:check-user --update <uid>`` the users data from LDAP will be displayed and the profile gets updated. To get the correct ``<uid>`` value for any user you can use ``php occ user:list``.
By calling ``sudo -E -u www-data php occ ldap:check-user --update <uid>`` the users data from LDAP will be displayed and the profile gets updated. To get the correct ``<uid>`` value for any user you can use ``php occ user:list``.
.. note:: After unsetting an attribute name here, the data won't be deleted from user profile. Setting an nonexisting attribute will empty the corresponding profile field.
@@ -662,7 +662,7 @@ It is not a per-configuration option.
The value can be modified by::
sudo -u www-data php occ config:app:set user_ldap updateAttributesInterval --value=86400
sudo -E -u www-data php occ config:app:set user_ldap updateAttributesInterval --value=86400
A value of 0 will update it on every of the named occasions.
@@ -678,7 +678,7 @@ search against. When a search is executed an exact match is required.
Example usage::
$ php occ ldap:promote-group --help
$ sudo -E -u www-data php occ ldap:promote-group --help
Description:
declares the specified group as admin group (only one is possible per LDAP configuration)
@@ -693,15 +693,15 @@ Example usage::
# Example
$ php occ ldap:promote-group "Nextcloud Admins"
$ sudo -E -u www-data php occ ldap:promote-group "Nextcloud Admins"
Promote Nextcloud Admins to the admin group (y|N)? y
Group Nextcloud Admins was promoted
$ php occ ldap:promote-group "Paramount Court"
$ sudo -E -u www-data php occ ldap:promote-group "Paramount Court"
Promote Nextcloud Admins to the admin group and demote Nextcloud Admins (Group ID: nextcloud_admins) (y|N)? y
Group Paramount Court was promoted
$ php occ ldap:promote-group "Paramount Court"
$ sudo -E -u www-data php occ ldap:promote-group "Paramount Court"
The specified group is already promoted
.. note:: Note the group ID will only be displayed when it differs from the

View File

@@ -36,7 +36,7 @@ minutes later the next 50, and so on.
The amount of users to check can be set to a custom value via occ command. The
following example sets it to 300:
``sudo -u www-data php occ config:app:set --value=300 user_ldap cleanUpJobChunkSize``
``sudo -E -u www-data php occ config:app:set --value=300 user_ldap cleanUpJobChunkSize``
There are two ``occ`` commands to use for examining a table of users marked as
deleted, and then manually deleting them. The ``occ`` command is in your
@@ -46,15 +46,15 @@ your HTTP user. To learn more about ``occ``, see
These examples are for Ubuntu Linux:
1. ``sudo -u www-data php occ ldap:show-remnants`` displays a table with all
1. ``sudo -E -u www-data php occ ldap:show-remnants`` displays a table with all
users that have been marked as deleted, and their LDAP data.
2. ``sudo -u www-data php occ user:delete [user]`` removes the user's data from the
2. ``sudo -E -u www-data php occ user:delete [user]`` removes the user's data from the
Nextcloud data directory.
This example shows what the table of users marked as ``deleted`` looks like::
$ sudo -u www-data php occ ldap:show-remnants
$ sudo -E -u www-data php occ ldap:show-remnants
+-----------------+-----------------+------------------+--------------------------------------+
| Nextcloud name | Display Name | LDAP UID | LDAP DN |
+-----------------+-----------------+------------------+--------------------------------------+
@@ -70,7 +70,7 @@ Following flags can be specified additionally:
* ``--json``: instead of a table, the output is json-encoded. This makes it easy to process the data programmatically.
Then you can run ``sudo -u www-data php occ user:delete aaliyah_brown`` to delete
Then you can run ``sudo -E -u www-data php occ user:delete aaliyah_brown`` to delete
user aaliyah_brown. You must use the user's Nextcloud name.
Deleting local Nextcloud users

View File

@@ -30,7 +30,7 @@ Hide export buttons
By default users can export their calendar data from the editor and the sidebar. Admins can disable this feature::
php occ config:app:set calendar hideEventExport --value=yes
sudo -E -u www-data php occ config:app:set calendar hideEventExport --value=yes
Invitations
-----------
@@ -71,7 +71,7 @@ See :doc:`../occ_command` section Dav commands.
You'll also need to change the sending mode from ``background-job`` to ``occ``::
php occ config:app:set dav sendEventRemindersMode --value occ
sudo -E -u www-data php occ config:app:set dav sendEventRemindersMode --value occ
If you don't use this dedicated command, the reminders will just be sent as soon as possible when the background jobs run.
@@ -92,7 +92,7 @@ FreeBusy
When logged-in, Nextcloud can return FreeBusy information for all users of the instance, to know when they are available so that you can schedule an event at the right time.
If you don't wish for users to have this capability, you can disable FreeBusy for the whole instance with the following setting::
php occ config:app:set dav disableFreeBusy --value yes
sudo -E -u www-data php occ config:app:set dav disableFreeBusy --value yes
Subscriptions
-------------
@@ -103,7 +103,7 @@ Custom public calendars
In addition to the public holiday calendars, it is possible to define your own calendar.
They act in the same way as the holiday calendars and can be configured with the following command::
php occ config:app:set calendar publicCalendars --value '[{"name":"My custom calendar","source":"http://example.com/example.ics"}]'
sudo -E -u www-data php occ config:app:set calendar publicCalendars --value '[{"name":"My custom calendar","source":"http://example.com/example.ics"}]'
The setting is specified as a JSON array of objects with the following options:
@@ -122,7 +122,7 @@ Otherwise the default refresh rate is one day.
To set up a different default refresh rate for calendars without server side refresh rates, change the ``calendarSubscriptionRefreshRate`` option::
php occ config:app:set dav calendarSubscriptionRefreshRate --value "PT6H"
sudo -E -u www-data php occ config:app:set dav calendarSubscriptionRefreshRate --value "PT6H"
Where the value is a `DateInterval <https://www.php.net/manual/dateinterval.construct.php>`_, for instance with the above command all of the Nextcloud instance's calendars would be refreshed every 6 hours.
@@ -132,7 +132,7 @@ Allow subscriptions on local network
Because of security issues, Nextcloud forbids subscriptions from local network hosts.
If you need to allow this, change the following parameter to::
php occ config:app:set dav webcalAllowLocalAccess --value yes
sudo -E -u www-data php occ config:app:set dav webcalAllowLocalAccess --value yes
Trash bin
---------
@@ -143,7 +143,7 @@ The default delay before objects are purged from the trash bin is 30 days. A bac
To set up a different retention period, change the ``calendarRetentionObligation`` option::
php occ config:app:set dav calendarRetentionObligation --value=2592000
sudo -E -u www-data php occ config:app:set dav calendarRetentionObligation --value=2592000
Where the value is the number of seconds for the period. Setting the value to ``0`` disables the trash bin.
@@ -167,15 +167,15 @@ Rate limits
Nextcloud rate limits the creation of calendars and subscriptions if too many items are created within a short time frame. The default is 10 calendars or subscriptions per hour. This can be customized as follows::
# Set limit to 15 items per 30 minutes
php occ config:app:set dav rateLimitCalendarCreation --type=integer --value=15
php occ config:app:set dav rateLimitPeriodCalendarCreation --type=integer --value=1800
sudo -E -u www-data php occ config:app:set dav rateLimitCalendarCreation --type=integer --value=15
sudo -E -u www-data php occ config:app:set dav rateLimitPeriodCalendarCreation --type=integer --value=1800
Additionally, the maximum number of calendars and subscriptions a user may create is limited to 30 items. This can be customized too::
# Allow users to create 50 calendars/subscriptions
php occ config:app:set dav maximumCalendarsSubscriptions --type=integer --value=50
sudo -E -u www-data php occ config:app:set dav maximumCalendarsSubscriptions --type=integer --value=50
or::
# Allow users to create calendars/subscriptions without restriction
php occ config:app:set dav maximumCalendarsSubscriptions --type=integer --value=-1
sudo -E -u www-data php occ config:app:set dav maximumCalendarsSubscriptions --type=integer --value=-1

View File

@@ -67,18 +67,18 @@ Rate limits
Nextcloud rate limits the creation of address books and how many can be created in a short period of time. The default is 10 address books per hour. This can be customized as follows::
# Set limit to 15 items per 30 minutes
php occ config:app:set dav rateLimitAddressBookCreation --type=integer --value=15
php occ config:app:set dav rateLimitPeriodAddressBookCreation --type=integer --value=1800
sudo -E -u www-data php occ config:app:set dav rateLimitAddressBookCreation --type=integer --value=15
sudo -E -u www-data php occ config:app:set dav rateLimitPeriodAddressBookCreation --type=integer --value=1800
Additionally, the maximum number of address books a user may create is limited to 10 items. This can be customized too::
# Allow users to create 50 addressbooks
php occ config:app:set dav maximumAdressbooks --type=integer --value=50
sudo -E -u www-data php occ config:app:set dav maximumAdressbooks --type=integer --value=50
or::
# Allow users to create address books without restriction
php occ config:app:set dav maximumAdressbooks --type=integer --value=-1
sudo -E -u www-data php occ config:app:set dav maximumAdressbooks --type=integer --value=-1
Example contact
---------------

View File

@@ -19,7 +19,7 @@ this example for Debian/Ubuntu. You must run ``occ`` as your HTTP user; see
of running the graphical Installation Wizard::
$ cd /var/www/nextcloud/
$ sudo -u www-data php occ maintenance:install \
$ sudo -E -u www-data php occ maintenance:install \
--database='mysql' --database-name='nextcloud' \
--database-user='root' --database-pass='password' \
--admin-user='admin' --admin-pass='password'

View File

@@ -89,7 +89,7 @@ For command line processing (*optional*):
For command line updater (*optional*):
* PHP module phar (upgrades Nextcloud by running ``sudo -u www-data php /var/www/nextcloud/updater/updater.phar``)
* PHP module phar (upgrades Nextcloud by running ``sudo -E -u www-data php /var/www/nextcloud/updater/updater.phar``)
ini values
----------

View File

@@ -175,7 +175,7 @@ if your setup is available on ``https://example.org/nextcloud`` or::
if it isn't installed in a subfolder. Finally run this occ-command to update
your .htaccess file::
sudo -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess
sudo -E -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess
After each update, these changes are automatically applied to the ``.htaccess``-file.

View File

@@ -20,7 +20,7 @@ Patching server
Patching apps
^^^^^^^^^^^^^
1. Navigate to the root of this app (mostly ``apps/[APPID]/``), if you can not find the app there use the ``sudo -u www-data php occ app:getpath APPID`` command to find the path.
1. Navigate to the root of this app (mostly ``apps/[APPID]/``), if you can not find the app there use the ``sudo -E -u www-data php occ app:getpath APPID`` command to find the path.
2. Now apply the patch with the same command as in `Patching server`_
Reverting a patch

View File

@@ -353,7 +353,7 @@ appear in the file listing, or they will appear and not be accessible.
When this happens, please run the :ref:`files scanner<occ_files_scan_label>`, for example with::
sudo -u www-data php occ files:scan --all
sudo -E -u www-data php occ files:scan --all
If the scanner tells about an encoding issue on the affected file, please enable Mac encoding compatibility in the :ref:`mount options<external_storage_mount_options_label>`
and then :ref:`rescan the external storage<occ_files_scan_label>`.
@@ -437,7 +437,7 @@ does not match the actual data stored in the user's ``data/$userId/files`` direc
Running the following command can help fix the sizes and quota for a given user::
sudo -u www-data php occ files:scan -vvv <user-id>
sudo -E -u www-data php occ files:scan -vvv <user-id>
If **encryption was enabled earlier on the instance and disabled later on**, it is likely that some
size values in the database did not correctly get reset upon decrypting.
@@ -488,7 +488,7 @@ Encryption key cannot be found with external storage or group folders
To resolve this issue, please run the following command::
sudo -u www-data php occ encryption:fix-key-location <user-id>
sudo -E -u www-data php occ encryption:fix-key-location <user-id>
This will attempt to recover keys that were not moved properly.

View File

@@ -14,7 +14,7 @@ Maintenance mode
``maintenance:mode`` locks the sessions of logged-in users and prevents new logins in order to prevent inconsistencies of your data. You must run ``occ`` as the HTTP user, like this example on Ubuntu Linux::
$ sudo -u www-data php occ maintenance:mode --on
$ sudo -E -u www-data php occ maintenance:mode --on
You may also put your server into this mode by editing :file:`config/config.php`.
Change ``"maintenance" => false`` to ``"maintenance" => true``:

View File

@@ -102,7 +102,7 @@ Step-by-Step Manual Upgrade
15. Now launch the upgrade from the command line using ``occ``, like this
example on Ubuntu Linux::
sudo -u www-data php occ upgrade
sudo -E -u www-data php occ upgrade
(!) this MUST be executed from within your nextcloud installation directory
@@ -133,7 +133,7 @@ Troubleshooting
Occasionally, *files do not show up after a upgrade*. A rescan of the files can
help::
sudo -u www-data php console.php files:scan --all
sudo -E -u www-data php console.php files:scan --all
See `the nextcloud.com support page <https://nextcloud.com/support/>`_ for further
resources.
@@ -142,15 +142,15 @@ Sometimes, Nextcloud can get *stuck in a upgrade* if the web based upgrade
process is used. This is usually due to the process taking too long and
encountering a PHP time-out. Stop the upgrade process this way::
sudo -u www-data php occ maintenance:mode --off
sudo -E -u www-data php occ maintenance:mode --off
Then start the manual process::
sudo -u www-data php occ upgrade
sudo -E -u www-data php occ upgrade
If this does not work properly, try the repair function::
sudo -u www-data php occ maintenance:repair
sudo -E -u www-data php occ maintenance:repair
.. _nextcloud.com/install/:

View File

@@ -135,7 +135,7 @@ This is how the command line based update would continue:
.. code::
$ sudo -u www-data php ./occ upgrade
$ sudo -E -u www-data php ./occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
@@ -176,7 +176,7 @@ The steps are basically the same as for the web based updater:
2. Instead of clicking that button you can now invoke the command line based
updater by going into the `updater/` directory in the Nextcloud directory
and executing the `updater.phar` as the web server user. (i.e.
``sudo -u www-data php /var/www/nextcloud/updater/updater.phar``)
``sudo -E -u www-data php /var/www/nextcloud/updater/updater.phar``)
.. image:: images/updater-cli-2-start-updater.png
:class: terminal-image
@@ -223,7 +223,7 @@ except an error occurred during the ``occ upgrade`` or the replacement of the
code.
To execute this, run the command with the ``--no-interaction`` option. (i.e.
``sudo -u www-data php /var/www/nextcloud/updater/updater.phar --no-interaction``)
``sudo -E -u www-data php /var/www/nextcloud/updater/updater.phar --no-interaction``)
.. image:: images/updater-cli-8-no-interaction.png
:class: terminal-image

View File

@@ -50,7 +50,7 @@ Nextcloud must be upgraded step by step:
as a background job. If you plan to upgrade directly to another major version (e.g. 24 -> 25 -> 26) you need to make sure these
migrations were executed before starting the next upgrade. To do so you should run the ``cron.php`` file 2-3 times, for example::
$ sudo -u www-data php -f /var/www/nextcloud/cron.php
$ sudo -E -u www-data php -f /var/www/nextcloud/cron.php
For more information about background jobs see :doc:`../configuration_server/background_jobs_configuration`.
@@ -113,7 +113,7 @@ existing Nextcloud code with the code of the new Nextcloud version.
logins. This is the mode to use for upgrades. You must run ``occ`` as the HTTP
user, like this example on Ubuntu Linux::
$ sudo -u www-data php occ maintenance:mode --on
$ sudo -E -u www-data php occ maintenance:mode --on
You may also put your server into this mode by editing :file:`config/config.php`.
Change ``"maintenance" => false`` to ``"maintenance" => true``:
@@ -145,8 +145,8 @@ There is also always an hint in the setup checks of the admin settings web inter
Those include for example::
$ sudo -u www-data php occ db:add-missing-columns
$ sudo -u www-data php occ db:add-missing-indices
$ sudo -u www-data php occ db:add-missing-primary-keys
$ sudo -E -u www-data php occ db:add-missing-columns
$ sudo -E -u www-data php occ db:add-missing-indices
$ sudo -E -u www-data php occ db:add-missing-primary-keys
You can use the ``--dry-run`` option to output the SQL queries instead of executing them.

File diff suppressed because it is too large Load Diff

View File

@@ -52,13 +52,13 @@ It would be best to run one command per screen session or per tmux window/pane t
.. code-block::
set -e; while true; do sudo -u www-data occ background-job:worker -v -t 60 "OCA\WebhookListeners\BackgroundJobs\WebhookCall"; done
set -e; while true; do sudo -E -u www-data php occ background-job:worker -v -t 60 "OCA\WebhookListeners\BackgroundJobs\WebhookCall"; done
For Nextcloud-AIO you should use this command on the host server.
.. code-block::
set -e; while true; do sudo docker exec -u www-data -it nextcloud-aio-nextcloud php occ background-job:worker -v -t 60 "OCA\WebhookListeners\BackgroundJobs\WebhookCall"; done
set -e; while true; do sudo docker exec -it nextcloud-aio-nextcloud docker exec -it nextcloud-aio-nextcloud sudo -E -u www-data php occ background-job:worker -v -t 60 "OCA\WebhookListeners\BackgroundJobs\WebhookCall"; done
You may want to adjust the number of workers and the timeout (in seconds) to your needs.
The logs of the worker can be checked by attaching to the screen or tmux session.
@@ -90,7 +90,7 @@ Systemd service
#!/bin/sh
echo "Starting Nextcloud Webhook Worker $1"
cd /path/to/nextcloud
sudo -u www-data php occ background-job:worker -t 60 'OCA\WebhookListeners\BackgroundJobs\WebhookCall'
sudo -E -u www-data php occ background-job:worker -t 60 'OCA\WebhookListeners\BackgroundJobs\WebhookCall'
You may want to adjust the timeout to your needs (in seconds).

View File

@@ -15,7 +15,7 @@ using the latest development version of Nextcloud.
cd apps/
git clone --branch stableX https://github.com/nextcloud/profiler.git
# adapt X to your Nextcloud version: php occ version | grep -oP 'Nextcloud \K\d+'
# adapt X to your Nextcloud version: sudo -E -u www-data php occ version | grep -oP 'Nextcloud \K\d+'
cd profiler
cd ../..

View File

@@ -12,7 +12,7 @@ When running the command:
.. code-block:: bash
php occ app_api:app:register test-deploy docker_socket_proxy --info-xml https://raw.githubusercontent.com/nextcloud/test-deploy/main/appinfo/info.xml --test-deploy-mode --no-ansi --no-warnings
sudo -E -u www-data php occ app_api:app:register test-deploy docker_socket_proxy --info-xml https://raw.githubusercontent.com/nextcloud/test-deploy/main/appinfo/info.xml --test-deploy-mode --no-ansi --no-warnings
You may receive an error similar to:
@@ -92,7 +92,7 @@ Method 1: Edit PHP CLI php.ini File
.. code-block:: bash
php occ app_api:app:register
sudo -E -u www-data php occ app_api:app:register
It should now be able to access the Internet through the proxy.
@@ -136,7 +136,7 @@ Method 2: Set System-Wide Environment Variables
.. code-block:: bash
php occ app_api:app:register test-deploy docker_socket_proxy --info-xml https://raw.githubusercontent.com/nextcloud/test-deploy/main/appinfo/info.xml --test-deploy-mode --no-ansi --no-warnings
sudo -E -u www-data test-deploy docker_socket_proxy --info-xml https://raw.githubusercontent.com/nextcloud/test-deploy/main/appinfo/info.xml --test-deploy-mode --no-ansi --no-warnings
It should now work without connectivity issues.

View File

@@ -58,7 +58,7 @@ Example of ``occ`` **app_api:daemon:register** command:
.. code-block:: bash
sudo -u www-data php occ app_api:daemon:register docker_local_sock "My Local Docker" docker-install http /var/run/docker.sock "https://nextcloud.local" --net nextcloud
sudo -E -u www-data php occ app_api:daemon:register docker_local_sock "My Local Docker" docker-install http /var/run/docker.sock "https://nextcloud.local" --net nextcloud
ExApp registration
@@ -97,7 +97,7 @@ For all examples and applications we release, we usually add the ``manual_instal
.. code-block::
php occ app_api:app:register nc_py_api manual_install --json-info \
sudo -E -u www-data php occ app_api:app:register nc_py_api manual_install --json-info \
"{\"id\":\"nc_py_api\",\"name\":\"nc_py_api\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":$APP_PORT}" \
.. note::

View File

@@ -94,12 +94,12 @@ This is how they render:
Use double-backticks for inline code and command examples::
``sudo -u www-data php occ files:scan --help``
``sudo -E -u www-data php occ files:scan --help``
``maintenance:install``
This is how they render:
``sudo -u www-data php occ files:scan --help``
``sudo -E -u www-data php occ files:scan --help``
``maintenance:install``