Compare commits
No commits in common. "master" and "releaseutils" have entirely different histories.
master
...
releaseuti
6 changed files with 30 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1 @@
|
|||
.*.vim
|
||||
/build
|
||||
|
|
|
@ -54,8 +54,8 @@ func (b *BoolAuto) Set(s string) error {
|
|||
}
|
||||
|
||||
func main() {
|
||||
queryAddr := flag.String("addr", "", "http service address")
|
||||
querySocket := flag.String("socket", "/tmp/circologd-query.sock", "Path to a unix domain socket for the HTTP server")
|
||||
addr := flag.String("addr", "localhost:9080", "http service address")
|
||||
querySocket := flag.String("socket", "", "Path to a unix domain socket for the HTTP server")
|
||||
backlogLimit := flag.Int("n", -1, "Limit the backlog length, defaults to no limit (-1)")
|
||||
var format formatter.Format
|
||||
format = formatter.FormatSyslog
|
||||
|
@ -75,7 +75,7 @@ func main() {
|
|||
signal.Notify(interrupt, os.Interrupt)
|
||||
var d *websocket.Dialer
|
||||
u := url.URL{Scheme: "ws",
|
||||
Host: *queryAddr, // ignored in case of -socket; see the Dialer below
|
||||
Host: *addr, // ignored in case of -socket; see the Dialer below
|
||||
Path: "/ws",
|
||||
}
|
||||
q := u.Query()
|
||||
|
@ -84,7 +84,7 @@ func main() {
|
|||
q.Set("l", strconv.Itoa(*backlogLimit))
|
||||
}
|
||||
u.RawQuery = q.Encode()
|
||||
if *queryAddr == "" {
|
||||
if *querySocket != "" {
|
||||
d = &websocket.Dialer{
|
||||
NetDial: func(network, addr string) (net.Conn, error) {
|
||||
return net.Dial("unix", *querySocket)
|
||||
|
@ -95,7 +95,7 @@ func main() {
|
|||
log.Printf("connecting to %s", *querySocket)
|
||||
} else {
|
||||
d = websocket.DefaultDialer
|
||||
log.Printf("connecting to %s", *queryAddr)
|
||||
log.Printf("connecting to %s", *addr)
|
||||
}
|
||||
|
||||
c, _, err := d.Dial(u.String(), nil)
|
||||
|
|
|
@ -38,8 +38,8 @@ func main() {
|
|||
// dumpSocketPath := flag.String("dump-socket", "/run/buffer.sock", "The socket that user will connect to in order to receive logs")
|
||||
bufsize := flag.Int("buffer-size", 1000, "Number of messages to keep")
|
||||
syslogAddr := flag.String("syslog-addr", "127.0.0.1:9514", "Address:port where to listen for syslog messages")
|
||||
queryAddr := flag.String("query-addr", "", "Address:port where to bind the query service")
|
||||
querySocket := flag.String("query-socket", "/tmp/circologd-query.sock", "Path to a unix domain socket for the HTTP server; recommended for security reasons!")
|
||||
queryAddr := flag.String("query-addr", "127.0.0.1:9080", "Address:port where to bind the query service")
|
||||
querySocket := flag.String("query-socket", "", "Path to a unix domain socket for the HTTP server; recommended for security reasons!")
|
||||
ctlSocket := flag.String("ctl-socket", "/tmp/circologd-ctl.sock", "Path to a unix domain socket for the control server; leave empty to disable")
|
||||
flag.Var(&logFmt, "log-fmt", "Log messages format. If not set, defaults to automatic choice. Allowed values: rfc3164, rfc5424, auto.")
|
||||
verbose := flag.Bool("verbose", false, "Print more output executing the daemon")
|
||||
|
@ -89,7 +89,7 @@ func main() {
|
|||
}
|
||||
|
||||
httpQueryServer := http.Server{Handler: setupHTTP(hub)}
|
||||
if *queryAddr == "" {
|
||||
if *querySocket != "" {
|
||||
fmt.Printf("Binding address `%s` [http]\n", *querySocket)
|
||||
unixListener, err := net.Listen("unix", *querySocket)
|
||||
if err != nil {
|
||||
|
|
13
makebin.sh
Executable file
13
makebin.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -u
|
||||
|
||||
for goosarch in $(go tool dist list | grep -vw -e aix -e js/wasm -e plan9 -e solaris -e android -e nacl)
|
||||
do
|
||||
mkdir -p "build/$goosarch"
|
||||
goos=$(cut -d/ -f 1 <<<$goosarch)
|
||||
goarch=$(cut -d/ -f 2 <<<$goosarch)
|
||||
for cmd in cmd/*; do
|
||||
GOOS=${goos} GOARCH=${goarch} go build -o "build/$goos/$goarch/$(basename $cmd)" ./$cmd
|
||||
done
|
||||
done
|
8
makezip.sh
Executable file
8
makezip.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
find build/ -type f|cut -d/ -f 1-3|uniq|while read -r dir; do
|
||||
zip -j -r "circolog-$(git describe)-$(cut -d/ -f 2-3 <<<"$dir"|tr / -)" "$dir"
|
||||
done
|
||||
|
||||
wait
|
||||
|
|
@ -13,8 +13,5 @@ do
|
|||
done
|
||||
|
||||
find build/ -type f|cut -d/ -f 1-3|uniq|while read -r dir; do
|
||||
find $dir/ -type f -executable | xargs sha1sum > $dir/SHA1SUMS.txt
|
||||
# TODO: touch to last commit date maybe
|
||||
find build -exec touch -d @1234567890 {} \;
|
||||
zip -q -X -j -r "circolog-$(git describe --tags --always)-$(cut -d/ -f 2-3 <<<"$dir"|tr / -)" "$dir"
|
||||
zip -j -r "circolog-$(git describe)-$(cut -d/ -f 2-3 <<<"$dir"|tr / -)" "$dir"
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue