Skip to content

Commit 78b5abd

Browse files
committed
docs(config): document missing admin-configurable config keys
Add documentation for config keys that are used in the server code but were absent from config.sample.php, making them invisible to admins and excluded from the auto-generated configuration reference. Keys added: User/auth settings: - allow_user_to_change_email (defaults true, falls back to allow_user_to_change_display_name) - auth_can_create_app_token (defaults true) - auth_onetime_token_validity (defaults 120s) - twofactor_enforced / twofactor_enforced_groups / twofactor_enforced_excluded_groups (managed via occ twofactorauth:enforce, documented here for direct config.php use) Server/networking: - dns_pinning (defaults true, prevents DNS rebinding attacks) - pollinterval (defaults 60s, sync client poll frequency) - webdav-root (defaults remote.php/webdav) - registration_link (defaults nextcloud.com/register, shown on login page) - enable_avatars (defaults true) App management: - app_install_overwrite (defaults [], bypass max-version check for listed apps) Previews: - preview_format (defaults jpeg, jpeg/webp/png for Imaginary service) File locking: - filelocking.enabled (defaults true, strongly discouraged to disable) Config Lexicon: - lexicon.default.userconfig (set server-wide defaults for user config keys) - lexicon.default.userconfig.enforced (prevent users from overriding specific values) Signed-off-by: Anna Larch <anna@larch.dev> Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent bcefc59 commit 78b5abd

1 file changed

Lines changed: 165 additions & 0 deletions

File tree

config/config.sample.php

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,34 @@
303303
*/
304304
'allow_user_to_change_display_name' => true,
305305

306+
/**
307+
* ``true`` allows users to change their email address (on their Personal
308+
* pages), and ``false`` prevents them from changing their email address.
309+
* Falls back to ``allow_user_to_change_display_name`` if not set.
310+
*
311+
* Defaults to ``true``
312+
*/
313+
'allow_user_to_change_email' => true,
314+
315+
/**
316+
* ``true`` allows users to create app passwords (tokens) in their personal
317+
* security settings. Set to ``false`` to prevent users from generating app
318+
* passwords, for example when SSO is enforced and app passwords would
319+
* bypass it.
320+
*
321+
* Defaults to ``true``
322+
*/
323+
'auth_can_create_app_token' => true,
324+
325+
/**
326+
* Validity period (in seconds) for one-time authentication tokens, such as
327+
* those used for email-based login or share link authentication.
328+
* The minimum value is ``120``.
329+
*
330+
* Defaults to ``120``
331+
*/
332+
'auth_onetime_token_validity' => 120,
333+
306334
/**
307335
* The directory where the skeleton files are located. These files will be
308336
* copied to the data directory of new users. Set empty string to not copy any
@@ -408,6 +436,30 @@
408436
*/
409437
'token_auth_enforced' => false,
410438

439+
/**
440+
* Enforce two-factor authentication for all users, or for members of specific
441+
* groups. Managed via ``occ twofactorauth:enforce``.
442+
*
443+
* Defaults to ``'false'`` (stored as string)
444+
*/
445+
'twofactor_enforced' => 'false',
446+
447+
/**
448+
* When ``twofactor_enforced`` is ``'true'``, restrict enforcement to these
449+
* groups. All other users are not affected. Empty array enforces for all users.
450+
*
451+
* Defaults to ``[]``
452+
*/
453+
'twofactor_enforced_groups' => [],
454+
455+
/**
456+
* Exclude specific groups from two-factor authentication enforcement.
457+
* Only relevant when ``twofactor_enforced`` is ``'true'``.
458+
*
459+
* Defaults to ``[]``
460+
*/
461+
'twofactor_enforced_excluded_groups' => [],
462+
411463
/**
412464
* The interval at which token activity should be updated.
413465
* Increasing this value means that the last activity on the security page gets
@@ -827,6 +879,16 @@
827879
*/
828880
'allow_local_remote_servers' => true,
829881

882+
/**
883+
* Enable DNS pinning for outbound HTTP requests. When enabled, Nextcloud
884+
* resolves the hostname of a request target once and rejects the connection
885+
* if the resolved IP changes during the request. This prevents DNS rebinding
886+
* attacks at the cost of slightly increased latency on the first request.
887+
*
888+
* Defaults to ``true``
889+
*/
890+
'dns_pinning' => true,
891+
830892
/**
831893
* Add the URL of the Nextcloud server in User-Agent headers HTTP calls.
832894
*
@@ -1327,6 +1389,15 @@
13271389
'customclient_fdroid'
13281390
=> 'https://f-droid.org/packages/com.nextcloud.client/',
13291391

1392+
/**
1393+
* URL shown as a sign-up / registration link on the login page. Set to a
1394+
* custom URL to point users to your own registration flow.
1395+
* Set to empty string ``''`` to hide the link entirely.
1396+
*
1397+
* Defaults to ``'https://nextcloud.com/register'``
1398+
*/
1399+
'registration_link' => 'https://nextcloud.com/register',
1400+
13301401
/**
13311402
* Activity
13321403
*
@@ -1385,13 +1456,43 @@
13851456
*/
13861457
'defaultapp' => 'dashboard,files',
13871458

