음, 제 서버가 중국에 있기 때문에 네트워크 문제인 것이 맞습니다.
해결 방법을 찾아서 여기 중국어로 복사했습니다.
중국 내 환경에서 Discourse 설치 在国内环境下安装Discourse - 主页 - 第 页 - IzIy's Files - MyPress - MyPre.Cn
Discourse의 버전 업그레이드 및 유지보수는 모두 GitHub를 기반으로 수행되며, Discourse 자체는 Ruby로 작성되어 있습니다.
Tencent Cloud의 CVM, 경량 서버 및 Alibaba Cloud의 ECS를 사용하는 경우 모두 해외 웹사이트 접속이 느린 문제가 있습니다. 이는 주로 국내 Git 저장소를 지원하기 위해 시행된 트래픽 제한 조치 때문입니다.
GitHub에 호스팅된 discourse를 클론할 때, GitHub.com을 github.com.cnpmjs.org로 대체하여 GitHub 접속을 가속화할 수 있습니다. 예를 들어:
git clone https://github.com/discourse/discourse_docker.git를 git clone https://github.com.cnpmjs.org/discourse/discourse_docker.git로 대체합니다.
또한, ./discourse-setup을 실행할 때 설치 프로그램은 Docker 내에서 몇 가지 추가 항목을 설치합니다.
예를 들어, gem update도 Ruby 미러를 추가해야 합니다.
설정 파일을 수정하여 Ruby 미러 주소를 추가할 수 있으며, 주로 관련되는 파일은 docker.git입니다.
또한, ./discourse-setup을 실행할 때 설치 프로그램은 Docker 내에서 몇 가지 추가 항목을 설치합니다.
예를 들어, gem update도 Ruby 미러를 추가해야 합니다.
설정 파일을 수정하여 Ruby 미러 주소를 추가할 수 있으며, 주로 관련되는 파일은
discourse/templates/web.template.yml
discourse/containers/app.yml
위 파일에서 gem update를 호출하는 부분 앞에 다음 미러 사이트 구성 문장을 추가하십시오:
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
gem update bundler
bundle의 경우 bundle config mirror.https://rubygems.org https://gems.ruby-china.com을 사용하여 미러 사이트를 추가할 수 있습니다.
주요 수정 사항은 다음과 같습니다:
diff --git a/templates/web.template.yml b/templates/web.template.yml
index 28fb22d..bb0010c 100644
--- a/templates/web.template.yml
+++ b/templates/web.template.yml
@@ -86,6 +86,9 @@ run:
cd: $home
hook: code
cmd:
+ - git remote -v
+ - git remote set-url origin https://github.com.cnpmjs.org/discourse/discourse.git
+ - gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
- git reset --hard
- git clean -f
- git remote set-branches --add origin master
@@ -145,6 +148,7 @@ run:
hook: web
cmd:
# ensure we are on latest bundler
+ - gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
- gem update bundler
- find $home ! -user discourse -exec chown discourse {} \+
@@ -152,6 +156,9 @@ run:
cd: $home
hook: bundle_exec
cmd:
+ - su discourse -c 'gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/'
+ - su discourse -c 'gem update bundler'
+ - su discourse -c 'bundle config mirror.https://rubygems.org https://gems.ruby-china.com'
- su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test developme
- exec:
...skipping...
이메일 설정 관련 문제
포럼에는 일반적으로 인증 코드, 로그인 메시지 또는 비밀번호 찾기, 메시지 알림 등 다양한 기능을 위해 이메일 서버가 필요합니다.
NetEase의 무료 기업 이메일(ym.163.com)은 이 요구 사항을 충족할 수 있으며, QQ 이메일의 SMTP 서비스를 활성화하는 것도 가능합니다. 물론 유료 이메일을 구매하는 것도 가능합니다.
NetEase 무료 기업 이메일은 기본적으로 SMTP 서비스가 활성화되어 있습니다. 다음은 app.yml 설정 예시입니다. Discourse는 SSL 연결 방식을 지원하지 않는 것 같으므로, 여기서는 SMTP 서비스를 직접 사용했습니다. start_tls 기능을 명시적으로 비활성화해야 한다는 점에 유의하십시오.
DISCOURSE_SMTP_ADDRESS: smtp.ym.163.com
DISCOURSE_SMTP_PORT: 25
DISCOURSE_SMTP_USER_NAME: mail@getblog.cn
DISCOURSE_SMTP_PASSWORD: "password"
DISCOURSE_SMTP_ENABLE_START_TLS: false # (선택 사항, 기본값 true)
DISCOURSE_SMTP_DOMAIN: getblog.cn # (일부 제공업체에서 필요)
또한, 웹사이트 관리자의 이메일은 DISCOURSE_SMTP_USER_NAME과 같으면 안 됩니다. 그렇지 않으면 가입 이메일을 받지 못할 수 있습니다.
Docker로 Discourse 포럼/BBS 시스템 설치 (Nginx)
만약 본토에 거주하고 있다면 미러 가속이 필요합니다. 설정 파일의 templates 블록을 찾아 국내 미러 templates/web.china.template.yml를 추가하십시오:
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/sshd.template.yml"
- "templates/web.template.yml"
- "templates/web.china.template.yml"