Compare commits

..
2 Commits
3 changed files with 20 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
/build.sh text eol=lf
Executable
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
if [[ $EUID -ne 0 ]]; then
echo 'Run this deployment build as root: sudo ./build.sh' >&2
exit 1
fi
# Check the service account before replacing dist.
sunrise_group=$(id -gn sunrise)
npm run build
install -d -o sunrise -g "$sunrise_group" -m 755 dist/threads-captures
systemctl restart sunrise-threads.service
echo 'Build complete; capture permissions restored and sunrise-threads.service restarted.'
+2 -1
View File
@@ -41,6 +41,7 @@ root에서 실행합니다. 캡처 저장 위치는 기존 dist/threads-captures
cd /opt/sunrise
git pull --ff-only
npm ci
# 최초 서비스 등록 전에는 직접 빌드합니다.
npm run build
install -d -o sunrise -g "$(id -gn sunrise)" -m 755 dist/threads-captures
install -d -o sunrise -g "$(id -gn sunrise)" -m 700 data/threads
@@ -88,7 +89,7 @@ sudo -iu sunrise sh -lc 'cd /opt/sunrise && npm run threads:post-now'
별도 브라우저 경로를 사용하면 테스트 터미널에도 동일한 환경변수를 적용하세요. post-now는 실행할 때마다 새 테스트 게시물을 만듭니다. preview 이미지는 확인용으로 보존합니다.
이후 배포는 git pull, 필요 시 npm ci, npm run build, 웹 서버 재시작, `systemctl restart sunrise-threads.service` 순서입니다. 설정/문구는 다시 복사하지 않습니다. root로 빌드한 뒤에는 아래 명령으로 캡처 폴더를 다시 만들고 권한을 맞추세요.
이후 배포는 git pull, 필요 시 npm ci, ./build.sh, 웹 서버 재시작 순서입니다. ./build.sh가 빌드와 권한 설정에 성공한 뒤 sunrise-threads.service까지 재시작합니다. 설정/문구는 다시 복사하지 않습니다. root에서 ./build.sh를 실행하면 빌드 후 캡처 폴더 생성·권한 설정·서비스 재시작까지 처리합니다. 서비스가 아직 등록되지 않았다면 최초 등록 절차를 먼저 진행하세요. npm run build를 직접 실행했다면 아래 명령이 필요합니다.
```bash
install -d -o sunrise -g "$(id -gn sunrise)" -m 755 /opt/sunrise/dist/threads-captures