Skip to content

Commit

Permalink
fix doc (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
statefb authored May 29, 2024
1 parent 4ced922 commit df07eb7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 129 deletions.
69 changes: 4 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ cd bedrock-claude-chat
chmod +x bin.sh
./bin.sh
```

### Optional Parameters

You can now specify the following parameters during deployment to enhance security and customization:
Expand All @@ -74,7 +75,7 @@ You can now specify the following parameters during deployment to enhance securi
#### Example command with parameters:

```sh
./bin.sh --disable-self-register --ipv4-ranges "192.0.2.0/25,192.0.2.128/25" --ipv6-ranges "2001:db8:1:2::/64,2001:db8:1:3::/64" --allowed-signup-email-domains "example.com,anotherexample.com" --region "us-west-2
./bin.sh --disable-self-register --ipv4-ranges "192.0.2.0/25,192.0.2.128/25" --ipv6-ranges "2001:db8:1:2::/64,2001:db8:1:3::/64" --allowed-signup-email-domains "example.com,anotherexample.com" --region "us-west-2"
```

- After about 35 minutes, you will get the following output, which you can access from your browser
Expand All @@ -88,7 +89,7 @@ Frontend URL: https://xxxxxxxxx.cloudfront.net
The sign-up screen will appear as shown above, where you can register your email and log in.

> [!Important]
> This deployment method allows anyone with the URL to sign up if optional parameters are not configured. For production use, we strongly recommend adding IP address restrictions and disabling self-signup to mitigate security risks (Defining the allowed-signup-email-domains to allow only your emails from your comapny domain to be able to sing-up to restrict the users). For ip address restriction use both ipv4-ranges and ipv6-ranges and to disable self-signup use disable-self-register when executing `./bin`
> This deployment method allows anyone with the URL to sign up if optional parameters are not configured. For production use, we strongly recommend adding IP address restrictions and disabling self-signup to mitigate security risks (Defining the `allowed-signup-email-domains` to allow only your emails from your comapny domain to be able to sing-up to restrict the users). For ip address restriction use both `ipv4-ranges` and `ipv6-ranges` and to disable self-signup use `disable-self-register` when executing `./bin`.
## Architecture

Expand All @@ -107,51 +108,6 @@ It's an architecture built on AWS managed services, eliminating the need for inf

![](docs/imgs/arch.png)

## Features and Roadmap
<details>
<summary>Basic chat features</summary>
- [x] Authentication (Sign-up, Sign-in)
- [x] Creation, storage, and deletion of conversations
- [x] Copying of chatbot replies
- [x] Automatic subject suggestion for conversations
- [x] Syntax highlighting for code
- [x] Rendering of Markdown
- [x] Streaming Response
- [x] IP address restriction
- [x] Edit message & re-send
- [x] I18n
- [x] Model switch
</details>
<details>
<summary>Customized bot features</summary>
- [x] Customized bot creation
- [x] Customized bot sharing
- [x] Publish as stand-alone API
</details>
<details>
<summary>RAG features</summary>
- [x] Web (html)
- [x] Text data (txt, csv, markdown and etc)
- [x] PDF
- [x] Microsoft office files (pptx, docx, xlsx)
- [x] Youtube transcript
- [ ] Import from S3 bucket
- [ ] Import external existing Kendra / OpenSearch / KnowledgeBase
</details>
<details>
<summary>Admin features</summary>
- [x] Tracking usage fees per bot
- [x] List all published bot
</details>
## Deploy using CDK

Super-easy Deployment uses [AWS CodeBuild](https://aws.amazon.com/codebuild/) to perform deployment by CDK internally. This section describes the procedure for deploying directly with CDK.
Expand Down Expand Up @@ -276,24 +232,7 @@ This asset automatically detects the language using [i18next-browser-languageDet
### Disable self sign up

This sample has self sign up enabled by default. To disable self sign up, open [auth.ts](./cdk/lib/constructs/auth.ts) and switch `selfSignUpEnabled` as `false`, then re-deploy.
```ts
const userPool = new UserPool(this, "UserPool", {
passwordPolicy: {
requireUppercase: true,
requireSymbols: true,
requireDigits: true,
minLength: 8,
},
// Set to false
selfSignUpEnabled: false,
signInAliases: {
username: false,
email: true,
},
});
```
This sample has self sign up enabled by default. To disable self sign up, open [cdk.json](./cdk/cdk.json) and switch `selfSignUpEnabled` as `false`. If you configure [external identity provider](#external-identity-provider), the value will be ignored and automatically disabled.

### Restrict Domains for Sign-Up Email Addresses

Expand Down
82 changes: 18 additions & 64 deletions docs/README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ chmod +x bin.sh
./bin.sh
```

### オプションのパラメータ

デプロイ時に以下のパラメータを指定することで、セキュリティとカスタマイズを強化できるようになりました。

--disable-self-register: セルフ登録を無効にします(デフォルト: 有効)。このフラグを設定すると、Cognito 上で全てのユーザーを作成する必要があり、ユーザーが自分でアカウントを登録することはできなくなります。
--ipv4-ranges: 許可する IPv4 範囲のカンマ区切りリスト。(デフォルト: 全ての IPv4 アドレスを許可)
--ipv6-ranges: 許可する IPv6 範囲のカンマ区切りリスト。(デフォルト: 全ての IPv6 アドレスを許可)
--allowed-signup-email-domains: サインアップ時に許可するメールドメインのカンマ区切りリスト。(デフォルト: ドメイン制限なし)
--region: Bedrock が利用可能なリージョンを指定します。(デフォルト: us-east-1)

#### パラメータを指定したコマンド例:

```sh
./bin.sh --disable-self-register --ipv4-ranges "192.0.2.0/25,192.0.2.128/25" --ipv6-ranges "2001:db8:1:2::/64,2001:db8:1:3::/64" --allowed-signup-email-domains "example.com,anotherexample.com" --region "ap-northeast-1"
```

- 30 分ほど経過後、下記の出力が得られるのでブラウザからアクセスします

```
Expand All @@ -60,7 +76,7 @@ Frontend URL: https://xxxxxxxxx.cloudfront.net
上記のようなサインアップ画面が現れますので、E メールを登録・ログインしご利用ください。

> [!Important]
> このデプロイ方法では、URL を知っている誰でもサインアップできてしまいます。本番運用で使用する場合は、セキュリティリスクを軽減するために IP アドレス制限やセルフサインアップの無効化を強くお勧めします。設定方法は、IP アドレス制限の場合は[Deploy using CDK](#deploy-using-cdk)、セルフサインアップの無効化の場合は[セルフサインアップを無効化する](#セルフサインアップを無効化する)をご覧ください
> オプションのパラメータを設定しない場合、このデプロイ方法では URL を知っている誰でもサインアップできてしまいます。本番環境で使用する場合は、セキュリティリスクを軽減するためにIP アドレスの制限を追加し、セルフサインアップを無効にすることを強くお勧めします(`allowed-signup-email-domains` を定義して、会社のドメインからのメールアドレスのみがサインアップできるようにすることで、ユーザーを制限できます)。IP アドレスの制限には `ipv4-ranges``ipv6-ranges` の両方を使用し、`./bin` を実行する際に `disable-self-register` を使用してセルフサインアップを無効にしてください
## アーキテクチャ

Expand All @@ -79,51 +95,6 @@ AWS のマネージドサービスで構成した、インフラストラクチ

![](imgs/arch.png)

## 機能・ロードマップ

<details>
<summary>基本的なチャット機能</summary>

- [x] 認証 (サインアップ、サインイン)
- [x] 会話の作成、保存、削除
- [x] チャットボットの返答のコピー
- [x] 会話のための自動的なトピックの提案
- [x] コードの構文強調表示
- [x] Markdown の表示
- [x] ストリーミング応答
- [x] IP アドレスの制限
- [x] メッセージの編集と再送信
- [x] 国際化
- [x] モデルの切り替え
</details>

<details>
<summary>カスタマイズされたボットの機能</summary>

- [x] カスタマイズされたボットの作成
- [x] カスタマイズされたボットの共有
- [x] 独立した API として公開
</details>

<details>
<summary>RAG機能</summary>

- [x] Web (html)
- [x] テキストデータ (txt、csv、markdown など)
- [x] PDF
- [x] Microsoft Office ファイル (pptx、docx、xlsx)
- [x] YouTube の字幕
- [ ] S3 バケットからのインポート
- [ ] 既存の Kendra / OpenSearch / KnowledgeBase からのインポート
</details>

<details>
<summary>管理者機能</summary>

- [x] ボットごとの使用料の追跡
- [x] 公開されたボットの一覧表示
</details>

## Deploy using CDK

上記 Easy Deployment は[AWS CodeBuild](https://aws.amazon.com/jp/codebuild/)を利用し、内部で CDK によるデプロイを実行しています。ここでは直接 CDK によりデプロイする手順を記載します。
Expand Down Expand Up @@ -256,24 +227,7 @@ cli および CDK を利用されている場合、`cdk destroy`を実行して
### セルフサインアップを無効化する

このサンプルはデフォルトでセルフサインアップが有効化してあります。セルフサインアップを無効にするには、[auth.ts](./cdk/lib/constructs/auth.ts)を開き、`selfSignUpEnabled``false` に変更してから再デプロイしてください。

```ts
const userPool = new UserPool(this, "UserPool", {
passwordPolicy: {
requireUppercase: true,
requireSymbols: true,
requireDigits: true,
minLength: 8,
},
// Set to false
selfSignUpEnabled: false,
signInAliases: {
username: false,
email: true,
},
});
```
このサンプルはデフォルトでセルフサインアップが有効になっています。セルフサインアップを無効にするには、[cdk.json](../cdk/cdk.json) を開き、`selfSignUpEnabled``false` に切り替えてください。[外部のアイデンティティプロバイダー](#外部のアイデンティティプロバイダー)を設定している場合、この値は無視され、自動的に無効になります。

### 外部のアイデンティティプロバイダー

Expand Down

0 comments on commit df07eb7

Please sign in to comment.