mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-27 05:42:16 +03:00
Add multiple admins.
This commit is contained in:
parent
e23c8820ce
commit
0237b9ea53
12
cmd.go
12
cmd.go
@ -12,10 +12,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
Verbose []bool `short:"v" long:"verbose" description:"Show verbose logging."`
|
Verbose []bool `short:"v" long:"verbose" description:"Show verbose logging."`
|
||||||
Identity string `short:"i" long:"identity" description:"Private key to identify server with." default:"~/.ssh/id_rsa"`
|
Identity string `short:"i" long:"identity" description:"Private key to identify server with." default:"~/.ssh/id_rsa"`
|
||||||
Bind string `long:"bind" description:"Host and port to listen on." default:"0.0.0.0:22"`
|
Bind string `long:"bind" description:"Host and port to listen on." default:"0.0.0.0:22"`
|
||||||
Admin string `long:"admin" description:"Fingerprint of pubkey to mark as admin."`
|
Admin []string `long:"admin" description:"Fingerprint of pubkey to mark as admin."`
|
||||||
}
|
}
|
||||||
|
|
||||||
var logLevels = []log.Level{
|
var logLevels = []log.Level{
|
||||||
@ -67,8 +67,8 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.Admin != "" {
|
for _, fingerprint := range options.Admin {
|
||||||
server.Op(options.Admin)
|
server.Op(fingerprint)
|
||||||
}
|
}
|
||||||
|
|
||||||
<-sig // Wait for ^C signal
|
<-sig // Wait for ^C signal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user