mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-12 23:27:17 +03:00
Update README and cmd descriptions.
This commit is contained in:
parent
410691566b
commit
d4da1ac1cc
12
README.md
12
README.md
@ -24,12 +24,16 @@ Usage:
|
|||||||
ssh-chat [OPTIONS]
|
ssh-chat [OPTIONS]
|
||||||
|
|
||||||
Application Options:
|
Application Options:
|
||||||
-v, --verbose Show verbose logging.
|
-v, --verbose Show verbose logging.
|
||||||
-b, --bind= Host and port to listen on. (0.0.0.0:22)
|
-i, --identity= Private key to identify server with. (~/.ssh/id_rsa)
|
||||||
-i, --identity= Private key to identify server with. (~/.ssh/id_rsa)
|
--bind= Host and port to listen on. (0.0.0.0:22)
|
||||||
|
--admin= Fingerprint of pubkey to mark as admin.
|
||||||
|
--whitelist= Optional file of pubkey fingerprints that are allowed to connect
|
||||||
|
--motd= Message of the Day file (optional)
|
||||||
|
--pprof= enable http server for pprof
|
||||||
|
|
||||||
Help Options:
|
Help Options:
|
||||||
-h, --help Show this help message
|
-h, --help Show this help message
|
||||||
```
|
```
|
||||||
|
|
||||||
After doing `go get github.com/shazow/ssh-chat` on this repo, you should be able
|
After doing `go get github.com/shazow/ssh-chat` on this repo, you should be able
|
||||||
|
10
cmd.go
10
cmd.go
@ -4,11 +4,11 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"os/user"
|
"os/user"
|
||||||
"strings"
|
"strings"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/alexcesaro/log"
|
"github.com/alexcesaro/log"
|
||||||
"github.com/alexcesaro/log/golog"
|
"github.com/alexcesaro/log/golog"
|
||||||
@ -22,9 +22,9 @@ type Options struct {
|
|||||||
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."`
|
||||||
Whitelist string `long:"whitelist" description:"Optional file of pubkey fingerprints that are allowed to connect"`
|
Whitelist string `long:"whitelist" description:"Optional file of pubkey fingerprints who are allowed to connect."`
|
||||||
Motd string `long:"motd" description:"Message of the Day file (optional)"`
|
Motd string `long:"motd" description:"Optional Message of the Day file."`
|
||||||
Pprof int `long:"pprof" description:"enable http server for pprof"`
|
Pprof int `long:"pprof" description:"Enable pprof http server for profiling."`
|
||||||
}
|
}
|
||||||
|
|
||||||
var logLevels = []log.Level{
|
var logLevels = []log.Level{
|
||||||
@ -45,7 +45,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if options.Pprof != 0 {
|
if options.Pprof != 0 {
|
||||||
go func(){
|
go func() {
|
||||||
fmt.Println(http.ListenAndServe(fmt.Sprintf("localhost:%d", options.Pprof), nil))
|
fmt.Println(http.ListenAndServe(fmt.Sprintf("localhost:%d", options.Pprof), nil))
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user