Files
photography/docs/operations/deployment/fix-caddy-permissions.sh
iriver ff20f6f23a feat: 添加产品经理和全栈开发角色资源文件
初始化产品经理和全栈开发角色的相关资源文件,包括角色定义、知识库、思维模式和执行流程文档
2025-07-21 22:47:16 +08:00

29 lines
920 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 修复 Caddy 访问 gitea 用户目录的权限问题
echo "🔧 修复 Caddy 权限问题..."
# 1. 确保目录存在
sudo -u gitea mkdir -p /home/gitea/www/photography
# 2. 设置目录权限,让 caddy 用户可以访问
# 给 gitea 主目录添加执行权限(让其他用户可以进入)
sudo chmod 755 /home/gitea
# 给 www 目录设置权限
sudo chmod 755 /home/gitea/www
# 给 photography 目录设置权限
sudo chmod 755 /home/gitea/www/photography
# 3. 设置文件权限
sudo find /home/gitea/www/photography -type f -exec chmod 644 {} \;
sudo find /home/gitea/www/photography -type d -exec chmod 755 {} \;
# 4. 检查 caddy 用户是否可以访问
echo "📋 检查权限..."
sudo -u caddy ls -la /home/gitea/www/photography || echo "⚠️ caddy 用户无法访问目录"
echo "✅ 权限修复完成!"
echo "🔄 请重新加载 Caddy 配置sudo systemctl reload caddy"