fix(server): follow symlinks when zipping assets (#11685)

* follow symlinks when zipping assets

fixes #9335

* chore: clean up

---------

Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
Carsten Otto
2024-08-13 17:39:24 +02:00
committed by GitHub
parent 81c813a882
commit df45ef0e35
5 changed files with 45 additions and 4 deletions

View File

@@ -24,6 +24,10 @@ export class StorageRepository implements IStorageRepository {
this.logger.setContext(StorageRepository.name);
}
realpath(filepath: string) {
return fs.realpath(filepath);
}
readdir(folder: string): Promise<string[]> {
return fs.readdir(folder);
}
@@ -52,7 +56,7 @@ export class StorageRepository implements IStorageRepository {
const archive = archiver('zip', { store: true });
const addFile = (input: string, filename: string) => {
archive.file(input, { name: filename });
archive.file(input, { name: filename, mode: 0o644 });
};
const finalize = () => archive.finalize();