Cloudflare Tunnels - Discourse Setup が Hostname を認識しない (Port にアクセスできません)

cloudflared デーモンは正常に実行されており、多くのことに使用しています(つまり、トンネルはサーバーに正しくインストールされています)が、Discourse インスタンスのホスト名を認識させるために Discourse のセットアップ(./discourse-setup)で問題が発生しています。

  • インスタンスのホスト名として biohacking.forum を使用しています。
  • これは biohacking.forum の Cloudflare Tunnel 設定です。
  • サービスタイプを HTTPS に設定することも試しました。
  • Discourse は Ubuntu サーバーの LTS でセットアップしています。
  • 以下のコマンドをこの順序で実行しました。
  1. sudo mkdir /var/discourse
  2. sudo git clone GitHub - discourse/discourse_docker: A Docker image for Discourse /var/discourse
  3. cd /var/discourse
  4. sudo ./discourse-setup
  5. ホスト名を尋ねられるので、biohacking.forum と入力します。
  6. 次のメッセージが表示されます。
Hostname for your Discourse? [discourse.example.com]: biohacking.forum

Checking your domain name . . .
WARNING: Port 443 of computer does not appear to be accessible using hostname:  biohacking.forum.
WARNING: Connection to http://biohacking.forum (port 80) also fails.

This suggests that biohacking.forum resolves to some IP address that does not reach this
machine where you are installing discourse.

The first thing to do is confirm that biohacking.forum resolves to the IP address of this server.
You usually do this at the same place you purchased the domain.

If you are sure that the IP address resolves correctly, it could be a firewall issue.
A web search for "open ports YOUR CLOUD SERVICE" might help.

This tool is designed only for the most standard installations. If you cannot resolve
the issue above, you will need to edit containers/app.yml yourself and then type

./launcher rebuild app

このステップを機能させるにはどうすればよいですか?追加情報が必要な場合はお知らせください。ありがとうございます!

「A」レコードの前にグレーのクラウド(DNSのみ)はありますか? ./discourse-setup

標準のAレコードは使用しておらず、Cloudflare Tunnelを使用しています。以下は、サーバー(Cloudflare Tunnelを使用)で完全に機能するサービスとその関連設定の例です。

Ghost CMSがサービスです。
PORT: 8085:2368 (8085はホスト、2368はサービス)
HOSTNAME: joshuahabka.com
Cloudflare Tunnelの設定:

オレンジ色のCloudflareアイコンは、Cloudflare Tunnelを使用しているためオンになっていますが、Discourseでは通常のアクセスポートとして報告されるべきです。40以上のサービスを展開し、Webアクセス可能にしていますが、Discourseはエラーが発生した最初のサービスです。

追加情報が必要な場合はお知らせください。

Discourseの場合、ポートは次のようになると想定しています。
443:443 (ホスト:サービス) これが、上記のCloudflareトンネルを元々設定した理由です。

こんにちは @joshhabka さん :wave:
もしまだ見ていなければ、このトピックがお役に立つかもしれません。

「いいね!」 4

リリーさん、前述のガイドは私には機能しませんでした。Cloudflareトンネルの設定はhttp://localhost:80であると記載されているにもかかわらず、同じエラーが引き続き発生しています。

starserver@Starserver:/var/discourse$ sudo ./discourse-setup
Ports 80 and 443 are free for use
'samples/standalone.yml' -> 'containers/app.yml'
./discourse-setup: line 261: 4
scaling*                 2: syntax error in expression (error token is "scaling*                 2")

Hostname for your Discourse? [discourse.example.com]: biohacking.forum

Checking your domain name . . .
WARNING: Port 443 of computer does not appear to be accessible using hostname:  biohacking.forum.
WARNING: Connection to http://biohacking.forum (port 80) also fails.

This suggests that biohacking.forum resolves to some IP address that does not reach this
machine where you are installing discourse.

The first thing to do is confirm that biohacking.forum resolves to the IP address of this server.
You usually do this at the same place you purchased the domain.

If you are sure that the IP address resolves correctly, it could be a firewall issue.
A web search for "open ports YOUR CLOUD SERVICE" might help.

This tool is designed only for the most standard installations. If you cannot resolve
the issue above, you will need to edit containers/app.yml yourself and then type

./launcher rebuild app

「常にHTTPSを使用する」をオフにする

「すべてのスキーム「http」のリクエストを「https」にリダイレクトします。これは、ゾーンへのすべてのhttpリクエストに適用されます。」とすると、ポート80は成功しますが、443は成功しません。

HTTPSへのリダイレクトを有効にするページルールを有効にすると、80と443の両方が失敗しますが、それを使用しない場合、443は失敗し、80は成功します。

指示に従っていません。

discourse-setup は、yml ファイルを作成させるため以外には使用できません。

「いいね!」 1

ありがとうございます。ここで動けなくなりました。

FAILED
--------------------
Pups::ExecError: /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end' failed with return #<Process::Status: pid 134 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"tag"=>"precompile", "cmd"=>["/usr/local/bin/ruby -e 'if ENV[\"DISCOURSE_SMTP_ADDRESS\"] == \"smtp.example.com\"; puts \"Aborting! Mail is not configured!\"; exit 1; end'", "/usr/local/bin/ruby -e 'if ENV[\"DISCOURSE_HOSTNAME\"] == \"discourse.example.com\"; puts \"Aborting! Domain is not configured!\"; exit 1; end'", "/usr/local/bin/ruby -e 'if (ENV[\"DISCOURSE_CDN_URL\"] || \"\")[0..1] == \"//\"; puts \"Aborting! CDN must have a protocol specified. Once fixed you should rebake your posts now to correct all posts.\"; exit 1; end'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

ymlファイルを編集して、smtp認証情報を入力する必要があります

すべて完了し、現在は正常に動作しています。Cloudflare Tunnelのセルフインストールに関する注記として、SMTP、ホスト名、メールなどを追加するためにYAMLドキュメントを編集する必要があることを記載することをお勧めします。

ありがとうございます!

「いいね!」 1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.