Skip to content

Commit

Permalink
Merge pull request #1845 from oasisprotocol/lw/release-headers
Browse files Browse the repository at this point in the history
Include security headers in the build and release
  • Loading branch information
lukaw3d authored Feb 12, 2024
2 parents d21de39 + 2ee6a15 commit e73dbba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelog/1845.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include security headers in the build and release
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
with:
files: |
oasis-wallet-web-${{ steps.vars.outputs.VERSION }}.zip
build/Content-Security-Policy.txt
build/Permissions-Policy.txt
name: Oasis Wallet ${{ steps.vars.outputs.VERSION }}
body: ${{ steps.changelog.outputs.content }}
env:
Expand Down
3 changes: 3 additions & 0 deletions internals/scripts/build-web.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
const fs = require('fs')
const execSync = require('child_process').execSync
const { getCsp, getPermissionsPolicy } = require('../getSecurityHeaders.js')
const { buildDatetime, buildSha, buildVersion } = require('../getBuildData')
Expand All @@ -16,3 +17,5 @@ process.env.REACT_APP_META_CSP = csp.replace(/frame-ancestors .*?;/, '')

execSync('yarn clean && parcel build --target web --dist-dir build', { stdio: 'inherit' })
execSync('cp public/robots.txt build/robots.txt', { encoding: 'utf8' })
fs.writeFileSync('build/Content-Security-Policy.txt', csp, 'utf8')
fs.writeFileSync('build/Permissions-Policy.txt', permissionsPolicy, 'utf8')

0 comments on commit e73dbba

Please sign in to comment.