add protect and enable unveil on openbsd
This commit is contained in:
parent
ffcd01a772
commit
aa6e22ff39
2
go.mod
2
go.mod
@ -7,5 +7,5 @@ require (
|
||||
go.etcd.io/bbolt v1.3.3
|
||||
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9
|
||||
)
|
||||
|
1
go.sum
1
go.sum
@ -11,4 +11,5 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
18
main.go
18
main.go
@ -32,20 +32,26 @@ func sendMessage(c *gomatrix.Client, roomID, message string) error {
|
||||
}
|
||||
|
||||
func main() {
|
||||
var store, err = NewStore("mcchunkie.db")
|
||||
if err != nil {
|
||||
log.Fatalf("%s\n", err)
|
||||
}
|
||||
|
||||
var username, password, userID, accessToken, server string
|
||||
var username, password, userID, accessToken, server, db string
|
||||
var setup bool
|
||||
|
||||
flag.StringVar(&username, "user", "", "username to connect to matrix server with")
|
||||
flag.StringVar(&server, "server", "", "matrix server")
|
||||
flag.BoolVar(&setup, "s", false, "setup account")
|
||||
flag.StringVar(&db, "db", "mcchunkie.db", "full path to database file")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
unveil("/etc/resolv.conf", "r")
|
||||
unveil("/etc/ssl/cert.pem", "r")
|
||||
unveil(db, "rwc")
|
||||
unveilBlock()
|
||||
|
||||
var store, err = NewStore(db)
|
||||
if err != nil {
|
||||
log.Fatalf("%s\n", err)
|
||||
}
|
||||
|
||||
if server == "" {
|
||||
server, err = store.get("config", "server")
|
||||
if server == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user