1459+
/**
1460+
* Interval (in seconds) at which sync clients poll the server for changes.
1461+
* Lowering this value increases server load; increasing it reduces update
1462+
* frequency for connected clients.
1463+
*
1464+
* Defaults to ``60``
1465+
*/
1466+
'pollinterval' => 60,
1467+
1468+
/**
1469+
* WebDAV root path advertised to sync clients via the capabilities API.
1470+
* Clients use this value to construct the WebDAV URL; changing it does not
1471+
* remap the server's routing. Only set this if you have configured a custom
1472+
* WebDAV path at the web server level and need clients to use that path.
1473+
*
1474+
* Defaults to ``'remote.php/webdav'``
1475+
*/
1476+
'webdav-root' => 'remote.php/webdav',
1477+
13881478
/**
13891479
* When enabled, admins may install apps from the Nextcloud app store.
13901480
*
13911481
* Defaults to ``true``
13921482
*/
13931483
'appstoreenabled' => true,
13941484

1485+
/**
1486+
* Allow installing apps that declare a maximum version requirement lower than
1487+
* the current Nextcloud version. List the app IDs to override.
1488+
* Apps force-enabled via ``occ app:enable --force`` are added here automatically.
1489+
*
1490+
* Use with care: apps may be incompatible with the current server version.
1491+
*
1492+
* Defaults to ``[]``
1493+
*/
1494+
'app_install_overwrite' => [],
1495+
13951496
/**
13961497
* Enables the installation of apps from a self-hosted apps store.
13971498
* Requires that at least one of the configured apps directories is writable.
@@ -1433,6 +1534,14 @@
14331534
* These options control enabling and disabling previews, and thumbnail size.
14341535
*/
14351536

1537+
/**
1538+
* ``true`` enables avatar support. Set to ``false`` to disable avatars
1539+
* server-wide, which also removes the avatar section from personal settings.
1540+
*
1541+
* Defaults to ``true``
1542+
*/
1543+
'enable_avatars' => true,
1544+
14361545
/**
14371546
* By default, Nextcloud can generate previews for the following filetypes:
14381547
*
@@ -1540,6 +1649,18 @@
15401649
*/
15411650
'preview_imaginary_url' => 'http://previews_hpb:8088/',
15421651

1652+
/**
1653+
* Image format used when generating preview thumbnails via the Imaginary
1654+
* service. Applies only when ``preview_imaginary_url`` is configured.
1655+
* Accepted values: ``jpeg``, ``webp``, ``png``.
1656+
*
1657+
* ``webp`` produces smaller files at comparable quality. ``jpeg`` has the
1658+
* broadest client compatibility.
1659+
*
1660+
* Defaults to ``'jpeg'``
1661+
*/
1662+
'preview_format' => 'jpeg',
1663+
15431664
/**
15441665
* If you want to set an API key for Imaginary.
15451666
*/
@@ -2605,6 +2726,16 @@
26052726
*/
26062727
'max_filesize_animated_gifs_public_sharing' => 10,
26072728

2729+
/**
2730+
* Enable transactional file locking. This prevents simultaneous processes
2731+
* from writing to the same files, which can cause data corruption.
2732+
* Disabling this is strongly discouraged unless you are using an external
2733+
* file locking provider.
2734+
*
2735+
* Defaults to ``true``
2736+
*/
2737+
'filelocking.enabled' => true,
2738+
26082739
/**
26092740
* Set the lock's time-to-live (TTL) in seconds. Locks older than this are
26102741
* automatically cleaned up.
@@ -3013,4 +3144,38 @@
30133144
* Defaults to ``0``.
30143145
*/
30153146
'preview_expiration_days' => 0,
3147+
3148+
/**
3149+
* Set server-wide default values for user config keys managed by the Config
3150+
* Lexicon. These defaults are used when the user has not explicitly set a value.
3151+
* The structure mirrors the app config lexicon: ``appId => [ configKey => value ]``.
3152+
*
3153+
* Example::
3154+
*
3155+
* 'lexicon.default.userconfig' => [
3156+
* 'files' => [
3157+
* 'show_hidden' => 'false',
3158+
* ],
3159+
* ],
3160+
*
3161+
* Defaults to ``[]``
3162+
*/
3163+
'lexicon.default.userconfig' => [],
3164+
3165+
/**
3166+
* Enforce server-wide values for user config keys managed by the Config
3167+
* Lexicon. Users cannot override enforced values. The structure is the same
3168+
* as ``lexicon.default.userconfig``.
3169+
*
3170+
* Example::
3171+
*
3172+
* 'lexicon.default.userconfig.enforced' => [
3173+
* 'files' => [
3174+
* 'show_hidden' => 'false',
3175+
* ],
3176+
* ],
3177+
*
3178+
* Defaults to ``[]``
3179+
*/
3180+
'lexicon.default.userconfig.enforced' => [],
30163181
];

0 commit comments

Comments
 (0)