mholt
(Matt)
12월 29, 2020, 7:49오후
1
새로운 DigitalOcean 드롭렛으로 이전하는 중이며 마켓플레이스 이미지를 사용해 보았습니다. 설정 스크립트를 실행하면 도메인 이름이 여전히 프로덕션의 현재 인스턴스를 가리키고 있기 때문에 초기 단계에서 실패합니다.
이 새 설치 환경을 실행 상태로 만들어 백업을 복원한 후 DNS 레코드를 업데이트해야 합니다.
에러 메시지는 다음과 같습니다:
Checking your domain name . . .
WARNING: Port 443 of computer does not appear to be accessible using hostname: x
WARNING: Connection to x (port 80) also fails.
This suggests that x resolves to some IP address that does not reach this
machine where you are installing discourse.
The first thing to do is confirm that x 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.
실제로 도메인 이름은 80번 포트와 443번 포트에서 응답하고 있으므로, 이 에러 메시지도 잘못된 것으로 보입니다.
jomaxro
(Joshua Rosenfeld)
12월 29, 2020, 8:36오후
2
매트, 안녕하세요.
우리는 (Discourse 팀은) DO 마켓플레이스 이미지를 관리하지 않기 때문에, 해당 특정 문제를 해결하는 데 도움을 드리기 어려울 것 같습니다.
mholt
(Matt)
12월 29, 2020, 8:41오후
3
하지만 이 부분은 관리하고 있죠?
##
connect_to_port () {
HOST="$1"
PORT="$2"
VERIFY=$(date +%s | sha256sum | base64 | head -c 20)
if ! [ -x "$(command -v nc)" ]; then
echo "In order to check the connection to $HOST:$PORT we need to open a socket using netcat."
echo However netcat is not installed on your system. You can continue without this check
echo or abort the setup, install netcat and try again.
while true; do
read -p "Would you like to continue without this check? [yn] " yn
case $yn in
[Yy]*) return 2 ;;
[Nn]*) exit ;;
*) echo "Please answer y or n." ;;
esac
done
else
echo -e "HTTP/1.1 200 OK\n\n $VERIFY" | nc -w 4 -l -p $PORT >/dev/null 2>&1 &
if curl --proto =http -s $HOST:$PORT --connect-timeout 3 | grep $VERIFY >/dev/null 2>&1; then
return 0
수동 설치 지침에도 이 단계가 있습니다.
내가 이걸 하는 첫 번째 사람은 아니겠죠. 다른 사람들은 어떻게 하고 있나요?
jomaxro
(Joshua Rosenfeld)
12월 29, 2020, 8:48오후
4
네, 저희가 그 부분을 관리하고 있습니다. 코드를 직접 확인한 것은 아니고, 해당 체크가 마켓플레이스 이미지에서 온다고 가정했습니다.
./discourse-setup은 Discourse를 설정하는 간단한 방법입니다. 새로운 Discourse 사이트를 시작할 때 텍스트 파일을 수동으로 편집할 필요가 없도록 하기 위한 것입니다. 귀하의 사용 사례는 설정 스크립트가 처리하는 “전형적인” 경우가 아닙니다.
귀하의 경우, 현재 서버의 containers/app.yml 파일을 새 서버로 복사하는 것이 가장 좋은 방법이 될 것입니다. 또는 75/76번 줄에서 제안된 대로 파일을 직접 수동으로 편집할 수도 있습니다:
mholt
(Matt)
12월 29, 2020, 8:53오후
5
기본 app.yml 파일을 어디서 찾을 수 있나요? 새로 설치된 기본 상태로 시작하고 싶습니다.
또한, 설치 스크립트 없이 서버를 실행하는 방법은 무엇인가요? 설치 스크립트를 실행할 수 없어서 IP 주소에 접속해도 여전히 응답이 없습니다.
jomaxro
(Joshua Rosenfeld)
12월 29, 2020, 9:02오후
6
기본 설정은 samples/standalone.yml에서 찾을 수 있습니다. GitHub에서도 확인 가능 .
공식 설치 가이드를 따르고 있다면, “Install Discourse” 섹션의 명령을 실행한 다음 다음을 수행해야 합니다:
samples에서 기본 yaml 파일을 containers로 복사합니다:
cp samples/standalone.yml containers/app.yml
파일을 수동으로 편집합니다:
nano containers/app.yml
Discourse를 부트스트랩하고 시작합니다:
./launcher rebuild app
mholt
(Matt)
12월 29, 2020, 9:24오후
7
감사합니다. 이제 좀 더 가까워졌습니다.
하지만 이제 임시 관리자 계정을 활성화할 수 없어서 백업을 가져올 수 없습니다:
(6) 다음 Content Security Policy 지시문을 위반했기 때문에 스크립트 ‘’ 로딩이 거부되었습니다: “script-src ”. 'script-src-elem’이 명시적으로 설정되지 않았으므로 'script-src’가 폴백으로 사용됩니다.
백업에서 직접 복원하거나 그때까지 CSP를 비활성화하는 방법이 있을까요?
jomaxro
(Joshua Rosenfeld)
12월 29, 2020, 9:33오후
8
mholt:
백업에서 복원하는 직접적인 방법이 있나요?
This guide explains how to restore a Discourse backup from the command line without using the Discourse web UI.
Required user level: Administrator
Console access required
Here’s how to restore a Discourse backup from the command line, without ever booting the Discourse web UI. This is handy when you’re moving servers.
Prerequisites
Before you start, make sure you complete the following steps:
Download the latest backup file from the source Disco…
mholt:
그때까지 CSP를 비활성화하나요?
서버에 SSH로 로그인한 후 다음을 실행하세요:
cd /var/discourse
sudo ./launcher enter app
rails c
SiteSetting.content_security_policy = false
exit
exit
참고로 먼저 CLI를 통해 백업 복원을 시도해 보시길 권합니다. 이는 현재 장애 요인(CSP)이 아닌, 실제로 겪고 있는 문제(백업 복원)를 해결하는 방법이기 때문입니다.
mholt
(Matt)
12월 29, 2020, 9:45오후
9
힌트 주셔서 감사합니다.
restore를 실행하면 다음과 같은 오류가 발생합니다:
ERROR: could not create unique index "index_incoming_referers_on_path_and_incoming_domain_id"
DETAIL: Key (path, incoming_domain_id)=(/s/free+proxy+hideip.me, 1009) is duplicated.
EXCEPTION: psql failed: DETAIL: Key (path, incoming_domain_id)=(/s/free+proxy+hideip.me, 1009) is duplicated.
/var/www/discourse/lib/backup_restore/database_restorer.rb:87:in `restore_dump'
/var/www/discourse/lib/backup_restore/database_restorer.rb:26:in `restore'
/var/www/discourse/lib/backup_restore/restorer.rb:51:in `run'
script/discourse:143:in `restore'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
script/discourse:284:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/cli.rb:497:in `exec'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/cli.rb:24:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Trying to rollback...
Rolling back...
Cleaning stuff up...
Dropping functions from the discourse_functions schema...
Removing tmp '/var/www/discourse/tmp/restores/default/2020-12-29-214249' directory...
Unpausing sidekiq...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Finished!
[FAILED]
Restore done.
pfaffman
(Jay Pfaffman)
12월 30, 2020, 12:25오전
10
인덱스가 손상된 것 같습니다. 기존 인스턴스에 업그레이드를 실행해 보셨나요? 도움이 될 수 있습니다.
기존 인스턴스에서 원본 데이터베이스(및 Let’s Encrypt) 파일을 복사하는 방법에 대한 안내가 있는 주제가 어딘가에 있습니다. 저는 아마도 그렇게 할 것 같습니다.
mholt
(Matt)
12월 30, 2020, 12:46오전
11
rub run이 뭐죠?
기존 인스턴스에서 업그레이드를 시도할 때마다 계속 오류가 발생해서(이 오류와는 다른 오류들이에요) 새 인스턴스로 옮기게 되었습니다.
pfaffman
(Jay Pfaffman)
12월 30, 2020, 12:50오전
13