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 internalMediaProxy = `${scheme}://${host}/proxy`;
const redis = convertRedisOptions(config.redis, host); const redis = convertRedisOptions(config.redis, host);
const htmlScriptPrelude = `var VERSION = ${JSON.stringify(version)}; var CLIENT_ENTRY = ${JSON.stringify(frontendManifest['src/_boot_.ts'].file)};`; 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([ 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', ...['boot.js', 'style.css', 'style.embed.css', 'boot.embed.js',
'bios.css', 'bios.js', 'cli.css', 'cli.js', 'error.css' 'bios.css', 'bios.js', 'cli.css', 'cli.js', 'error.css'
].map((file) => [file, hashSourceFile(`${_dirname}/server/web/${file}`)] as [string, CSPHashed]), ].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\'']], ['style-src-attr', ['\'self\'', '\'unsafe-inline\'']],
['script-src', ['\'self\'', '\'wasm-unsafe-eval\'', ...scripts]], ['script-src', ['\'self\'', '\'wasm-unsafe-eval\'', ...scripts]],
['object-src', ['\'none\'']], ['object-src', ['\'none\'']],
['frame-src', ['\'none\'']],
['base-uri', ['\'self\'']], ['base-uri', ['\'self\'']],
['form-action', ['\'self\'']], ['form-action', ['\'self\'']],
['child-src', ['\'self\'']], ['child-src', ['\'self\'']],

View file

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

View file

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