allow self-embed (previews, etc.)
Some checks failed
Lint / pnpm_install (push) Successful in 1m48s
Publish Docker image / Build (push) Successful in 4m52s
Test (production install and build) / production (20.16.0) (push) Failing after 1m46s
Test (backend) / e2e (20.16.0) (push) Failing after 4m56s
Lint / lint (backend) (push) Failing after 23s
Test (backend) / unit (20.16.0) (push) Successful in 6m48s
Lint / lint (frontend) (push) Failing after 17s
Lint / lint (frontend-embed) (push) Failing after 14s
Lint / lint (frontend-shared) (push) Failing after 22s
Lint / lint (misskey-bubble-game) (push) Failing after 24s
Lint / lint (misskey-js) (push) Failing after 25s
Lint / lint (misskey-reversi) (push) Failing after 25s
Lint / lint (sw) (push) Failing after 24s
Lint / typecheck (backend) (push) Failing after 24s
Lint / typecheck (misskey-js) (push) Failing after 25s
Lint / typecheck (sw) (push) Failing after 24s

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
ゆめ 2024-11-11 21:54:57 -06:00
parent 2419a9f740
commit 7748ab5dd0
No known key found for this signature in database
4 changed files with 13 additions and 12 deletions

View file

@ -239,10 +239,10 @@ export function loadConfig(): Config {
const internalMediaProxy = `${scheme}://${host}/proxy`;
const redis = convertRedisOptions(config.redis, host);
const htmlScriptPrelude = `var VERSION = ${JSON.stringify(version)}; var CLIENT_ENTRY = ${JSON.stringify(frontendManifest['src/_boot_.ts'].file)};`;
const htmlEmbedScriptPrelude = `var VERSION = ${JSON.stringify(version)}; var CLIENT_ENTRY = ${JSON.stringify(frontendEmbedManifest['src/boot.ts'].file)};`;
const cspPrerenderedContent = new Map([
[
'.prelude.js', hashResource(htmlScriptPrelude)
],
['.prelude.js', hashResource(htmlScriptPrelude)],
['.prelude.embed.js', hashResource(htmlEmbedScriptPrelude)],
...['boot.js', 'style.css', 'style.embed.css', 'boot.embed.js',
'bios.css', 'bios.js', 'cli.css', 'cli.js', 'error.css'
].map((file) => [file, hashSourceFile(`${_dirname}/server/web/${file}`)] as [string, CSPHashed]),

View file

@ -44,7 +44,6 @@ export function generateCSP(hashedMap: Map<string, CSPHashed>, options: {
['style-src-attr', ['\'self\'', '\'unsafe-inline\'']],
['script-src', ['\'self\'', '\'wasm-unsafe-eval\'', ...scripts]],
['object-src', ['\'none\'']],
['frame-src', ['\'none\'']],
['base-uri', ['\'self\'']],
['form-action', ['\'self\'']],
['child-src', ['\'self\'']],

View file

@ -1,10 +1,10 @@
block vars
block loadClientEntry
- const entry = config.frontendEntry
- const styleCSS = config.cspPrerenderedContent.get('style.css');
- const jsPrelude = config.cspPrerenderedContent.get('.prelude.js');
- const bootJS = config.cspPrerenderedContent.get('boot.js');
- const entry = config.frontendEmbedEntry
- const styleCSS = config.cspPrerenderedContent.get('style.embed.css');
- const jsPrelude = config.cspPrerenderedContent.get('.prelude.embed.js');
- const bootJS = config.cspPrerenderedContent.get('boot.embed.js');
doctype html

View file

@ -1,15 +1,17 @@
doctype html
block sriEntries
- const cliJS = config.cspPrerenderedContent.get('cli.js')
- const cliCSS = config.cspPrerenderedContent.get('cli.css')
html
head
meta(charset='utf-8')
meta(name='application-name' content='Misskey')
title Misskey Cli
style
include ../cli.css
script
include ../cli.js
style(integrity=cliCSS.integrity) !{cliCSS.content}
script(integrity=cliJS.integrity) !{cliJS.content}
body
header