Media Theme deployment fails for custom domain with HTTP Forbidden, allow deployment to default domain (NEST-527)
Closed this issue · 1 comments
Piedone commented
Related to https://lombiq.atlassian.net/browse/NEST-506. You can get the following error when you try to deploy to a site with a custom domain:
Deployment failed with the following exception: System.Net.Http.HttpRequestException: Remote deployment to *** failed with the HTTP code Forbidden and message "Method: POST, RequestUri: '***', Version: 1.1, Content: System.Net.Http.MultipartFormDataContent, Headers:
{
Content-Type: multipart/form-data; boundary="a7609e87-9e56-4c4a-8157-22ccd7c672a0"
Content-Length: 6396
}".
at Lombiq.Hosting.MediaTheme.Deployer.RemoteDeploymentHelper.DeployAsync(CommandLineOptions options, String deploymentPackagePath) in /home/runner/work/Hosting-Media-Theme/Hosting-Media-Theme/Lombiq.Hosting.MediaTheme.Deployer/RemoteDeploymentHelper.cs:line 50
at Lombiq.Hosting.MediaTheme.Deployer.Program.RunOptionsInnerAsync(CommandLineOptions options) in /home/runner/work/Hosting-Media-Theme/Hosting-Media-Theme/Lombiq.Hosting.MediaTheme.Deployer/Program.cs:line 2[48](https://github.com/Lombiq/DotNest-Core-Sites-SDK/actions/runs/7994854894/job/21833876190#step:3:51)
at Lombiq.Hosting.MediaTheme.Deployer.Program.RunOptionsAsync(CommandLineOptions options) in /home/runner/work/Hosting-Media-Theme/Hosting-Media-Theme/Lombiq.Hosting.MediaTheme.Deployer/Program.cs:line 98
This is because Cloudflare, by default, will block requests to _ /OrchardCore.Deployment.Remote/ImportRemoteInstance/Import_, thinking it's a bot.
We either need to force everyone using custom domains to disable bot fight mode (or pay for Cloudflare's Pro plan to enable such configuration), or we can allow such deployments to go to the default domains instead. For that, we need to prevent the custom domain redirects to this URL.
Piedone commented
We fixed this since then by allowing deployments to the default URL, see knowledge base.