From 66eba0209a8777143b24fffce6d10e2150b4933b Mon Sep 17 00:00:00 2001 From: Bryan Wendlandt <74682355+bwendlandt-intel@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:53:38 -0700 Subject: [PATCH] docs: remove not needed OS tabbing (#335) * docs: remove not needed OS tabbing * docs: fix color and add admin warning * docs(reference): add -config to table --- docs/GetStarted/buildRPC.md | 4 +- .../Certificates/generateProvisioningCert.md | 11 +- docs/Reference/RPC/buildRPC_Manual.md | 2 + docs/Reference/RPC/commandsRPC.md | 120 +++++++----------- docs/Reference/architectureOverview.md | 24 +--- docs/Reference/middlewareExtensibility.md | 11 +- docs/Tutorials/apiTutorial.md | 65 +++------- docs/Tutorials/createWiFiConfig.md | 11 +- docs/Tutorials/modifyUserAuth.md | 52 +++----- 9 files changed, 101 insertions(+), 199 deletions(-) diff --git a/docs/GetStarted/buildRPC.md b/docs/GetStarted/buildRPC.md index 8f712f00b..380f73208 100644 --- a/docs/GetStarted/buildRPC.md +++ b/docs/GetStarted/buildRPC.md @@ -63,12 +63,14 @@ If you are building an executable on a development system, you will copy the exe 3. Confirm a successful build: + RPC must run with elevated privileges. Commands require `sudo` on Linux or an Administrator Command Prompt on Windows. + === "Linux" ``` bash sudo ./rpc version ``` === "Windows" - ``` bash + ``` .\rpc version ``` === "Docker (On Linux Host Only)" diff --git a/docs/Reference/Certificates/generateProvisioningCert.md b/docs/Reference/Certificates/generateProvisioningCert.md index 73d49f276..962b88e4b 100644 --- a/docs/Reference/Certificates/generateProvisioningCert.md +++ b/docs/Reference/Certificates/generateProvisioningCert.md @@ -198,14 +198,9 @@ First, we need to prepare two files: The new hash should be listed. - === "Linux" - ``` bash - sudo ./rpc amtinfo -cert - ``` - === "Windows" - ``` - .\rpc amtinfo -cert - ``` + ``` + rpc amtinfo -cert + ``` !!! success "Success - Hash Inserted Correctly"
diff --git a/docs/Reference/RPC/buildRPC_Manual.md b/docs/Reference/RPC/buildRPC_Manual.md index d97941e19..f6c44767e 100644 --- a/docs/Reference/RPC/buildRPC_Manual.md +++ b/docs/Reference/RPC/buildRPC_Manual.md @@ -56,6 +56,8 @@ Developed in Go* programming language, the Remote Provisioning Client (RPC) appl 2. Confirm a successful build: + RPC must run with elevated privileges. Commands require `sudo` on Linux or an Administrator Command Prompt on Windows. + === "Linux" ``` bash sudo ./rpc version diff --git a/docs/Reference/RPC/commandsRPC.md b/docs/Reference/RPC/commandsRPC.md index 76f765f3f..e674f253c 100644 --- a/docs/Reference/RPC/commandsRPC.md +++ b/docs/Reference/RPC/commandsRPC.md @@ -3,18 +3,14 @@ On the managed device, a Remote Provisioning Client (RPC) communicates with the Remote Provision Server (RPS) in the process of activating or deactivating the device. In addition to activation and deactivation, the RPC provides informational and maintenance commands. ## List Commands -On the managed device, open a Terminal (Linux) or Powershell/Command Prompt **as Administrator** (Windows). + +RPC must run with elevated privileges. Commands require `sudo` on Linux or an Administrator Command Prompt on Windows. Run the RPC application on the command line with no arguments to see supported commands: -=== "Linux" - ``` bash - sudo ./rpc - ``` -=== "Windows" - ``` - .\rpc.exe - ``` +``` +rpc +``` | COMMAND | DESCRIPTION | EXAMPLE | |-----------------------------|---------------------------------------------------------------------------------------------|--------------------------------------------------------------| @@ -29,14 +25,9 @@ Run the RPC application on the command line with no arguments to see supported c Run the application with a command to see available options for the command: -=== "Linux" - ``` bash - sudo ./rpc [COMMAND] - ``` -=== "Windows" - ``` - .\rpc [COMMAND] - ``` +``` +rpc [COMMAND] +``` ### activate @@ -44,14 +35,9 @@ Run the application with a command to see available options for the command: Activate the device with a specified profile: -=== "Linux" - ``` bash - sudo ./rpc activate -u wss://server/activate -profile profilename - ``` -=== "Windows" - ``` - .\rpc activate -u wss://server/activate -profile profilename - ``` +``` +rpc activate -u wss://server/activate -profile profilename +``` #### Activate the device locally: @@ -59,12 +45,27 @@ This capability is only supported for activating unprovisioned (e.g. pre-provisi === "CCM" ``` - rpc activate -local -ccm -amtPassword NewAMTPassword + rpc activate -local -ccm -password NewAMTPassword ``` === "ACM" ``` rpc activate -local -acm -amtPassword NewAMTPassword -provisioningCert "{BASE64_PROV_CERT}" -provivisioningCertPwd certPassword ``` +=== "ACM w/ Config File" + Options can be passed via a config file. This can also be combined into a single config file with [addwifisettings](#addwifisettings) information. + + === "YAML" + ```yaml title="config.yaml" + acmactivate: + amtPassword: 'P@ssw0rd' + provisioningCert: 'BASE64_PROV_CERT' + provivisioningCertPwd: 'CertP@ssw0rd' + ``` + + Example Command + ``` + rpc activate -local -acm -config config.yaml + ```
@@ -102,6 +103,7 @@ This capability is only supported for activating unprovisioned (e.g. pre-provisi | -acm | Flag for ACM Local Activation. | | -amtPassword string | New AMT Password to set on device. | | -ccm | Flag for CCM Local Activation. | +| -config | File path of a `.yaml` file with desired ACM configuration. | | -local | Execute command to AMT directly without cloud interaction. | | -provisioningCert Base64 string | Base64 Encoded String of the `.pfx` provisioning certificate. | | -provisioningCertPwd string | Password of provisioning certificate. | @@ -194,14 +196,9 @@ Execute a maintenance command for the managed device: Change the AMT password. A random password is generated by default if `static` option is not passed. -=== "Linux" - ``` bash - sudo ./rpc maintenance changepassword -u wss://server/maintenance - ``` -=== "Windows" - ``` - .\rpc maintenance changepassword -u wss://server/maintenance - ``` +``` +rpc maintenance changepassword -u wss://server/maintenance +``` | OPTION | DESCRIPTION | |---------|-------------------------| @@ -213,14 +210,9 @@ Change the AMT password. A random password is generated by default if `static` o Syncs the host OS clock to AMT. -=== "Linux" - ``` bash - sudo ./rpc maintenance syncclock -u wss://server/maintenance - ``` -=== "Windows" - ``` - .\rpc maintenance syncclock -u wss://server/maintenance - ``` +``` +rpc maintenance syncclock -u wss://server/maintenance +```
@@ -228,14 +220,9 @@ Syncs the host OS clock to AMT. Sync the OS hostname to AMT Network Settings. -=== "Linux" - ``` bash - sudo ./rpc maintenance synchostname -u wss://server/maintenance - ``` -=== "Windows" - ``` - .\rpc maintenance synchostname -u wss://server/maintenance - ``` +``` +rpc maintenance synchostname -u wss://server/maintenance +```
@@ -243,14 +230,9 @@ Sync the OS hostname to AMT Network Settings. Sync the static IP of host OS to AMT Network Settings. -=== "Linux" - ``` - sudo ./rpc maintenance syncip -staticip 192.168.1.7 -netmask 255.255.255.0 -gateway 192.168.1.1 -primarydns 8.8.8.8 -secondarydns 4.4.4.4 -u wss://server/maintenance - ``` -=== "Windows" - ``` - .\rpc maintenance syncip -staticip 192.168.1.7 -netmask 255.255.255.0 -gateway 192.168.1.1 -primarydns 8.8.8.8 -secondarydns 4.4.4.4 -u wss://server/maintenance - ``` +``` +rpc maintenance syncip -staticip 192.168.1.7 -netmask 255.255.255.0 -gateway 192.168.1.1 -primarydns 8.8.8.8 -secondarydns 4.4.4.4 -u wss://server/maintenance +``` | OPTION | DESCRIPTION | |---------------|---------------------------------------------------------------------------------------------------------------------| @@ -543,14 +525,9 @@ On failure, the `addwifisettings` maintenance command will rollback any certific Display AMT status and configuration: -=== "Linux" - ``` bash - sudo ./rpc amtinfo [OPTIONS] - ``` -=== "Windows" - ``` - .\rpc amtinfo [OPTIONS] - ``` +``` +rpc amtinfo [OPTIONS] +``` **Not passing `[OPTIONS]` will print all information.** @@ -589,11 +566,6 @@ see [Wireless Activation](../../Tutorials/createWiFiConfig.md). Display the current version of RPC and the RPC Protocol version: -=== "Linux" - ``` bash - sudo ./rpc version - ``` -=== "Windows" - ``` - .\rpc version - ``` +``` +rpc version +``` diff --git a/docs/Reference/architectureOverview.md b/docs/Reference/architectureOverview.md index 299b5c6ec..9c5250996 100644 --- a/docs/Reference/architectureOverview.md +++ b/docs/Reference/architectureOverview.md @@ -116,27 +116,15 @@ Each microservice has an associated log file which can contain helpful debug inf 1. Open a Terminal or Powershell/Command Prompt and run the command to list the containers: - === "Linux" - ``` - sudo docker ps - ``` - - === "Windows (Powershell)" - ``` - docker ps - ``` +``` +docker ps +``` 2. Copy the first three digits of the container ID of interest. Run the docker logs command followed by the container ID: - === "Linux" - ``` - sudo docker logs - ``` - - === "Windows (Powershell)" - ``` - docker logs - ``` +``` +docker logs +``` See more help options for the `docker logs` command in [Docker Documentation](https://docs.docker.com/engine/reference/commandline/logs/). diff --git a/docs/Reference/middlewareExtensibility.md b/docs/Reference/middlewareExtensibility.md index 4ab47cc2f..99fed1ea5 100644 --- a/docs/Reference/middlewareExtensibility.md +++ b/docs/Reference/middlewareExtensibility.md @@ -61,13 +61,8 @@ After implementing the multitenancy code changes and starting the services, prof Then when activating and configuring the AMT device using RPC, provide the `-tenant` flag with the `tenantID` of the profile. [Find all RPC flags in the RPC CLI docs](./RPC/commandsRPC.md). See example command below. -=== "Linux" - ``` bash - sudo ./rpc activate -u wss://server/activate -n -profile profilename -tenant profileTenantID - ``` -=== "Windows" - ``` - .\rpc activate -u wss://server/activate -n -profile profilename -tenant profileTenantID - ``` +``` +rpc activate -u wss://server/activate -n -profile profilename -tenant profileTenantID +```
\ No newline at end of file diff --git a/docs/Tutorials/apiTutorial.md b/docs/Tutorials/apiTutorial.md index abbc5610b..1d6e4f3c9 100644 --- a/docs/Tutorials/apiTutorial.md +++ b/docs/Tutorials/apiTutorial.md @@ -47,18 +47,11 @@ See the [Authorize Method in the API Documentation](https://app.swaggerhub.com/a 2. Copy and paste the example code below into a text editor. 3. Update the values of the `[IP-Address or FQDN]`, `[MPS_WEB_ADMIN_USER]`, and `[MPS_WEB_ADMIN_PASSWORD]` fields. - === "Linux" - ```bash - curl --insecure -X POST https://[IP-Address or FQDN]/mps/login/api/v1/authorize \ - -H "Content-Type:application/json" \ - -d "{\"username\":\"[MPS_WEB_ADMIN_USER]\", \"password\":\" [MPS_WEB_ADMIN_PASSWORD]\"}" - ``` - === "Windows" - ```bash - curl --insecure -X POST https://[IP-Address or FQDN]/mps/login/api/v1/authorize ^ - -H "Content-Type:application/json" ^ - -d "{\"username\":\"[MPS_WEB_ADMIN_USER]\", \"password\":\" [MPS_WEB_ADMIN_PASSWORD]\"}" - ``` + ```bash + curl --insecure -X POST https://[IP-Address or FQDN]/mps/login/api/v1/authorize \ + -H "Content-Type:application/json" \ + -d "{\"username\":\"[MPS_WEB_ADMIN_USER]\", \"password\":\" [MPS_WEB_ADMIN_PASSWORD]\"}" + ``` !!!info "Info - Using the --insecure Flag" Because we are using self-signed certificates for MPS for development and testing purposes, we must supply this flag to bypass SSL certificate verification. @@ -81,16 +74,10 @@ See the [GetDevices Method in the API Documentation](https://app.swaggerhub.com/ 2. Copy and paste the example code below into a text editor. 3. Update the values of the `[IP-Address or FQDN]` and `[JWT-Token]` fields. - === "Linux" - ```bash - curl --insecure https://[IP-Address or FQDN]/mps/api/v1/devices \ - -H "Authorization: Bearer [JWT-Token]" - ``` - === "Windows" - ```bash - curl --insecure https://[IP-Address or FQDN]/mps/api/v1/devices ^ - -H "Authorization: Bearer [JWT-Token]" - ``` + ```bash + curl --insecure https://[IP-Address or FQDN]/mps/api/v1/devices \ + -H "Authorization: Bearer [JWT-Token]" + ``` 4. Run the command. @@ -125,32 +112,18 @@ See the [GetDevices Method in the API Documentation](https://app.swaggerhub.com/ The sample GET and POST curl commands below can be adapted for other MPS and RPS methods **by changing the URL path and modifying the request body data, if applicable**. === "Power Capabilities (GET Template)" - === "Linux" - ``` bash - curl --insecure https://[IP-Address or FQDN]/mps/api/v1/amt/powercapabilities/[AMT-Device-GUID] \ - -H "Authorization: Bearer [JWT-Token]" - ``` - === "Windows" - ``` bash - curl --insecure https://[IP-Address or FQDN]/mps/api/v1/amt/powercapabilities/[AMT-Device-GUID] ^ - -H "Authorization: Bearer [JWT-Token]" - ``` + ``` bash + curl --insecure https://[IP-Address or FQDN]/mps/api/v1/amt/powercapabilities/[AMT-Device-GUID] \ + -H "Authorization: Bearer [JWT-Token]" + ``` See [Power Capabilities API Docs](https://app.swaggerhub.com/apis-docs/rbheopenamt/mps/{{ repoVersion.mpsAPI }}#/AMT/get_api_v1_amt_power_capabilities__guid_) for more information and expected responses. === "Power Action (POST Template)" - === "Linux" - ``` bash - curl --insecure -X POST https://[IP-Address or FQDN]/mps/api/v1/amt/power/action/[AMT-Device-GUID] \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer [JWT-Token]" \ - -d "{\"action\": [Power-Action], \"useSOL\": false}" - ``` - === "Windows" - ``` bash - curl --insecure -X POST https://[IP-Address or FQDN]/mps/api/v1/amt/power/action/[AMT-Device-GUID] ^ - -H "Content-Type: application/json" ^ - -H "Authorization: Bearer [JWT-Token]" ^ - -d "{\"action\": [Power-Action], \"useSOL\": false}" - ``` + ``` bash + curl --insecure -X POST https://[IP-Address or FQDN]/mps/api/v1/amt/power/action/[AMT-Device-GUID] \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer [JWT-Token]" \ + -d "{\"action\": [Power-Action], \"useSOL\": false}" + ``` See [Power Action API Docs](https://app.swaggerhub.com/apis-docs/rbheopenamt/mps/{{ repoVersion.mpsAPI }}#/AMT/post_api_v1_amt_power_action__guid_) for more information and expected responses. ## Other Methods diff --git a/docs/Tutorials/createWiFiConfig.md b/docs/Tutorials/createWiFiConfig.md index 9f0cd64d8..8bcdb2377 100644 --- a/docs/Tutorials/createWiFiConfig.md +++ b/docs/Tutorials/createWiFiConfig.md @@ -16,14 +16,9 @@ Use RPC's `amtinfo` feature to determine if your current device supports wireles 1. Run RPC with the `amtinfo` argument. - === "Linux" - ``` bash - sudo ./rpc amtinfo - ``` - === "Windows" - ``` - .\rpc amtinfo - ``` +``` +rpc amtinfo +``` 2. Look at the output for the LAN Interface section as highlighted below. **If RPC does NOT return a section for wireless**, the AMT device does not support wireless functionality. diff --git a/docs/Tutorials/modifyUserAuth.md b/docs/Tutorials/modifyUserAuth.md index 150b8a207..9f8f35bee 100644 --- a/docs/Tutorials/modifyUserAuth.md +++ b/docs/Tutorials/modifyUserAuth.md @@ -104,25 +104,15 @@ Install and start a local LDAP server on the development system. For this tutori 1. Open a Terminal or Powershell/Command Prompt and run the command to list the containers: - === "Linux" - ``` - sudo docker ps - ``` - === "Windows (Powershell)" - ``` - docker ps - ``` +``` +docker ps +``` 2. Restart the Kong container: - === "Linux" - ``` - sudo docker restart - ``` - === "Windows (Powershell)" - ``` - docker restart - ``` +``` +docker restart +``` ## Test the Configuration @@ -134,28 +124,18 @@ Authenticate a user to test the configuration by using an API of your choice. Yo In the following examples, we use the base64 encoding of `johndoe:TestAppPw1` as our encoded `user:pass`. This value is `am9obmRvZTpUZXN0QXBwUHcx`. These credentials are one of the default credentials in the `sample-simple.cfg` file provided by GLAuth*. === "Get Devices (MPS Route)" - === "Linux" - ``` bash - curl --insecure https://[IP-Address or FQDN]/mps/api/v1/devices \ - -H "Authorization: ldap am9obmRvZTpUZXN0QXBwUHcx" - ``` - === "Windows" - ``` bash - curl --insecure https://[IP-Address or FQDN]/mps/api/v1/devices ^ - -H "Authorization: ldap am9obmRvZTpUZXN0QXBwUHcx" - ``` + + ``` bash + curl --insecure https://[IP-Address or FQDN]/mps/api/v1/devices \ + -H "Authorization: ldap am9obmRvZTpUZXN0QXBwUHcx" + ``` See [Devices API Docs](https://app.swaggerhub.com/apis-docs/rbheopenamt/mps/{{ repoVersion.mpsAPI }}#/Devices/get_api_v1_devices) for more information and expected responses. === "Get Profiles (RPS Route)" - === "Linux" - ``` bash - curl --insecure https://[IP-Address or FQDN]/rps/api/v1/admin/profiles \ - -H "Authorization: ldap am9obmRvZTpUZXN0QXBwUHcx" - ``` - === "Windows" - ``` bash - curl --insecure https://[IP-Address or FQDN]/rps/api/v1/admin/profiles ^ - -H "Authorization: ldap am9obmRvZTpUZXN0QXBwUHcx" - ``` + + ``` bash + curl --insecure https://[IP-Address or FQDN]/rps/api/v1/admin/profiles \ + -H "Authorization: ldap am9obmRvZTpUZXN0QXBwUHcx" + ``` See [Get Profiles API Docs](https://app.swaggerhub.com/apis-docs/rbheopenamt/rps/{{ repoVersion.rpsAPI }}#/Profiles/GetAllProfiles) for more information and expected responses.