インポートセンターに戻る

R2/S3 Buckets から辞書をインポートする方法

クラウド ストレージを設定し、R2 または S3 互換バケットから辞書をインポートするためのステップバイステップ ガイド。

必要なもの:

  • Cloudflare R2 アカウント (推奨) または S3 互換のストレージ プロバイダー
  • MDict 辞書ファイル (.mdx およびオプションの .mdd ファイル) がバケットにアップロードされました
  • API 認証情報 (アクセス キー ID および秘密アクセス キー)

ステップ 1: Cloudflare R2 のセットアップ

1.1 R2 Bucket を作成する

  1. Log in to your Cloudflare dashboard
  2. Navigate to R2 from the left sidebar
  3. Click Create bucket
  4. Enter a name for your bucket (e.g., my-dictionaries)
  5. お好みのロケーションを選択してください(パフォーマンス向上のため、お近くの場所を選択)
  6. Click Create bucket

1.2 辞書ファイルのアップロード

  1. 新しく作成したバケットを開きます
  2. Click Upload
  3. 辞書ファイル(.mdxファイルとその関連.mddリソースファイル)をアップロードしてください
  4. Make sure related files share the same base name (e.g., Oxford.mdx, Oxford.mdd)

1.3 パブリックアクセスを有効化(必須)

  1. In your bucket settings, find the Public Access section
  2. Click Connect Domain or Allow Access
  3. 次のいずれかを行うことができます。
    • Use R2's default public URL (e.g., https://pub-xxxxx.r2.dev)
    • URL をクリーンにするために所有するカスタム ドメインを接続します
  4. Copy the Public Bucket URL - you'll need this later

1.4 API Token の生成

  1. Go back to the R2 overview page
  2. Click Manage R2 API Tokens
  3. Click Create API Token
  4. トークンを設定:
    • Token name: e.g., "WordHub Dictionary Access"
    • Permissions: Select Object Read (read-only is sufficient)
    • TTL: Choose "Forever" or set an expiration date
    • (オプション)セキュリティ向上のため特定のバケットに制限
  5. Click Create API Token
  6. 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 インポートプロセスを開始

  1. Go to the Dictionary Import Center
  2. Click Start Dictionary Import
  3. Select Bucket URL (not Local Files)

3.2 資格情報を入力する

  1. Bucket URL: Paste your bucket's public URL (e.g., https://pub-xxxxx.r2.dev)
  2. Access Key ID: Paste the Access Key ID from Step 1.4
  3. Secret Access Key: Paste the Secret Access Key from Step 1.4
  4. Region: For Cloudflare R2, select Auto. For other providers, select the appropriate region.
  5. Endpoint (Optional): If using a custom endpoint, enter it here (e.g., for Cloudflare R2: https://<account-id>.r2.cloudflarestorage.com)

3.3 テストと検出

  1. Click Test Connection to verify your credentials
  2. If the connection is successful, click Discover Files
  3. WordHub はバケットとグループの辞書ファイルを自動的にスキャンします
  4. 検出された辞書を確認し、インポートするものを選択してください
  5. 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.

辞書をインポートする準備はできましたか?

インポートセンターに移動