From 083c325a319fa084096038b11ecd632bc83130d4 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Mon, 27 May 2019 17:25:51 +0200 Subject: [PATCH] Rename config files. Update provisioning naming, use dashes instead of underscores, and remove a redundant config file. Signed-off-by: Patrick Vacek --- config/CMakeLists.txt | 2 +- config/{sota_hsm_prov.toml => sota-device-cred-hsm.toml} | 0 config/{sota_implicit_prov_ca.toml => sota-device-cred.toml} | 0 config/{sota_local.toml => sota-local.toml} | 0 config/{sota_secondary.toml => sota-secondary.toml} | 0 config/{sota_autoprov.toml => sota-shared-cred.toml} | 0 config/{sota_uboot_env.toml => sota-uboot-env.toml} | 0 config/{sota_ubuntu.toml => sota-ubuntu.toml} | 0 config/sota_autoprov_primary.toml | 5 ----- docs/client-provisioning-methods.adoc | 4 ++-- docs/debugging-tips.adoc | 4 ++-- docs/provisioning-methods-and-credentialszip.adoc | 2 +- src/aktualizr_info/aktualizr_info_config_test.cc | 2 +- tests/CMakeLists.txt | 2 +- 14 files changed, 8 insertions(+), 13 deletions(-) rename config/{sota_hsm_prov.toml => sota-device-cred-hsm.toml} (100%) rename config/{sota_implicit_prov_ca.toml => sota-device-cred.toml} (100%) rename config/{sota_local.toml => sota-local.toml} (100%) rename config/{sota_secondary.toml => sota-secondary.toml} (100%) rename config/{sota_autoprov.toml => sota-shared-cred.toml} (100%) rename config/{sota_uboot_env.toml => sota-uboot-env.toml} (100%) rename config/{sota_ubuntu.toml => sota-ubuntu.toml} (100%) delete mode 100644 config/sota_autoprov_primary.toml diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index aa06be2a84..d075c605b1 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -5,7 +5,7 @@ if(BUILD_DEB) PERMISSIONS OWNER_READ OWNER_WRITE COMPONENT aktualizr) - install(FILES sota_ubuntu.toml + install(FILES sota-ubuntu.toml DESTINATION lib/sota/conf.d PERMISSIONS OWNER_READ OWNER_WRITE COMPONENT aktualizr) diff --git a/config/sota_hsm_prov.toml b/config/sota-device-cred-hsm.toml similarity index 100% rename from config/sota_hsm_prov.toml rename to config/sota-device-cred-hsm.toml diff --git a/config/sota_implicit_prov_ca.toml b/config/sota-device-cred.toml similarity index 100% rename from config/sota_implicit_prov_ca.toml rename to config/sota-device-cred.toml diff --git a/config/sota_local.toml b/config/sota-local.toml similarity index 100% rename from config/sota_local.toml rename to config/sota-local.toml diff --git a/config/sota_secondary.toml b/config/sota-secondary.toml similarity index 100% rename from config/sota_secondary.toml rename to config/sota-secondary.toml diff --git a/config/sota_autoprov.toml b/config/sota-shared-cred.toml similarity index 100% rename from config/sota_autoprov.toml rename to config/sota-shared-cred.toml diff --git a/config/sota_uboot_env.toml b/config/sota-uboot-env.toml similarity index 100% rename from config/sota_uboot_env.toml rename to config/sota-uboot-env.toml diff --git a/config/sota_ubuntu.toml b/config/sota-ubuntu.toml similarity index 100% rename from config/sota_ubuntu.toml rename to config/sota-ubuntu.toml diff --git a/config/sota_autoprov_primary.toml b/config/sota_autoprov_primary.toml deleted file mode 100644 index 7db1f3fd68..0000000000 --- a/config/sota_autoprov_primary.toml +++ /dev/null @@ -1,5 +0,0 @@ -[provision] -provision_path = "/var/sota/sota_provisioning_credentials.zip" - -[storage] -type = "sqlite" diff --git a/docs/client-provisioning-methods.adoc b/docs/client-provisioning-methods.adoc index 28cee085f9..a20c4ee4d0 100644 --- a/docs/client-provisioning-methods.adoc +++ b/docs/client-provisioning-methods.adoc @@ -23,10 +23,10 @@ To configure a device to provision with shared credentials, follow these steps: . Download a https://docs.ota.here.com/quickstarts/generating-provisioning-credentials.html[provisioning key]. . Edit the following `.toml` configuration file: + -link:../config/sota_autoprov.toml[config/sota_autoprov.toml] +link:../config/sota-shared-cred.toml[config/sota-shared-cred.toml] . Update the configuration file with the path to the zip file that you saved in the first step and start Aktualizr on the device. + -** When aktualizr starts, it uses the provisioning key to register with the device gateway HTTPS API. +** When aktualizr starts, it uses the provisioning key to register with the device gateway HTTPS API. ** The server registers the new device and returns a PKCS#12 archive containing the real credentials for the device. This archive contains the root CA certificate and client certificate. ** The device unpacks the archive into the paths that are specified in the `[storage]` section of the config. ** The device uses this private key and certificate for all further communication with the server. diff --git a/docs/debugging-tips.adoc b/docs/debugging-tips.adoc index cde69e2a2c..60e5504edc 100644 --- a/docs/debugging-tips.adoc +++ b/docs/debugging-tips.adoc @@ -2,11 +2,11 @@ == Running Aktualizr in development -The `sota_local.toml` configuration file sets the package manager to `PackageManagerFake`, which allows the installation process to be tested locally: +The `sota-local.toml` configuration file sets the package manager to `PackageManagerFake`, which allows the installation process to be tested locally: # From the build directory mkdir sota-prov - src/aktualizr_primary/aktualizr --config ../config/sota_local.toml + src/aktualizr_primary/aktualizr --config ../config/sota-local.toml For VS code, there is a `launch.json` provided in the `.vscode` directory. This assumes that the cmake build directory is `build`. diff --git a/docs/provisioning-methods-and-credentialszip.adoc b/docs/provisioning-methods-and-credentialszip.adoc index e6a008b263..26ce812aaa 100644 --- a/docs/provisioning-methods-and-credentialszip.adoc +++ b/docs/provisioning-methods-and-credentialszip.adoc @@ -51,7 +51,7 @@ The following items are relevant for this process: | Primary ECU Hardware ID | Automatically generated by Aktualizr |=================== -An example `.toml` configuration file can be found at link:../config/sota_autoprov.toml[]. This is what is used by the `aktualizr-auto-prov` recipe in meta-updater. +An example `.toml` configuration file can be found at link:../config/sota-shared-cred.toml[]. This is what is used by the `aktualizr-shared-cred-prov` recipe in meta-updater. == Configuration options for provisioning with device credentials diff --git a/src/aktualizr_info/aktualizr_info_config_test.cc b/src/aktualizr_info/aktualizr_info_config_test.cc index f800cf8657..09660acf75 100644 --- a/src/aktualizr_info/aktualizr_info_config_test.cc +++ b/src/aktualizr_info/aktualizr_info_config_test.cc @@ -11,7 +11,7 @@ TEST(aktualizr_info_config, config_initialized_values) { } TEST(aktualizr_info_config, config_toml_parsing) { - AktualizrInfoConfig conf("config/sota_autoprov.toml"); + AktualizrInfoConfig conf("config/sota-shared-cred.toml"); EXPECT_EQ(conf.storage.type, StorageType::kSqlite); EXPECT_EQ(conf.storage.sqldb_path.get(conf.storage.path), "/var/sota/sql.db"); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8c5a8b3fdc..b24ce3c61b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -163,7 +163,7 @@ set_tests_properties(test-help-with-nonexistent-options PROPERTIES PASS_REGULAR_EXPRESSION "aktualizr command line options") add_test(NAME test-secondary-config-with-nonexisting-dir - COMMAND aktualizr -c ${PROJECT_SOURCE_DIR}/config/sota_autoprov.toml + COMMAND aktualizr -c ${PROJECT_SOURCE_DIR}/config/sota-shared-cred.toml --tls-server fake --secondary-configs-dir nonexistingdir check) set_tests_properties(test-secondary-config-with-nonexisting-dir PROPERTIES PASS_REGULAR_EXPRESSION "\"nonexistingdir\": not a directory")