デフォルトっぽいアプリが再ビルドされない

こんにちは、この ガイド を使って Linux マシンにデフォルトの Discourse をセットアップしました。非常にスムーズに進み、サイトも問題なく起動しました。

ユーザーが Facebook 経由で接続できるようにしようと思い、上記のリンクから参照されている Facebook の手順に従いました(もう一度リンクを貼ろうと思いましたが、新規ユーザーは投稿できるリンクが 2 つまで apparently のようです)。その結果、接続はうまくいきませんでしたが、サイト自体は引き続き稼働していました(Facebook でログインしようとした際のエラー内容は覚えていません)。

Facebook のドキュメントを確認している際に、HTTPS を有効にする必要があるという記述を見つけ、こちらのドキュメント に従って設定を進めました。./launcher rebuild app まで順調に進んだのですが、そこで PostgreSQL のエラーが発生しました。PostgreSQL の設定には何も手を加えていない(少なくとも私の記憶では)ので、驚きました。最初のエラーは以下の通りです:

INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

PostgreSQL サービスは停止させていませんが、service start postgres を実行すると「インストールされていない」というメッセージが出ました。つまり、私が慣れている方法とは異なる方法で自動的にインストールされているのでしょう。何か考えられるミスはありますか?よろしくお願いします。

私の container/app.yml は以下の通りです:

templates:
  - "templates/web.template.yml"
  - "templates/web.ssl.template.yml"
  - "templates/web.letsencrypt.ssl.template.yml"
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"

expose:
  - "80:80"   # http
  - "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.english"

  db_shared_buffers: "128MB"

env:
  LANG: en_US.UTF-8
  LETSENCRYPT_ACCOUNT_EMAIL: 'myotheremail@gmail.com'
  UNICORN_WORKERS: 2

  DISCOURSE_HOSTNAME: mysite.com

  DISCOURSE_DEVELOPER_EMAILS: 'myemail@gmail.com'

  DISCOURSE_SMTP_ADDRESS: smtp.gmail.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: myemail@gmail.com
  DISCOURSE_SMTP_PASSWORD: "myPa$$word"

  ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

run:
  - exec: echo "Beginning of custom commands"
  - exec: echo "End of custom commands"
「いいね!」 1

If you were following the official guide, HTTPS should have been set up automatically. Note at the very top of the guide you linked to:

「いいね!」 6

Yes, that’s correct. And those are the instructions I followed. I did move to the facebook login connect guide first, but I am doubtful that that’s the issue. I went through the guide that you posted, and moved on to https, and now I’m having the issues listed above.

Ok, let’s regroup for a moment.

These two guides are all you should need to follow:

This one you do not want to follow since HTTPS is enabled by default:

I would start fresh if possible and then report back any errors you receive when trying to log in with Facebook.

「いいね!」 3

Ok, well when I finished the first guide, the site was up, but it wasn’t https. I assumed it wouldn’t be https until I enabled it. I’ll go back through the instructions, maybe I didn’t understand something, then I’ll report back.

「いいね!」 2

Ok, I got the app back up, but I don’t see anywhere in these instructions that could possibly setup the site as https as there’s nowhere that involves a cert other than the Let’s Encrypt method at the bottom. What am I missing? Can you point me to where exactly in those instructions it would set up https?

「いいね!」 1

It’s all done behind the scenes. When you enter your email in the last configuration step:

「いいね!」 2

I bet I hit ENTER to skip and didn’t even realize it. If that’s the case, would it just be best to re-run the config, or go through the let’s encrypt instructions. Keeping in mind, I have a little bit of content on the site right now and I don’t want it wiped. (Thanks again for your help)

「いいね!」 3

Just run discourse-setup again and provide an address for let’s encrypt.

「いいね!」 6

What a fantastic feature. I feel so ridiculous for missing that the first time around. Thanks to both of you, and the team for implementing that.

「いいね!」 4

Is there some way to change the words that would have made you understood it sooner?

「いいね!」 3

I think so. I’m pretty experienced working on servers, but I haven’t been very active since Let’s Encrypt came out, so I just assumed that there would be a section on getting a cert in the documentation if that was something that would work out of the box. Since there wasn’t, I assumed I would have to do it in another step. There’s nothing on that page that evens mentions Let’s Encrypt except for the output from the ./disource-setup command. Maybe mention under the Edit Discourse Configuration (before the command) mention that if you want https, then you’ll have to put something in the Let’s Encrypt field. I knew to look on that page for https, but there were not https string matches (when I ctrl+f), so I assumed it wasn’t there. I searched for “https” and “cert”, and since it wasn’t there, I assumed it was separate.

And honestly, if I worked on website hosting more frequently, I probably would have seen Let’s Encrypt and immediately known what was going on. Maybe if there was a “what you’ll need” section, that included an email associated with Let’s Encrypt?

I don’t want this to come off as insulting, the documentation is great, and it was human error (my human error) that caused my issue.

「いいね!」 3

Fair enough. What words?

「いいね!」 1

I can’t tell if you couldn’t see the rest of my response, but maybe I’ll just put in a PR with the fixes I think would be good. But really just mentioning that the docs have certs handled would be good.

「いいね!」 3

Ah,! So the install cloud doc doesn’t make it clear? That sounds right.

I’ll have a look at the language at discourse-setup to see if it should make it clearer just what let’s encrypt is. It’s true that it shouldn’t assume that the user knows.

Thanks

「いいね!」 4