feat: 更新ssl证书文件命名

This commit is contained in:
CaasianVale
2025-03-09 18:29:26 +08:00
parent 3421e32ac1
commit 74f3bc75e9
5 changed files with 19 additions and 16 deletions

View File

@@ -117,11 +117,12 @@ jobs:
mkdir -p ${DEPLOY_PATH}/nginx/ssl
# 如果SSL证书不存在创建自签名证书仅用于测试
if [ ! -f ${DEPLOY_PATH}/nginx/ssl/cert.pem ] || [ ! -f ${DEPLOY_PATH}/nginx/ssl/key.pem ]; then
if [ ! -f ${DEPLOY_PATH}/nginx/ssl/fullchain.pem ] || [ ! -f ${DEPLOY_PATH}/nginx/ssl/privkey.pem ]; then
echo "SSL证书不存在创建自签名证书..."
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout ${DEPLOY_PATH}/nginx/ssl/key.pem \
-out ${DEPLOY_PATH}/nginx/ssl/cert.pem \
openssl req -x509 -nodes -days 365 \
-newkey rsa:2048 \
-keyout ${DEPLOY_PATH}/nginx/ssl/privkey.pem \
-out ${DEPLOY_PATH}/nginx/ssl/fullchain.pem \
-subj "/CN=localhost" \
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
echo "自签名证书创建完成"