maint: changes

This commit is contained in:
vxclutch
2026-06-02 07:52:52 -04:00
parent 9ced6600e3
commit ec19585e9b
12 changed files with 147 additions and 61 deletions

44
bin/main.go Normal file
View File

@@ -0,0 +1,44 @@
package main
import (
_ "embed"
"flag"
"fmt"
"lash"
"lash/internal/app"
"lash/internal/errx"
share "lash/internal/shareLink"
"net/http"
)
var versionFlag = flag.Bool("version", false, "Print out version and exit.")
var port = flag.Int("p", 1337, "Set the port for LASH exchanges.")
var numberOfShares = flag.Int("n", -1, "Number of shares to allow before killing the server.")
func main() {
flag.Parse()
if *versionFlag {
fmt.Print("lash/vxc v", lash.Version)
return
}
ctx := lash.LashContext{
N: *numberOfShares,
}
srv := app.New(&ctx)
server := http.Server{
Addr: fmt.Sprintf(":%d", *port),
Handler: srv,
}
errx.Log("Your share link is %s", share.GenerateShareLink(*port))
errx.Log("Your token is \033[1;92m%s\033[0m", lash.Token)
errx.Log("starting server at http://0.0.0.0:%d", *port)
if err := server.ListenAndServe(); err != nil {
errx.FatalPerror(err)
}
}