gitea配置问题修复,nginx调用证书可能没有安装acme的问题

This commit is contained in:
lsy 2024-10-15 16:58:34 +08:00
parent 778fb6ec59
commit 015923acd8
2 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,8 @@ declare port=$2
sudo useradd -m git
sudo -u git ssh-keygen -t rsa -b 4096 -C "Gitea Host Key" -f /home/git/.ssh/id_rsa -N ""
sudo -u git sh -c 'cat /home/git/.ssh/id_rsa.pub >> /home/git/.ssh/authorized_keys'
sudo -u git sh -c 'chmod a+x /usr/local/bin/gitea'
sudo -u git sh -c 'echo "ssh -p '$(( port+22 ))' -o StrictHostKeyChecking=no git@127.0.0.1 \"SSH_ORIGINAL_COMMAND=\\\"\$SSH_ORIGINAL_COMMAND\\\" \$0 \$@\"" > /usr/local/bin/gitea'
declare uid=$( id git | awk -F'[=() ]+' '{print $2}' )
declare gid=$( id git | awk -F'[=() ]+' '{print $5}' )
@ -60,5 +62,3 @@ EOF
chown -R git:git $path
sudo docker compose up -d
sudo -u git ssh -p $(( port+22 )) -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"

View File

@ -24,6 +24,7 @@ if [[ $pick == 2 ]]; then
else
echo "1.nginx(默认)"
read -p "请选择:" pick
bash "$(dirname $(dirname $0))/acme/test.sh"
bash "$(dirname $(dirname $0))/acme/apply.sh" "nginx" "${domain}"
ssl_certificate="${HOME}/.acme.sh/${ssl_domain}_ecc/fullchain.cer"
ssl_certificate_key="${HOME}/.acme.sh/${ssl_domain}_ecc/${ssl_domain}.key"