From bd45603b1a357e8f3abaed003abadbba31776073 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 26 Jan 2016 09:39:47 +0100 Subject: [PATCH 1/2] Add docs about type and array support --- .../configuration_server/occ_command.rst | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/admin_manual/configuration_server/occ_command.rst b/admin_manual/configuration_server/occ_command.rst index 35f4d7e71..c138e0ec0 100644 --- a/admin_manual/configuration_server/occ_command.rst +++ b/admin_manual/configuration_server/occ_command.rst @@ -237,13 +237,12 @@ These commands get the value of a single app and system configuration:: $ sudo -u www-data php occ config:app:get activity installed_version 2.1.0 - Setting a Single Configuration Value ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ These commands get the value of a single app or system configuration:: - $ sudo -u www-data php /occ config:system:set logtimezone --value="Europe/Berlin" + $ sudo -u www-data php occ config:system:set logtimezone --value="Europe/Berlin" System config value logtimezone set to Europe/Berlin $ sudo -u www-data php occ config:app:set files_sharing incoming_server2server_share_enabled --value="yes" @@ -254,6 +253,46 @@ The ``set`` command creates the value, if it does not already exist. To update t $ sudo -u www-data php occ config:system:set doesnotexist --value="true" --update-only Value not updated, as it has not been set before. +Setting a non-string Configuration Value +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In order to write a boolean or integer value to the config file, you need to +specify the type on your command as well. The following values are known: + +* ``boolean`` +* ``integer`` +* ``float`` +* ``string`` (default) + +When you want to e.g. disable the maintenance mode you run the following command:: + + $ sudo -u www-data php occ config:system:set maintenance --value=false --type=boolean + ownCloud is in maintenance mode - no app have been loaded + System config value maintenance set to boolean false + +Setting an array Configuration Value +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Some configurations (e.g. the trusted domain setting) are an array of data. +In order to set (and also get) the value of one key, you can specify multiple +config names separated by space:: + + $ sudo -u www-data php occ config:system:get trusted_domains + localhost + owncloud.local + sample.tld + +To replace ``sample.tld`` with ``example.com`` trusted_domains => 2 needs to be +set:: + + $ sudo -u www-data php occ config:system:set trusted_domains 2 --value=example.com + System config value trusted_domains => 2 set to string example.com + + $ sudo -u www-data php occ config:system:get trusted_domains + localhost + owncloud.local + example.com + Deleting a Single Configuration Value ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 7094b55f66a8a29013a4021910f915c815a3123c Mon Sep 17 00:00:00 2001 From: Carla Schroder Date: Tue, 26 Jan 2016 09:45:06 -0800 Subject: [PATCH 2/2] Update occ_command.rst --- admin_manual/configuration_server/occ_command.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin_manual/configuration_server/occ_command.rst b/admin_manual/configuration_server/occ_command.rst index c138e0ec0..bca692a33 100644 --- a/admin_manual/configuration_server/occ_command.rst +++ b/admin_manual/configuration_server/occ_command.rst @@ -67,7 +67,7 @@ Ubuntu:: check check dependencies of the server environment help Displays help for a command list Lists commands - status show some status information + status show some status informationb upgrade run upgrade routines after installation of a new release. The release has to be installed before. @@ -256,8 +256,8 @@ The ``set`` command creates the value, if it does not already exist. To update t Setting a non-string Configuration Value ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -In order to write a boolean or integer value to the config file, you need to -specify the type on your command as well. The following values are known: +In order to write a Boolean or integer value to the configuration file, you need to +specify the type on your command as well. This applies only to the ``config:system:set`` command. The following values are known: * ``boolean`` * ``integer``