R2/S3 Buckets から辞書をインポートする方法
クラウド ストレージを設定し、R2 または S3 互換バケットから辞書をインポートするためのステップバイステップ ガイド。
必要なもの:
- Cloudflare R2 アカウント (推奨) または S3 互換のストレージ プロバイダー
- MDict 辞書ファイル (.mdx およびオプションの .mdd ファイル) がバケットにアップロードされました
- API 認証情報 (アクセス キー ID および秘密アクセス キー)
ステップ 1: Cloudflare R2 のセットアップ
1.1 R2 Bucket を作成する
- Log in to your Cloudflare dashboard
- Navigate to R2 from the left sidebar
- Click Create bucket
- Enter a name for your bucket (e.g.,
my-dictionaries) - お好みのロケーションを選択してください(パフォーマンス向上のため、お近くの場所を選択)
- Click Create bucket
1.2 辞書ファイルのアップロード
- 新しく作成したバケットを開きます
- Click Upload
- 辞書ファイル(.mdxファイルとその関連.mddリソースファイル)をアップロードしてください
- Make sure related files share the same base name (e.g.,
Oxford.mdx,Oxford.mdd)
1.3 パブリックアクセスを有効化(必須)
- In your bucket settings, find the Public Access section
- Click Connect Domain or Allow Access
- 次のいずれかを行うことができます。
- Use R2's default public URL (e.g.,
https://pub-xxxxx.r2.dev) - URL をクリーンにするために所有するカスタム ドメインを接続します
- Use R2's default public URL (e.g.,
- Copy the Public Bucket URL - you'll need this later
1.4 API Token の生成
- Go back to the R2 overview page
- Click Manage R2 API Tokens
- Click Create API Token
- トークンを設定:
- Token name: e.g., "WordHub Dictionary Access"
- Permissions: Select
Object Read(read-only is sufficient) - TTL: Choose "Forever" or set an expiration date
- (オプション)セキュリティ向上のため特定のバケットに制限
- Click Create API Token
- Important: Copy and save these credentials immediately (they won't be shown again):
- アクセスキー ID
- シークレットアクセスキー
- Endpoint URL (usually
https://<account-id>.r2.cloudflarestorage.com)
ステップ 2: 他の S3 互換プロバイダーの使用
WordHub は、AWS S3、MinIO、Backblaze B2、DigitalOcean Spaces などの他の S3 互換ストレージ サービスもサポートしています。セットアップ プロセスは次のように似ています。
プロバイダーのコンソールでバケットを作成する
辞書ファイルをバケットにアップロードしてください
パブリック読み取りアクセスを有効にするか、適切な権限を構成します
アクセス資格情報を生成します (アクセス キー ID と秘密アクセス キー)
バケットのパブリック URL とエンドポイント URL をメモします。
ステップ 3: WordHub での辞書のインポート
3.1 インポートプロセスを開始
- Go to the Dictionary Import Center
- Click Start Dictionary Import
- Select Bucket URL (not Local Files)
3.2 資格情報を入力する
- Bucket URL: Paste your bucket's public URL (e.g.,
https://pub-xxxxx.r2.dev) - Access Key ID: Paste the Access Key ID from Step 1.4
- Secret Access Key: Paste the Secret Access Key from Step 1.4
- Region: For Cloudflare R2, select
Auto. For other providers, select the appropriate region. - Endpoint (Optional): If using a custom endpoint, enter it here (e.g., for Cloudflare R2:
https://<account-id>.r2.cloudflarestorage.com)
3.3 テストと検出
- Click Test Connection to verify your credentials
- If the connection is successful, click Discover Files
- WordHub はバケットとグループの辞書ファイルを自動的にスキャンします
- 検出された辞書を確認し、インポートするものを選択してください
- Click Import Selected Dictionaries to begin the import
トラブルシューティング
「接続に失敗しました」または「アクセスが拒否されました」
- アクセス キー ID とシークレット アクセス キーが正しいことを確認してください
- バケットのパブリック読み取りアクセスが有効になっていることを確認してください
- API トークンに正しい権限 (少なくともオブジェクト読み取り) があることを確認してください。
- バケット URL が API エンドポイントではなく、パブリック URL であることを確認してください。
「辞書ファイルが見つかりません」
- バケット内に.mdxファイルが存在することを確認してください
- ファイルがルートレベルまたはバケット直下にあることを確認してください(深くネストされたフォルダー内にないこと)
- Verify file names follow the correct naming convention (e.g.,
Dictionary.mdx,Dictionary.mdd)
「地域/Endpoint の問題」
- Cloudflare R2 の場合は、「自動」領域を使用し、必要に応じてエンドポイントを指定します
- AWS S3 については、バケットが配置されている正しいリージョンを選択してください
- 他のプロバイダーの場合は、正しいエンドポイント URL とリージョン設定について、そのプロバイダーのドキュメントを参照してください。
セキュリティのベストプラクティス
Use read-only permissions: Grant only Object Read access to your API tokens to prevent unauthorized modifications.
Restrict token scope: Limit API tokens to specific buckets rather than giving account-wide access.
Set token expiration: Consider setting an expiration date for your API tokens and rotate them regularly.
Keep credentials private: Never share your Access Key ID and Secret Access Key publicly.
辞書をインポートする準備はできましたか?
インポートセンターに移動