Changeset 27 in code
- Timestamp:
- Oct 19, 2021, 6:57:32 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/partage.go
r26 r27 10 10 "time" 11 11 "path" 12 "syscall" 12 13 "path/filepath" 13 14 "html/template" … … 36 37 metapath string 37 38 rootdir string 39 chroot string 38 40 templatedir string 39 41 filectx string … … 223 225 flag.StringVar(&conf.metactx, "metactx", "/m/", "Context to serve metadata from (default: /m/)") 224 226 flag.StringVar(&conf.rootdir, "rootdir", "./static", "Root directory (default: ./static)") 227 flag.StringVar(&conf.chroot, "chroot", "", "Directory to chroot into upon starting (default: no chroot)") 225 228 flag.StringVar(&conf.templatedir, "templatedir", "./templates", "Templates directory (default: ./templates)") 226 229 flag.Int64Var(&conf.maxsize, "maxsize", 30064771072, "Maximum file size (default: 28Gib)") … … 229 232 iniflags.Parse() 230 233 234 if (conf.chroot != "") { 235 syscall.Chroot(conf.chroot) 236 } 237 231 238 http.HandleFunc("/", uploader) 232 239 http.Handle(conf.filectx, http.StripPrefix(conf.filectx, http.FileServer(http.Dir(conf.filepath))))
Note:
See TracChangeset
for help on using the changeset viewer.