From 0200647d12e12cf9d0d47c1f1d998ccc2ad4a173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 17 Sep 2024 16:24:23 +0200 Subject: [PATCH 1/3] enh: Add subtitles for occ user commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- .../configuration_server/occ_command.rst | 48 ++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/admin_manual/configuration_server/occ_command.rst b/admin_manual/configuration_server/occ_command.rst index 4cb27f17c3d..7e367ca58e1 100644 --- a/admin_manual/configuration_server/occ_command.rst +++ b/admin_manual/configuration_server/occ_command.rst @@ -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:: @@ -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 @@ -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 @@ -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:: @@ -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:: From a182d3cc30e4abb1352c5089b2fccd5bebb70065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 17 Sep 2024 16:36:43 +0200 Subject: [PATCH 2/3] enh: Move occ configuration to top level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s not specific to server configuration and should be easy to find in the admin manual. Signed-off-by: Côme Chilliet --- .../external_storage_configuration_gui.rst | 2 +- .../configuration_files/file_sharing_configuration.rst | 2 +- admin_manual/configuration_mimetypes/index.rst | 2 +- admin_manual/configuration_server/index.rst | 1 - admin_manual/configuration_user/profile_configuration.rst | 2 +- admin_manual/configuration_user/reset_admin_password.rst | 2 +- admin_manual/configuration_user/user_auth_ldap_cleanup.rst | 2 +- admin_manual/contents.rst | 1 + admin_manual/groupware/calendar.rst | 4 ++-- admin_manual/issues/code_signing.rst | 2 +- admin_manual/maintenance/upgrade.rst | 2 +- admin_manual/{configuration_server => }/occ_command.rst | 4 ++-- user_manual/files/encrypting_files.rst | 4 ++-- 13 files changed, 15 insertions(+), 15 deletions(-) rename admin_manual/{configuration_server => }/occ_command.rst (99%) diff --git a/admin_manual/configuration_files/external_storage_configuration_gui.rst b/admin_manual/configuration_files/external_storage_configuration_gui.rst index 5c6909c38e3..ad38f0a5e8e 100644 --- a/admin_manual/configuration_files/external_storage_configuration_gui.rst +++ b/admin_manual/configuration_files/external_storage_configuration_gui.rst @@ -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. diff --git a/admin_manual/configuration_files/file_sharing_configuration.rst b/admin_manual/configuration_files/file_sharing_configuration.rst index e04ef5987ee..e42ec09314e 100644 --- a/admin_manual/configuration_files/file_sharing_configuration.rst +++ b/admin_manual/configuration_files/file_sharing_configuration.rst @@ -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. diff --git a/admin_manual/configuration_mimetypes/index.rst b/admin_manual/configuration_mimetypes/index.rst index b0d835895a4..8b47f2e406e 100644 --- a/admin_manual/configuration_mimetypes/index.rst +++ b/admin_manual/configuration_mimetypes/index.rst @@ -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: diff --git a/admin_manual/configuration_server/index.rst b/admin_manual/configuration_server/index.rst index 2ae7558c7cd..a0ed087b2de 100644 --- a/admin_manual/configuration_server/index.rst +++ b/admin_manual/configuration_server/index.rst @@ -7,6 +7,5 @@ Nextcloud configuration :glob: security_setup_warnings - occ_command config_sample_php_parameters * diff --git a/admin_manual/configuration_user/profile_configuration.rst b/admin_manual/configuration_user/profile_configuration.rst index dda5c43524b..ed74315e5cd 100644 --- a/admin_manual/configuration_user/profile_configuration.rst +++ b/admin_manual/configuration_user/profile_configuration.rst @@ -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`` diff --git a/admin_manual/configuration_user/reset_admin_password.rst b/admin_manual/configuration_user/reset_admin_password.rst index 9bbad3e9bf7..f3ca7771054 100644 --- a/admin_manual/configuration_user/reset_admin_password.rst +++ b/admin_manual/configuration_user/reset_admin_password.rst @@ -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. :: diff --git a/admin_manual/configuration_user/user_auth_ldap_cleanup.rst b/admin_manual/configuration_user/user_auth_ldap_cleanup.rst index d003cbb05cd..23c09e29200 100644 --- a/admin_manual/configuration_user/user_auth_ldap_cleanup.rst +++ b/admin_manual/configuration_user/user_auth_ldap_cleanup.rst @@ -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: diff --git a/admin_manual/contents.rst b/admin_manual/contents.rst index 000434abe92..67394af85b4 100644 --- a/admin_manual/contents.rst +++ b/admin_manual/contents.rst @@ -10,6 +10,7 @@ Table of contents release_schedule installation/index configuration_server/index + occ_command apps_management configuration_user/index configuration_files/index diff --git a/admin_manual/groupware/calendar.rst b/admin_manual/groupware/calendar.rst index 8e0d5ea65cd..6a29976a4be 100644 --- a/admin_manual/groupware/calendar.rst +++ b/admin_manual/groupware/calendar.rst @@ -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 ---------------------- @@ -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``:: diff --git a/admin_manual/issues/code_signing.rst b/admin_manual/issues/code_signing.rst index da573a21d27..e8e1b6f1657 100644 --- a/admin_manual/issues/code_signing.rst +++ b/admin_manual/issues/code_signing.rst @@ -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 ------ diff --git a/admin_manual/maintenance/upgrade.rst b/admin_manual/maintenance/upgrade.rst index 8022020fa7e..39c4e38b2d2 100644 --- a/admin_manual/maintenance/upgrade.rst +++ b/admin_manual/maintenance/upgrade.rst @@ -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. diff --git a/admin_manual/configuration_server/occ_command.rst b/admin_manual/occ_command.rst similarity index 99% rename from admin_manual/configuration_server/occ_command.rst rename to admin_manual/occ_command.rst index 7e367ca58e1..59545ed8772 100644 --- a/admin_manual/configuration_server/occ_command.rst +++ b/admin_manual/occ_command.rst @@ -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: @@ -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 diff --git a/user_manual/files/encrypting_files.rst b/user_manual/files/encrypting_files.rst index 15ccc1d890c..670c1acb523 100644 --- a/user_manual/files/encrypting_files.rst +++ b/user_manual/files/encrypting_files.rst @@ -34,7 +34,7 @@ How can encryption be disabled? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The only way to disable encryption is to run the `"decrypt all" -`_ +`_ script, which decrypts all files and disables encryption. .. TODO ON RELEASE: Update version number above on release @@ -44,7 +44,7 @@ Is it possible to disable encryption with the recovery key? Yes, *if* every user uses the `file recovery key `_, `"decrypt all" -`_ will use it to decrypt all files. +`_ will use it to decrypt all files. .. TODO ON RELEASE: Update version number above on release From 5485faa0c8c6868966ed50080d5b85240f463532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 17 Sep 2024 16:40:22 +0200 Subject: [PATCH 3/3] feat: Document user:list and --disabled option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- admin_manual/occ_command.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/admin_manual/occ_command.rst b/admin_manual/occ_command.rst index 59545ed8772..dbe16b24391 100644 --- a/admin_manual/occ_command.rst +++ b/admin_manual/occ_command.rst @@ -1521,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