fix: you got undefined.zip archiving the root

Massimo Melina committed Jan 2, 2022 at 22:27 UTC 635d12dbc9cedecffc8dc598f4d230ea73b03a1c
4 files changed +4 -1
config.yaml
+1
@@ -1,6 +1,7 @@
1 port: 80
2 mime:
3 "*.jpg|*.png|*.mp3|*.txt": auto
4 +log: access.log
5 vfs:
6 children:
7 - name: f1
src/perm.ts
+1
@@ -23,6 +23,7 @@ export async function getCurrentUsername(ctx: Koa.Context) {
23 return ctx.session?.user || ''
24 }
25
26 +// provides the username and all other usernames it inherits based on the 'belongs' attribute. Useful to check permissions
27 export async function getCurrentUsernameExpanded(ctx: Koa.Context) {
28 const who = await getCurrentUsername(ctx)
29 if (!who)
src/zip.ts
+1 -1
@@ -9,7 +9,7 @@ export async function zipStreamFromFolder(node: VfsNode, ctx: Koa.Context) {
9 ctx.status = 200
10 ctx.mime = 'zip'
11 const { name } = node
12 - ctx.attachment(name+'.zip')
12 + ctx.attachment((name || 'archive') + '.zip')
13 const walker = filterMapGenerator(walkNode(node, ctx, Infinity), async (el:VfsNode) => {
14 if (!el.source || ctx.req.aborted)
15 return
todo.md
+1
@@ -13,6 +13,7 @@
13 - user.redirect
14 - config: bans
15 - config: min disk space
16 +- https
17 - frontend: don't depend on cdn
18 - webdav?
19 - vfs: ability to remove/hide/rename files deep in a source