- Timestamp:
- Feb 7, 2024, 12:26:14 AM (16 months ago)
- Location:
- trunk/cmd/mai
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cmd/mai/main.go
r66 r67 22 22 var ( 23 23 configfile string 24 groupname string 25 username string 24 26 ) 25 27 var conf struct { 26 group string27 28 listen string 28 29 staticpath string 29 30 tmplpath string 30 user string31 31 } 32 32 func main() { … … 42 42 conf.tmplpath = "./views" 43 43 44 if conf.user!= "" {45 uid, gid, err := usergroupids( conf.user, conf.group)44 if username != "" { 45 uid, gid, err := usergroupids(username, groupname) 46 46 if err != nil { 47 47 fmt.Println(err) … … 259 259 } 260 260 }) 261 app.Get("/robots.txt", func(c *fiber.Ctx) error { 262 return c.SendString("User-Agent: *\nDisallow: /\n") 263 }) 261 264 app.Get("/version", func(c *fiber.Ctx) error { 262 265 return c.JSON(fiber.Map{ -
trunk/cmd/mai/parseflags.go
r66 r67 8 8 func parseFlags() { 9 9 flag.StringVar(&configfile, "f", "", "Configuration file") 10 flag.StringVar(&username, "u", "", "Sets the user to which privilege dropping is done") 11 flag.StringVar(&groupname, "g", "", "Sets the group to which privilege dropping is done") 10 12 flag.Parse() 11 13 } -
trunk/cmd/mai/readconf.go
r66 r67 11 11 return err 12 12 } 13 conf.group = cfg.Section("mai").Key("group").String()14 13 conf.listen = cfg.Section("mai").Key("listen").String() 15 14 conf.staticpath = cfg.Section("mai").Key("static").String() 16 15 conf.tmplpath = cfg.Section("mai").Key("templates").String() 17 conf.user = cfg.Section("mai").Key("user").String()18 16 19 17 return nil -
trunk/cmd/mai/usergroupids.go
r63 r67 15 15 gid, _ := strconv.Atoi(u.Gid) 16 16 17 if conf.group!= "" {17 if groupname != "" { 18 18 g, err := user.LookupGroup(groupname) 19 19 if err != nil {
Note:
See TracChangeset
for help on using the changeset viewer.