접근
웹 인터페이스: https://<SERVER_IP>
API 엔드포인트: https://<SERVER_IP>:5004
기본 관리자 인증 정보:
- 이메일:
[email protected] - 비밀번호:
1234
첫 로그인 후 즉시 관리자 계정 정보를 변경하십시오.
자체 서명 인증서 안내
이 설치 환경에서는 자체 서명된 TLS 인증서를 사용합니다.
브라우저에서 SSL 경고가 표시될 수 있습니다.
다음 API 호출의 경우 curl, 인증서 검증을 무시해야 합니다:
curl -k https://<SERVER_IP>:5004
그 -k 이 플래그는 curl이 TLS 인증서 검증을 건너뛰도록 지시합니다.
API 토큰을 얻는 방법 예시:
curl -k https://<SERVER_IP>:5004/api/v1/auth/login
-H "Content-Type: application/json"
-d '{"email":"[email protected]","password":"1234"}'
이 메서드는 토큰이 포함된 JSON 응답을 반환합니다.
API 토큰을 얻는 방법 예시:
curl -k -i https://<SERVER_IP>:5004/api/v1/<VALID_ENDPOINT>
-H "Authorization: Bearer <TOKEN>"
실행 환경에서는 자체 서명 인증서를 신뢰할 수 있는 SSL 인증서(예: Let’s Encrypt)로 교체하십시오.
중요한 파일 및 디렉터리
- 설치 디렉터리:
/root/peppermint - 환경 변수(데이터베이스 자격 증명, 시크릿, BASE_URL):
/root/peppermint/.env - Docker Compose 구성:
/root/peppermint/docker-compose.yml - PostgreSQL 영구 데이터 (Docker 볼륨):
/var/lib/docker/volumes/pgdata/_data - Nginx 리버스 프록시 설정:
/etc/nginx/conf.d/peppermint-client.conf&/etc/nginx/conf.d/peppermint-api.conf - TLS 인증서(자체 서명형 또는 Let’s Encrypt):
/etc/nginx/ssl/
도메인에 SSL 활성화하기
1. 도메인을 서버 IP로 연결하십시오.
2. 편집 /root/peppermint/.env 도메인 이름을 설정하는 파일: BASE_URL=https://your.domain.com
3. 서비스를 재구축하십시오:
cd /root/peppermint/
docker compose up -d
4. Nginx 설정 파일을 편집하고 다음을 대체합니다 server_name <IP>; 귀하의 도메인과 함께 (<your-domain>HTTP(포트 80) 및 HTTPS(포트 443) 블록 모두에 대해:
vim /etc/nginx/conf.d/peppermint-client.conf
vim /etc/nginx/conf.d/peppermint-api.conf
5. Certbot 설치:
apt install -y certbot python3-certbot-nginx
6. 유효한 Let’s Encrypt 인증서를 생성하려면 다음 명령어를 실행하십시오:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
7. Nginx 구성 파일(TLS 섹션)에서 SSL 경로 교체:
vim /etc/nginx/conf.d/peppermint-client.conf
vim /etc/nginx/conf.d/peppermint-api.conf
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
8. 변경 사항을 적용하려면 Nginx를 재시작하십시오:
systemctl restart nginx
9. 브라우저를 열고 다음 주소를 방문하세요: https://yourdomain.com