Skip to content

Commit 71b828f

Browse files
committed
feat(admin): document OCC commands for WCF
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent a23935a commit 71b828f

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

admin_manual/configuration_files/windows_compatible_filenames.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ or filenames like ``AUX.txt`` (on Windows ``AUX`` is a reserved name and cannot
2828
Enabling Windows compatible filenames
2929
-------------------------------------
3030

31+
This feature can be enabled either by using the web interface
32+
or by using an ``occ`` command.
33+
3134
.. note::
3235

3336
This feature works by setting a predefined set of system configuration settings.
@@ -43,6 +46,15 @@ Within the **Files compatibility** section the Windows compatibility can be enab
4346
.. figure:: images/files-windows-compatibility.png
4447
:alt: Enforce windows compatibility checkbox on the Administration - Basic settings - Files compatibility page.
4548

49+
Using the occ command
50+
^^^^^^^^^^^^^^^^^^^^^
51+
52+
.. note::
53+
54+
This command was introduced in Nextcloud 32.
55+
56+
To quickly enable or disable the feature an :ref:`occ command <occ_files_windows_filenames>` is provided.
57+
4658
Consequences
4759
------------
4860

@@ -54,3 +66,10 @@ This works by setting a pre-defined set of configuration settings:
5466
- ``forbidden_filename_basenames`` will be set to names reserved on Windows.
5567
- ``forbidden_filename_characters`` will be set to characters not valid for filenames on Windows.
5668
- ``forbidden_filename_extensions`` will be set to strings not allowed as trailing parts, like a trailing dot or spaces.
69+
70+
Sanitizing invalid filenames
71+
----------------------------
72+
73+
After enabling the feature the users have to manually adjust all invalid filenames
74+
to be able to keep working with them.
75+
As an alternative Nextcloud provides the :ref:`occ files:sanitize-filenames <occ_files_sanitize_filenames>` command to automatically rename all invalid files.

admin_manual/occ_command.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,36 @@ This command attempts to repair such entries by querying for entries where the p
974974
doesn't match the expected path based on it's parent path and filename and resets it's
975975
path to the expected one.
976976

977+
.. _occ_files_sanitize_filenames:
978+
979+
Sanitize filenames
980+
^^^^^^^^^^^^^^^^^^
981+
982+
This command allows to automatically rename files not matching the current file naming constraints,
983+
for example after enabling the :ref:`Windows compatible filenames <windows_compatible_filenames>`::
984+
985+
Usage:
986+
files:sanitize-filenames [options] [--] [<user_id>...]
987+
988+
Arguments:
989+
user_id Limit filename sanitizing to files given user(s) have access to
990+
991+
Options:
992+
--dry-run Do not actually rename any files but just check filenames.
993+
-c, --char-replacement=CHAR-REPLACEMENT Replacement for invalid character (by default space, underscore or dash is used)
994+
995+
When running this command without parameters it will scan all files of all users
996+
for filenames not comply with the current filename constraints and try to automatically
997+
rename those files.
998+
Invalid characters will be replaced by default with either a space, underscore, or dash
999+
depending on which characters are allowed.
1000+
If your constraints forbid all of them, then you have to provide an character replacement
1001+
yourself by specifying the ``--char-replacement`` option.
1002+
1003+
The ``--dry-run`` option allows to perform the sanitizing without the actual renaming,
1004+
this is useful for estimating the execution time and to get an overview on what renaming
1005+
actions will be performed.
1006+
9771007
Transfer
9781008
^^^^^^^^
9791009

@@ -1028,6 +1058,21 @@ See `user documentation <https://docs.nextcloud.com/server/latest/user_manual/en
10281058

10291059
.. TODO ON RELEASE: Update version number above on release
10301060
1061+
.. _occ_files_windows_filenames:
1062+
1063+
Toggle Windows compatibility
1064+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1065+
1066+
The command ``occ files:windows-compatible-filenames`` can be used to toggle
1067+
enforcing :ref:`Windows compatible filenames <windows_compatible_filenames>`::
1068+
1069+
Usage:
1070+
files:windows-compatible-filenames [options]
1071+
1072+
Options:
1073+
--enable enable enforcing windows compatible filenames
1074+
--disable disable enforcing windows compatible filenames
1075+
10311076
.. _occ_sharing_label:
10321077

10331078
Files Sharing

0 commit comments

Comments
 (0)