From 0c837ef8c9a344a86cc04d965ccda7f36cd07d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=8E=E5=A3=B0?= Date: Tue, 15 Oct 2024 21:15:26 +0800 Subject: [PATCH] docs: update configurations --- docs/{kv.md => configurations.md} | 13 ++----------- docs/how-to-use.md | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 13 deletions(-) rename docs/{kv.md => configurations.md} (86%) diff --git a/docs/kv.md b/docs/configurations.md similarity index 86% rename from docs/kv.md rename to docs/configurations.md index c4ab17cb..8b75058e 100644 --- a/docs/kv.md +++ b/docs/configurations.md @@ -1,15 +1,6 @@ -# Workers KV +# Configurations -We use the Workers KV to store some configuration. - -## Create KV Namespace - -You need to create a KV Namepsace, and set it's id in the `.env` file: - -```dotenv -KV_LOCAL_ID=xxxx -KV_PROD_ID=xxxxx -``` +We use the KV to store some configuration. ## Webhooks Configuration diff --git a/docs/how-to-use.md b/docs/how-to-use.md index 41dc8c4f..a906ec99 100644 --- a/docs/how-to-use.md +++ b/docs/how-to-use.md @@ -52,6 +52,16 @@ https://worker.bot/github/app/opensumi-core set `secret` to the value you seted in -When create bot done, you can get the last two secrets you need: +When create bot done, you can get **App ID** and **private key**, +but you need to transform the format of private key to PKCS#8 format, you can use this command: -**App ID** and **private key**, and set it's value to . +```sh +// https://github.com/gr2m/cloudflare-worker-github-app-example/blob/main/worker.js + +// The private-key.pem file from GitHub needs to be transformed from the +// PKCS#1 format to PKCS#8, as the crypto APIs do not support PKCS#1: + +openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.pem -out private-key-pkcs8.pem +``` + +Then you can set the configuration in .