Amazon EC2 インスタンスに Wickr IO ウェブフックボットをデプロイする方法を教えてください。

所要時間3分
0

Amazon Elastic Compute Cloud (Amazon EC2) インスタンスに AWS Wickr IO ウェブフックボットをデプロイしたいと考えています。

解決策

Amazon EC2 Linux インスタンスで Wickr IO ウェブフックボットを設定するには、次の手順を実行します。

  1. Wickr 管理コンソールを開きます。次に、ボットユーザーを作成します。Wickr 管理コンソールを開くことができない場合は、Wickr ネットワーク管理者アカウントでボットユーザーを作成してください。
    注: デフォルトのパスワードポリシーでは、パスワードは 8 文字以上である必要があります。アカウント名のサフィックスに bot が含まれていることも確認してください。

  2. Amazon Linux 2023 インスタンスを起動してコンテナをデプロイします。

    $ sudo yum update -y
    $ sudo dnf install docker
    $ sudo systemctl enable docker
    $ sudo systemctl start docker
  3. /opt/WickRio フォルダを作成します。

    $ mkdir /opt
    $ cd /opt
    $ mkdir WickrIO
  4. Wickr IO クライアントコンテナをデプロイします。リクエストを受信するために、ポートマッピングを 8080 に指定します。このアクションは、自動的にコンテナのコマンドラインに入ります。

    $ sudo docker pull public.ecr.aws/x3s2s6k3/wickrio/bot-cloud:latest
    $ sudo docker run -v /opt/WickrIO:/opt/WickrIO -p 8080:8080 -ti public.ecr.aws/x3s2s6k3/wickrio/bot-cloud:latest
  5. 使用許諾契約に同意します。

  6. プロンプトで add と入力して新しいクライアントを追加してから、作成したユーザー名とパスワードを入力します。

    例:
    注: example-webhook-bot は自分のユーザー名に、example-password は自分のパスワードに置き換えてください。

    WARNING: Please make sure you include the -t -i (or -ti) option when starting
    the WickrIO docker container with the docker run command. This will allow you
    to attach and detach from the WickrIO console.
    Continue to see welcome message on startup? (default: yes):yes
    
    Enter command:add
    Enter the user name:example-webhook-bot
    Enter the password:example-password
    Creating user:example-webhook-bot"
    
    Begin registration with password.
    
    Begin register new user context.
    
    Successfully created user
    
    Successfully logged in as new user!
    
    Our work is done here, logging off!
    
    The autologin capability allows you to start a bot without having to enter the
    password, after the initial login.
    NOTE: The bot client's password is NOT saved to disk.
    
    Do you want to use autologin? (default: yes):yes
  7. wickrio-webhook-bot 統合を設定するには、次の手順を実行します。
    コンテナのマッピングと一致させるために、統合にはポート 8080 を使用してください。
    ウェブフックにレシーバーエンドポイントを指定するときは、Amazon EC2 インスタンスのパブリック IP アドレスを使用します。
    静的パブリック IP アドレスを持たせるために、エラスティック IP アドレスを Amazon EC2 インスタンスに関連付けます。

    例:
    注: example-wickrio-webhook-bot は、実際のボット統合に置き換えます。

    Enter the bot integration to use:example-wickrio-webhook-bot
    **********************************************************************
    Begin setup of wickrio-webhook-bot software for example-webhook-bot
    v16.20.2
    6.20.1
    npm notice
    npm notice New major version of npm available! 8.19.4 -> 10.5.0
    npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.5.0
    npm notice Run npm install -g npm@10.5.0 to update!
    npm notice
    Copying wickrio-webhook-bot from the NPM registry
    Searching NPM registry
    Searching NPM registry
    Searching NPM registry
    Searching NPM registry
    Searching NPM registry
    Installing example-wickrio-webhook-bot software
    Begin configuration of example-wickrio-webhook-bot software for example-webhook-bot
     Select a port for the bot HTTP server [8080]:8080
     Enter the frontend URL for your webhook receiver :exampl-webhook-bot-ip
    
    Integration files written to:
    /opt/WickrIO/clients/client-webhook-bot/integration/example-wickrio-webhook-bot
    
    End of setup of example-wickrio-webhook-bot software for example-webhook-bot
    **********************************************************************  
    Successfully added record to the database!
  8. クライアントのオーダーを確認してクライアントを起動するには、次の手順を実行します。
    使用可能なクライアントを表示するには、プロンプトで list コマンドを入力します。
    起動するクライアントを探します。インデックス番号 # を書き留めます。
    クライアントを起動するには、プロンプトで start [index #] と入力します。たとえば、インデックス番号が 0 の場合は、start 0 と入力します。
    start コマンドを入力したら、もう一度 list を入力して、クライアントのステータスが Running であることを確認します。

    例:

    Enter command:list
    Current list of clients:
    #  Name                Status  Integration          Version  Misc
    =======================================================================
    0  example-webhook-bot  Paused  wickrio-webhook-bot  unknown
    
    Enter command:start 0
    Preparing to start the client with the name example-webhook-bot
    Do you really want to start the client with the name client-webhook-bot:yes
    Enter password for this client:********
    
    Enter command:list
    Current list of clients:
    #  Name                Status   Integration          Version  Events  Misc
    ================================================================================
    0  example-webhook-bot  Running  wickrio-webhook-bot  unknown  1
  9. サービスポートをテストするには、http://example-ip-address:8080 に移動します。次の内容が表示されます。

    Cannot GET /

    注: 前のステップが失敗した場合は、Amazon EC2 インスタンスのセキュリティグループとネットワーク設定を確認してください。

  10. 通常の Wickr ユーザーを作成し、Wickr クライアントにログインします。

  11. ルームを作成し、ボットユーザー example-webhook-bot をモデレーターとして追加します。この値はメッセージングを許可するために必要です。

  12. チャットウィンドウにルームのリクエスト URL を表示するには、/show と入力します。

出力例:

http://example-ip-address/send/example-webhook-id
  1. テストメッセージをルームに送信するには、curl を使用します。ポート 8080 を指定していることを確認してください。

注: example-ip-address はお使いの IP アドレスに、example-webhook-id は前のステップで取得したウェブフック ID に置き換えてください。

curl http://example-ip-address:8080/send/example-webhook-id -d 'payload={"text": "hello world"}'

関連情報

設定 (Wickr IO のウェブサイト)

AWS公式
AWS公式更新しました 10ヶ月前
コメントはありません

関連するコンテンツ