Ignore .git store on Template uploads for editor and increase payload size to 10MB (fixes #12561)

Signed-off-by: Axel Hecht <axel@pike.org>
This commit is contained in:
Axel Hecht
2022-09-23 18:54:48 +02:00
parent c02fda193d
commit b681275e69
3 changed files with 12 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-scaffolder': patch
'@backstage/plugin-scaffolder-backend': patch
---
Ignore .git directories in Template Editor, increase upload limit for dry-runs to 10MB.
@@ -148,7 +148,8 @@ export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {
const router = Router();
router.use(express.json());
// Be generous in upload size to support a wide rande of templates in dry-run mode.
router.use(express.json({ limit: '10MB' }));
const {
logger: parentLogger,
@@ -71,6 +71,10 @@ class WebDirectoryAccess implements TemplateDirectoryAccess {
if (handle.kind === 'file') {
yield new WebFileAccess([...basePath, handle.name].join('/'), handle);
} else if (handle.kind === 'directory') {
// Skip git storage directory
if (handle.name === '.git') {
continue;
}
yield* this.listDirectoryContents(handle, [...basePath, handle.name]);
}
}