我在更新我的服务器时使用 github actions 来进行 ftp 目的,它工作得很好,直到我集成了 cloudflare 并出于安全原因决定阻止除来自我的国家/地区之外的所有流量。从那时起,在服务器上部署的 github 操作就不起作用了。
尝试在互联网上进行研究,发现我的 cloudflare 设置是导致问题的原因,但我不知道如何将 github 中的 IP 地址列入白名单,以便操作可以正常工作。
具体的github操作是https://github.com/SamKirkland/FTP-Deploy-Action
这是我从 github 行动失败中得到的结果
Run SamKirkland/[email protected]
----------------------------------------------------------------
🚀 Thanks for using ftp-deploy. Let's deploy some stuff!
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a ⭐ on Github --> https://github.com/SamKirkland/FTP-Deploy-Action
or add a badge 🏷️ to your projects readme --> https://github.com/SamKirkland/FTP-Deploy-Action#badge
Failed to connect, are you sure your server works via FTP or FTPS? Users sometimes get this error when the server only supports SFTP.
----------------------------------------------------------------
-------------- 🔥🔥🔥 an error occurred 🔥🔥🔥 --------------
----------------------------------------------------------------
----------------------------------------------------------------
---------------------- full error below ----------------------
----------------------------------------------------------------
Error: Timeout (control socket)
at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:5288:33)
at Object.onceWrapper (node:events:627:28)
at Socket.emit (node:events:513:28)
at Socket._onTimeout (node:net:550:8)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
Error: Error: Timeout (control socket)
您可以在该页面中阅读如何检索 GitHub 的 IP 地址: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-githubs-ip-addresses
获取所有 GitHub IP 地址的最简单方法:
curl -L -H "Accept: application/vnd.github+json" https://api.github.com/meta
但是从安全角度来看,您需要考虑使用自托管运行器的解决方案,这会安全得多: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners