diff --git a/.github/workflows/website-root.yml b/.github/workflows/website-root.yml deleted file mode 100644 index 17989accb7d..00000000000 --- a/.github/workflows/website-root.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Azure Static Web App Root - -on: - workflow_dispatch: - push: - branches: - - v1.12 - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - v1.12 - -concurrency: - # Cancel the previously triggered build for only PR build. - group: website-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - build_and_deploy_job: - name: Build Hugo Website - if: github.event.action != 'closed' - runs-on: ubuntu-latest - env: - SWA_BASE: 'proud-bay-0e9e0e81e' - HUGO_ENV: production - steps: - - name: Checkout docs repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2.5.0 - with: - hugo-version: 0.102.3 - extended: true - - name: Setup Docsy - run: | - cd daprdocs - git submodule update --init --recursive - sudo npm install -D --save autoprefixer - sudo npm install -D --save postcss-cli - - name: Build Hugo Website - run: | - cd daprdocs - git config --global --add safe.directory /github/workspace - if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then - STAGING_URL="https://${SWA_BASE}-${{github.event.number}}.westus2.azurestaticapps.net/" - fi - hugo ${STAGING_URL+-b "$STAGING_URL"} - - name: Deploy docs site - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }} - repo_token: ${{ secrets.GITHUB_TOKEN }} - action: "upload" - app_location: "daprdocs/public/" - api_location: "daprdocs/public/" - output_location: "" - skip_app_build: true - skip_deploy_on_missing_secrets: true - - name: Upload Hugo artifacts - uses: actions/upload-artifact@v3 - with: - name: hugo_build - path: ./daprdocs/public/ - if-no-files-found: error - - close_staging_site: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Close Pull Request Job - steps: - - name: Close Pull Request - id: closepullrequest - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }} - action: "close" - skip_deploy_on_missing_secrets: true - - algolia_index: - name: Index site for Algolia - if: github.event_name == 'push' - needs: ['build_and_deploy_job'] - runs-on: ubuntu-latest - env: - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_API_WRITE_KEY: ${{ secrets.ALGOLIA_API_WRITE_KEY }} - ALGOLIA_INDEX_NAME: daprdocs - steps: - - name: Checkout docs repo - uses: actions/checkout@v2 - with: - submodules: false - - name: Download Hugo artifacts - uses: actions/download-artifact@v3 - with: - name: hugo_build - path: site/ - - name: Install Python packages - run: | - pip install --upgrade bs4 - pip install --upgrade 'algoliasearch>=2.0,<3.0' - - name: Index site - run: python ./.github/scripts/algolia.py ./site diff --git a/README.md b/README.md index 98bc0a4c4ff..e99d95a2590 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ The following branches are currently maintained: | Branch | Website | Description | | ------------------------------------------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------ | -| [v1.12](https://github.com/dapr/docs) (primary) | https://docs.dapr.io | Latest Dapr release documentation. Typo fixes, clarifications, and most documentation goes here. | -| [v1.13](https://github.com/dapr/docs/tree/v1.13) (pre-release) | https://v1-13.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.13+ go here. | +| [v1.13](https://github.com/dapr/docs) (primary) | https://docs.dapr.io | Latest Dapr release documentation. Typo fixes, clarifications, and most documentation goes here. | +| [v1.14](https://github.com/dapr/docs/tree/v1.14) (pre-release) | https://v1-14.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.14+ go here. | For more information visit the [Dapr branch structure](https://docs.dapr.io/contributing/docs-contrib/contributing-docs/#branch-guidance) document. diff --git a/daprdocs/config.toml b/daprdocs/config.toml index bcc1eb945eb..fd8e19ae615 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -1,5 +1,5 @@ # Site Configuration -baseURL = "https://docs.dapr.io" +baseURL = "https://v1-12.docs.dapr.io" title = "Dapr Docs" theme = "docsy" disableFastRender = true @@ -183,17 +183,20 @@ github_subdir = "daprdocs" github_branch = "v1.12" # Versioning -version_menu = "v1.12 (latest)" +version_menu = "v1.12" version = "v1.12" -archived_version = false +archived_version = true url_latest_version = "https://docs.dapr.io" [[params.versions]] - version = "v1.13 (preview)" - url = "https://v1-13.docs.dapr.io" + version = "v1.14 (preview)" + url = "https://v1-14.docs.dapr.io" [[params.versions]] - version = "v1.12 (latest)" + version = "v1.13 (latest)" url = "#" +[[params.versions]] + version = "v1.12" + url = "https://v1-12.docs.dapr.io" [[params.versions]] version = "v1.11" url = "https://v1-11.docs.dapr.io" diff --git a/daprdocs/content/en/developing-applications/building-blocks/cryptography/howto-cryptography.md b/daprdocs/content/en/developing-applications/building-blocks/cryptography/howto-cryptography.md index 92f3a671072..ca9d027962d 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/cryptography/howto-cryptography.md +++ b/daprdocs/content/en/developing-applications/building-blocks/cryptography/howto-cryptography.md @@ -6,16 +6,16 @@ weight: 2000 description: "Learn how to encrypt and decrypt files" --- -Now that you've read about [Cryptography as a Dapr building block]({{< ref cryptography-overview.md >}}), let's walk through using the cryptography APIs with the SDKs. +Now that you've read about [Cryptography as a Dapr building block]({{< ref cryptography-overview.md >}}), let's walk through using the cryptography APIs with the SDKs. {{% alert title="Note" color="primary" %}} - Dapr cryptography is currently in alpha. +Dapr cryptography is currently in alpha. {{% /alert %}} ## Encrypt -{{< tabs "JavaScript" "Go" >}} +{{< tabs "JavaScript" "Go" ".NET" >}} {{% codetab %}} @@ -136,12 +136,32 @@ if err != nil { {{% /codetab %}} +{{% codetab %}} + + +Using the Dapr SDK in your project, with the gRPC APIs, you can encrypt data in a string or a byte array: + +```csharp +using var client = new DaprClientBuilder().Build(); + +const string componentName = "azurekeyvault"; //Change this to match your cryptography component +const string keyName = "myKey"; //Change this to match the name of the key in your cryptographic store + +const string plainText = "This is the value we're going to encrypt today"; + +//Encode the string to a UTF-8 byte array and encrypt it +var plainTextBytes = Encoding.UTF8.GetBytes(plainText); +var encryptedBytesResult = await client.EncryptAsync(componentName, plaintextBytes, keyName, new EncryptionOptions(KeyWrapAlgorithm.Rsa)); +``` + +{{% /codetab %}} + {{< /tabs >}} ## Decrypt -{{< tabs "JavaScript" "Go" >}} +{{< tabs "JavaScript" "Go" ".NET" >}} {{% codetab %}} @@ -186,6 +206,29 @@ out, err := sdkClient.Decrypt(context.Background(), rf, dapr.EncryptOptions{ {{% /codetab %}} +{{% codetab %}} + + +To decrypt a string, use the 'DecryptAsync' gRPC API in your project. + +In the following example, we'll take a byte array (such as from the example above) and decrypt it to a UTF-8 encoded string. + +```csharp +public async Task DecryptBytesAsync(byte[] encryptedBytes) +{ + using var client = new DaprClientBuilder().Build(); + + const string componentName = "azurekeyvault"; //Change this to match your cryptography component + const string keyName = "myKey"; //Change this to match the name of the key in your cryptographic store + + var decryptedBytes = await client.DecryptAsync(componentName, encryptedBytes, keyName); + var decryptedString = Encoding.UTF8.GetString(decryptedBytes.ToArray()); + return decryptedString; +} +``` + +{{% /codetab %}} + {{< /tabs >}} ## Next steps diff --git a/daprdocs/content/en/getting-started/get-started-api.md b/daprdocs/content/en/getting-started/get-started-api.md index 8fa005dca6c..a785812c4d2 100644 --- a/daprdocs/content/en/getting-started/get-started-api.md +++ b/daprdocs/content/en/getting-started/get-started-api.md @@ -3,10 +3,11 @@ type: docs title: "Use the Dapr API" linkTitle: "Use the Dapr API" weight: 30 -description: "Run a Dapr sidecar and try out the state API" +description: "Run a Dapr sidecar and try out the state management API" --- -In this guide, you'll simulate an application by running the sidecar and calling the API directly. After running Dapr using the Dapr CLI, you'll: +In this guide, you'll simulate an application by running the sidecar and calling the state management API directly. +After running Dapr using the Dapr CLI, you'll: - Save a state object. - Read/get the state object. @@ -21,7 +22,8 @@ In this guide, you'll simulate an application by running the sidecar and calling ### Step 1: Run the Dapr sidecar -The [`dapr run`]({{< ref dapr-run.md >}}) command launches an application, together with a sidecar. +The [`dapr run`]({{< ref dapr-run.md >}}) command normally runs your application and a Dapr sidecar. In this case, +it only runs the sidecar since you are interacting with the state management API directly. Launch a Dapr sidecar that will listen on port 3500 for a blank application named `myapp`: diff --git a/daprdocs/content/en/getting-started/install-dapr-cli.md b/daprdocs/content/en/getting-started/install-dapr-cli.md index df9b25d69d0..21f17968973 100644 --- a/daprdocs/content/en/getting-started/install-dapr-cli.md +++ b/daprdocs/content/en/getting-started/install-dapr-cli.md @@ -15,6 +15,11 @@ You'll use the Dapr CLI as the main tool for various Dapr-related tasks. You can The Dapr CLI works with both [self-hosted]({{< ref self-hosted >}}) and [Kubernetes]({{< ref Kubernetes >}}) environments. +{{% alert title="Before you begin" color="primary" %}} +In Docker Desktop's advanced options, verify you've allowed the default Docker socket to be used. + +{{% /alert %}} + ### Step 1: Install the Dapr CLI {{< tabs Linux Windows MacOS Binaries>}} diff --git a/daprdocs/content/en/getting-started/install-dapr-selfhost.md b/daprdocs/content/en/getting-started/install-dapr-selfhost.md index 6c27f4d5840..b3b61be3277 100644 --- a/daprdocs/content/en/getting-started/install-dapr-selfhost.md +++ b/daprdocs/content/en/getting-started/install-dapr-selfhost.md @@ -22,8 +22,12 @@ Dapr initialization includes: 1. Creating a **default components folder** with component definitions for the above. 1. Running a **Dapr placement service container instance** for local actor support. +{{% alert title="Kubernetes Development Environment" color="primary" %}} +To initialize Dapr in your local or remote **Kubernetes** cluster for development (including the Redis and Zipkin containers listed above), see [how to initialize Dapr for development on Kubernetes]({{}}) +{{% /alert %}} + {{% alert title="Docker" color="primary" %}} -The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{< ref self-hosted-no-docker.md >}})), the next steps in this guide assume the recommended Docker development environment. +The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{< ref self-hosted-no-docker.md >}}), the next steps in this guide assume the recommended Docker development environment. You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{< ref dapr-init.md >}}). {{% /alert %}} @@ -66,7 +70,7 @@ dapr init **If you are installing on Mac OS Silicon with Docker,** you may need to perform the following workaround to enable `dapr init` to talk to Docker without using Kubernetes. 1. Navigate to **Docker Desktop** > **Settings** > **Advanced**. -1. Select the **Enable default Docker socket** checkbox. +1. Select the **Allow the default Docker socket to be used (requires password)** checkbox. {{% /codetab %}} @@ -82,6 +86,7 @@ dapr init {{< /tabs >}} +[See the troubleshooting guide if you encounter any error messages regarding Docker not being installed or running.]({{< ref "common_issues.md#dapr-cant-connect-to-docker-when-installing-the-dapr-cli" >}}) ### Step 3: Verify Dapr version diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md index 5764b92b24f..8cde9af5a72 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md @@ -72,6 +72,51 @@ The `-k` flag initializes Dapr on the Kubernetes cluster in your current context dapr dashboard -k -n ``` + + #### Install Dapr from the offical Dapr Helm chart (with development flag) + +Adding the `--dev` flag initializes Dapr on the Kubernetes cluster on your current context, with the addition of Redis and Zipkin deployments. + +The steps are similar to [installing from the Dapr Helm chart](#install-dapr-from-an-official-dapr-helm-chart), except for appending the `--dev` flag to the `init` command: + + ```bash + dapr init -k --dev + ``` + +Expected output: + +```bash +⌛ Making the jump to hyperspace... +ℹ️ Note: To install Dapr using Helm, see here: https://docs.dapr.io/getting-started/install-dapr-kubernetes/#install-with-helm-advanced + +ℹ️ Container images will be pulled from Docker Hub +✅ Deploying the Dapr control plane with latest version to your cluster... +✅ Deploying the Dapr dashboard with latest version to your cluster... +✅ Deploying the Dapr Redis with latest version to your cluster... +✅ Deploying the Dapr Zipkin with latest version to your cluster... +ℹ️ Applying "statestore" component to Kubernetes "default" namespace. +ℹ️ Applying "pubsub" component to Kubernetes "default" namespace. +ℹ️ Applying "appconfig" zipkin configuration to Kubernetes "default" namespace. +✅ Success! Dapr has been installed to namespace dapr-system. To verify, run `dapr status -k' in your terminal. To get started, go here: https://aka.ms/dapr-getting-started + ``` + +After a short period of time (or using the `--wait` flag and specifying an amount of time to wait), you can check that the Redis and Zipkin components have been deployed to the cluster. + +```bash +kubectl get pods --namespace default +``` + +Expected output: + +```bash +NAME READY STATUS RESTARTS AGE +dapr-dev-zipkin-bfb4b45bb-sttz7 1/1 Running 0 159m +dapr-dev-redis-master-0 1/1 Running 0 159m +dapr-dev-redis-replicas-0 1/1 Running 0 159m +dapr-dev-redis-replicas-1 1/1 Running 0 159m +dapr-dev-redis-replicas-2 1/1 Running 0 158m + ``` + #### Install Dapr from a private Dapr Helm chart Installing Dapr from a private Helm chart can be helpful for when you: diff --git a/daprdocs/content/en/operations/security/api-token.md b/daprdocs/content/en/operations/security/api-token.md index aa30b39750e..2722f67a5fc 100644 --- a/daprdocs/content/en/operations/security/api-token.md +++ b/daprdocs/content/en/operations/security/api-token.md @@ -88,7 +88,11 @@ kubectl rollout restart deployment/ --namespace **Note:** The Dapr SDKs read the [DAPR_API_TOKEN]({{< ref environment >}}) environment variable and set it for you by default. + + ### HTTP diff --git a/daprdocs/content/en/operations/security/app-api-token.md b/daprdocs/content/en/operations/security/app-api-token.md index d94e325139f..9a9264ed267 100644 --- a/daprdocs/content/en/operations/security/app-api-token.md +++ b/daprdocs/content/en/operations/security/app-api-token.md @@ -89,11 +89,13 @@ kubectl rollout restart deployment/ --namespace ` in the calls to the app. From the app side, ensure you are authenticating using the `dapr-api-token` value which uses the `app-api-token` you set to authenticate requests from Dapr. + + ### HTTP -In case of HTTP, in your code look for the HTTP header `dapr-api-token` in incoming requests: +In your code, look for the HTTP header `dapr-api-token` in incoming requests: ```text dapr-api-token: diff --git a/daprdocs/content/en/operations/troubleshooting/common_issues.md b/daprdocs/content/en/operations/troubleshooting/common_issues.md index 346b680c68f..40281dd2fee 100644 --- a/daprdocs/content/en/operations/troubleshooting/common_issues.md +++ b/daprdocs/content/en/operations/troubleshooting/common_issues.md @@ -6,6 +6,24 @@ weight: 1000 description: "Common issues and problems faced when running Dapr applications" --- +This guide covers common issues you may encounter while installing and running Dapr. + +## Dapr can't connect to Docker when installing the Dapr CLI + +When installing and initializing the Dapr CLI, if you see the following error message after running `dapr init`: + +```bash +⌛ Making the jump to hyperspace... +❌ could not connect to docker. docker may not be installed or running +``` + +Troubleshoot the error by ensuring: + +1. [The correct containers are running.]({{< ref "install-dapr-selfhost.md#step-4-verify-containers-are-running" >}}) +1. In Docker Desktop, verify the **Allow the default Docker socket to be used (requires password)** option is selected. + + + ## I don't see the Dapr sidecar injected to my pod There could be several reasons to why a sidecar will not be injected into a pod. diff --git a/daprdocs/content/en/reference/cli/dapr-init.md b/daprdocs/content/en/reference/cli/dapr-init.md index 7cc2d86ad7d..b40af670116 100644 --- a/daprdocs/content/en/reference/cli/dapr-init.md +++ b/daprdocs/content/en/reference/cli/dapr-init.md @@ -162,6 +162,12 @@ dapr uninstall --all --network mynet dapr init -k ``` +Using the `--dev` flag initializes Dapr in dev mode, which includes Zipkin and Redis. +```bash +dapr init -k --dev +``` + + You can wait for the installation to complete its deployment with the `--wait` flag. The default timeout is 300s (5 min), but can be customized with the `--timeout` flag. diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md index 73b9cc00633..b833301b2ea 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-redis-pubsub.md @@ -43,8 +43,8 @@ The above example uses secrets as plain strings. It is recommended to use a secr | redisUsername | N | Username for Redis host. Defaults to empty. Make sure your redis server version is 6 or above, and have created acl rule correctly. | `""`, `"default"` | consumerID | N | The consumer group ID | `"myGroup"` | enableTLS | N | If the Redis instance supports TLS with public certificates, can be configured to be enabled or disabled. Defaults to `"false"` | `"true"`, `"false"` -| redeliverInterval | N | The interval between checking for pending messages to redelivery. Defaults to `"60s"`. `"0"` disables redelivery. | `"30s"` -| processingTimeout | N | The amount time a message must be pending before attempting to redeliver it. Defaults to `"15s"`. `"0"` disables redelivery. | `"30s"` +| redeliverInterval | N | The interval between checking for pending messages to redeliver. Can use either be Go duration string (for example "ms", "s", "m") or milliseconds number. Defaults to `"60s"`. `"0"` disables redelivery. | `"30s"`, `"5000"` +| processingTimeout | N | The amount time that a message must be pending before attempting to redeliver it. Can use either be Go duration string ( for example "ms", "s", "m") or milliseconds number. Defaults to `"15s"`. `"0"` disables redelivery. | `"60s"`, `"600000"` | queueDepth | N | The size of the message queue for processing. Defaults to `"100"`. | `"1000"` | concurrency | N | The number of concurrent workers that are processing messages. Defaults to `"10"`. | `"15"` | redisType | N | The type of redis. There are two valid values, one is `"node"` for single node mode, the other is `"cluster"` for redis cluster mode. Defaults to `"node"`. | `"cluster"` diff --git a/daprdocs/static/images/docker-desktop-setting.png b/daprdocs/static/images/docker-desktop-setting.png new file mode 100644 index 00000000000..1e5b6e54206 Binary files /dev/null and b/daprdocs/static/images/docker-desktop-setting.png differ diff --git a/daprdocs/static/images/tokens-auth.png b/daprdocs/static/images/tokens-auth.png new file mode 100644 index 00000000000..0eb566d7cfd Binary files /dev/null and b/daprdocs/static/images/tokens-auth.png differ diff --git a/daprdocs/static/presentations/dapr-slidedeck.pptx.zip b/daprdocs/static/presentations/dapr-slidedeck.pptx.zip index 6ef5a3b8720..27df424b293 100644 Binary files a/daprdocs/static/presentations/dapr-slidedeck.pptx.zip and b/daprdocs/static/presentations/dapr-slidedeck.pptx.zip differ