Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve occ documentation #12212

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,6 @@ 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``
(or replace ``--all`` with the user name, see also :doc:`../configuration_server/occ_command`)
(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.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Trashbin contents are not transferred::

occ files:transfer-ownership user1 user2

(See :doc:`../configuration_server/occ_command` for a complete ``occ``
(See :doc:`../occ_command` for a complete ``occ``
reference.)

Users may also transfer files or folders selectively by themselves.
Expand Down
2 changes: 1 addition & 1 deletion admin_manual/configuration_mimetypes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Ubuntu Linux::
# 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

See :doc:`../configuration_server/occ_command` to learn more about ``occ``.
See :doc:`../occ_command` to learn more about ``occ``.

Some common mimetypes that may be useful in creating aliases are:

Expand Down
1 change: 0 additions & 1 deletion admin_manual/configuration_server/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ Nextcloud configuration
:glob:

security_setup_warnings
occ_command
config_sample_php_parameters
*
2 changes: 1 addition & 1 deletion admin_manual/configuration_user/profile_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Basic settings under the Administration settings section.

occ config:app:set settings profile_enabled_by_default --value="0"

Please refer to :doc:`../configuration_server/occ_command` for all available
Please refer to :doc:`../occ_command` for all available
``occ`` commands.

To disable profile globally add the following line to your ``config.php``
Expand Down
2 changes: 1 addition & 1 deletion admin_manual/configuration_user/reset_admin_password.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The normal ways to recover a lost password are:
2. Ask another Nextcloud server admin to reset it for you.

If neither of these is an option, then you have a third option, and that is
using the ``occ`` command. See :doc:`../configuration_server/occ_command` to
using the ``occ`` command. See :doc:`../occ_command` to
learn more about using the ``occ`` command.

::
Expand Down
2 changes: 1 addition & 1 deletion admin_manual/configuration_user/user_auth_ldap_cleanup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ 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
Nextcloud directory, for example ``/var/www/nextcloud/occ``, and it must be run as
your HTTP user. To learn more about ``occ``, see
:doc:`../configuration_server/occ_command`.
:doc:`../occ_command`.

These examples are for Ubuntu Linux:

Expand Down
1 change: 1 addition & 0 deletions admin_manual/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Table of contents
release_schedule
installation/index
configuration_server/index
occ_command
apps_management
configuration_user/index
configuration_files/index
Expand Down
4 changes: 2 additions & 2 deletions admin_manual/groupware/calendar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Contacts that have a birthday date filled are automatically added as events to a
If you deactivate this option, all users will no longer have this calendar.

When activating this option, users birthday calendars won't be available right away because they need to be generated
by a background task. See :doc:`../configuration_server/occ_command` section DAV commands.
by a background task. See :doc:`../occ_command` section DAV commands.

Reminder notifications
----------------------
Expand All @@ -67,7 +67,7 @@ more often than the standard ``cron`` system::
# crontab -u www-data -e
*/5 * * * * php -f /var/www/nextcloud/occ dav:send-event-reminders

See :doc:`../configuration_server/occ_command` section Dav commands.
See :doc:`../occ_command` section Dav commands.

You'll also need to change the sending mode from ``background-job`` to ``occ``::

Expand Down
2 changes: 1 addition & 1 deletion admin_manual/issues/code_signing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Rescans are triggered at installation, and by updates. You may run scans manuall
occ integrity:check-core
occ integrity:check-app $appid

See :doc:`../configuration_server/occ_command` to learn more about using ``occ``.
See :doc:`../occ_command` to learn more about using ``occ``.

Errors
------
Expand Down
2 changes: 1 addition & 1 deletion admin_manual/maintenance/upgrade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Maintenance mode

You can put your Nextcloud server into maintenance mode before performing
upgrades, or for performing troubleshooting or maintenance. Please see
:doc:`../configuration_server/occ_command` to learn how to put your server into
:doc:`../occ_command` to learn how to put your server into
the maintenance mode (``maintenance:mode``) or execute repair commands
(``maintenance:repair``) with the ``occ`` command.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ The other two commands are:
* ``background:cron``
* ``background:webcron``

See :doc:`background_jobs_configuration` to learn more.
See :doc:`configuration_server/background_jobs_configuration` to learn more.

.. _config_commands_label:

Expand Down Expand Up @@ -1178,7 +1178,7 @@ Security
--------

Use these commands to manage server-wide security related parameters. Currently this
includes :doc:`bruteforce_configuration` and SSL certificates (the latter are useful when
includes :doc:`configuration_server/bruteforce_configuration` and SSL certificates (the latter are useful when
creating federation connections with other Nextcloud servers that use self-signed certificates::

security
Expand Down Expand Up @@ -1359,6 +1359,9 @@ report showing how many users you have, and when a user was last logged in::
the stored private key


user:add
^^^^^^^^

You can create a new user with their display name, login name, and any group
memberships with the ``user:add`` command. The syntax is::

Expand Down Expand Up @@ -1398,21 +1401,6 @@ Jones::
Display name set to "Fred Jones"
User "fred" added to group "users"

You can reset any user's password, including administrators (see
:doc:`../configuration_user/reset_admin_password`)::

sudo -u www-data php occ user:resetpassword layla
Enter a new password:
Confirm the new password:
Successfully reset password for layla

You may also use ``password-from-env`` to reset passwords::

export OC_PASS=newpassword
su -s /bin/sh www-data -c 'php occ user:resetpassword --password-from-env
layla'
Successfully reset password for layla

``generate-password`` allows you to set a securely generated password for the user.
This is never shown in the output and can be used to create users with temporary
passwords. This can be used in conjunction with the ``email`` option to create
Expand All @@ -1433,10 +1421,34 @@ the user. A welcome email will be sent to the user's email address if
The account "layla" was created successfully
Welcome email sent to layla@example.tld

user:resetpassword
^^^^^^^^^^^^^^^^^^

You can reset any user's password, including administrators (see
:doc:`../configuration_user/reset_admin_password`)::

sudo -u www-data php occ user:resetpassword layla
Enter a new password:
Confirm the new password:
Successfully reset password for layla

You may also use ``password-from-env`` to reset passwords::

export OC_PASS=newpassword
su -s /bin/sh www-data -c 'php occ user:resetpassword --password-from-env
layla'
Successfully reset password for layla

user:delete
^^^^^^^^^^^

You can delete users::

sudo -u www-data php occ user:delete fred

user:lastseen
^^^^^^^^^^^^^

View a specific user's most recent login::

sudo -u www-data php occ user:lastseen layla
Expand All @@ -1450,7 +1462,8 @@ View a list of all users' most recent login::
layla's last login: 2024-03-20 17:18
stephanie's last login: 2024-01-11 13:26


user:setting
^^^^^^^^^^^^

Read user settings::

Expand Down Expand Up @@ -1481,6 +1494,9 @@ Delete a setting::

sudo -u www-data php occ user:setting layla settings email --delete

user:report
^^^^^^^^^^^

Generate a simple report that counts all users, including users on external user
authentication servers such as LDAP::

Expand All @@ -1505,6 +1521,11 @@ There might be a discrepancy between the total number of users compared to the n
Users that have never logged in before are not counted as active or disabled users.
Some user backends also do not allow a count for the number of users.

user:list
^^^^^^^^^

You can use the command ``user:list`` to list users. By default it will limit the output to 500 users but you can override that with options ``--limit`` and ``--offset``. Use ``--disabled`` to only list disabled users.

.. _group_commands_label:

Group commands
Expand Down
4 changes: 2 additions & 2 deletions user_manual/files/encrypting_files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ How can encryption be disabled?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The only way to disable encryption is to run the `"decrypt all"
<https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#encryption-label>`_
<https://docs.nextcloud.com/server/latest/admin_manual/occ_command.html#encryption-label>`_
script, which decrypts all files and disables encryption.

.. TODO ON RELEASE: Update version number above on release
Expand All @@ -44,7 +44,7 @@ Is it possible to disable encryption with the recovery key?

Yes, *if* every user uses the `file recovery key
<https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/encryption_configuration.html#enabling-users-file-recovery-keys>`_, `"decrypt all"
<https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#encryption-label>`_ will use it to decrypt all files.
<https://docs.nextcloud.com/server/latest/admin_manual/occ_command.html#encryption-label>`_ will use it to decrypt all files.

.. TODO ON RELEASE: Update version number above on release

Expand Down