Skip to content

Commit

Permalink
Merge pull request #60 from ramangupta44/feature/add-script-header
Browse files Browse the repository at this point in the history
Added Xdt for sitecore web.config
  • Loading branch information
ramangupta44 authored Oct 3, 2023
2 parents 78c8c8c + cb1bb19 commit 4e904ac
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 28 deletions.
31 changes: 31 additions & 0 deletions src/platform/App_Data/Xdts/Web.config.xdt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="
http://schemas.microsoft.com/XML-Document-Transform">

<location path="sitecore">
<system.webServer>
<httpProtocol>
<customHeaders>
<!--DO NOT USE THIS CONTENT SECURITY POLICY EXAMPLE IN YOUR SOLUTION-->
<add name="Content-Security-Policy" value="default-src 'self' 'unsafe-inline' 'unsafe-eval'
https://apps.sitecore.net;
img-src 'self' data:
https://espirechdemo.sitecoresandbox.cloud/
https://s.gravatar.com
https://*.wp.com/cdn.auth0.com/avatars;
style-src 'self' 'unsafe-inline'
https://fonts.googleapis.com;
font-src 'self' 'unsafe-inline'
https://fonts.gstatic.com;
block-all-mixed-content; child-src 'self'
https://espirechdemo.sitecoresandbox.cloud/;
connect-src 'self'
https://espirechdemo.sitecoresandbox.cloud/;
media-src
https://espirechdemo.sitecoresandbox.cloud/"
xdt:Transform="Replace" xdt:Locator="Match(name)"/>
</customHeaders>
</httpProtocol>
</system.webServer>
</location>
</configuration>
1 change: 1 addition & 0 deletions src/platform/Platform.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<PackageReference Include="Sitecore.Assemblies.SitecoreHeadlessServicesServer" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\Xdts\Web.config.xdt" />
<None Include="Platform.wpp.targets" />
<None Include="Properties\PublishProfiles\Local.pubxml" />
<None Include="README.md" />
Expand Down
62 changes: 34 additions & 28 deletions xmcloud.build.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
{
"renderingHosts": {
"xmcloudpreview": {
"path": "./src/sxastarter",
"nodeVersion": "16.15.1",
"jssDeploymentSecret": "xwf748xgtgko88jj7ls7pp6q2rr2bem6fmvmlipjcg",
"enabled": true,
"type": "sxa",
"lintCommand": "lint",
"startCommand": "start:production",
"buildCommand": "build",
"runCommand": "next:start"
"renderingHosts": {
"xmcloudpreview": {
"path": "./src/sxastarter",
"nodeVersion": "16.15.1",
"jssDeploymentSecret": "xwf748xgtgko88jj7ls7pp6q2rr2bem6fmvmlipjcg",
"enabled": true,
"type": "sxa",
"lintCommand": "lint",
"startCommand": "start:production",
"buildCommand": "build",
"runCommand": "next:start"
}
},
"transforms": [
{
"xdtPath": "/app_data/xdts/web.config.xdt",
"targetPath": "/web.config"
}
],
"postActions": {
"actions": {
"warmUpCm": {
"urls": [
"/sitecore/shell",
"/sitecore/shell/Applications/Content%20Editor.aspx?sc_bw=1",
"/sitecore/client/Applications/Launchpad"
]
},
"populateSchema": {
"indexNames": []
},
"reindex": {
"indexNames": []
}
},
"postActions": {
"actions":{
"warmUpCm": {
"urls": [
"/sitecore/shell",
"/sitecore/shell/Applications/Content%20Editor.aspx?sc_bw=1",
"/sitecore/client/Applications/Launchpad"
]
},
"populateSchema": {
"indexNames": []
},
"reindex": {
"indexNames": []
}
}
}
}
}

1 comment on commit 4e904ac

@vercel
Copy link

@vercel vercel bot commented on 4e904ac Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.