Усилить безопасность веб-интерфейса
CI / Rust Checks (push) Successful in 5m14s
CI / UI Checks (push) Successful in 4s
CI / Deployment Manifests (push) Successful in 2s
CI / Frontend E2E (push) Successful in 2m58s
CI / Deploy (push) Successful in 1m44s

This commit is contained in:
2026-07-11 17:12:50 +03:00
parent 8318e4b560
commit 46892ee61c
26 changed files with 250 additions and 60 deletions
+19
View File
@@ -10,6 +10,10 @@ const BRAND_IMAGE_PATHS = [
path.join(ROOT_DIR, 'crank-community.png'),
path.resolve(ROOT_DIR, '..', '..', 'crank-community.png'),
];
const FONT_FILES = [
['@fontsource/inter', 'inter', ['400', '500', '600', '700']],
['@fontsource/jetbrains-mono', 'jetbrains-mono', ['400', '500']],
];
const BUNDLES = {
'protected-core': {
@@ -136,6 +140,20 @@ function copyDirectory(source, destination) {
}
}
function copyFonts() {
FONT_FILES.forEach(function([packageName, family, weights]) {
weights.forEach(function(weight) {
['latin', 'cyrillic'].forEach(function(subset) {
var fileName = `${family}-${subset}-${weight}-normal.woff2`;
copyFile(
path.join(ROOT_DIR, 'node_modules', packageName, 'files', fileName),
path.join(DIST_DIR, 'fonts', fileName)
);
});
});
});
}
function readSource(relativePath) {
return fs.readFileSync(sourcePath(relativePath), 'utf8');
}
@@ -191,6 +209,7 @@ async function main() {
}
copyDirectory(path.join(ROOT_DIR, 'css'), path.join(DIST_DIR, 'css'));
copyFonts();
copyDirectory(path.join(ROOT_DIR, 'data'), path.join(DIST_DIR, 'data'));
ensureDirectory(path.join(DIST_DIR, 'html', 'wizard'));
[
+11 -1
View File
@@ -119,8 +119,18 @@ function proxyRequest(request, response) {
},
},
(proxyResponse) => {
if (response.destroyed || response.writableEnded) {
proxyResponse.resume();
return;
}
response.writeHead(proxyResponse.statusCode || 502, proxyResponse.headers);
pipeline(proxyResponse, response, () => {});
proxyResponse.on('error', function() {
if (!response.destroyed) response.destroy();
});
response.on('close', function() {
if (!proxyResponse.destroyed) proxyResponse.destroy();
});
proxyResponse.pipe(response);
},
);