add version and cli customization

This commit is contained in:
Hank
2024-07-19 22:51:21 -04:00
parent e876f3272f
commit dd5cb35e32
2 changed files with 7 additions and 2 deletions

View File

@@ -20,12 +20,12 @@ RUN apk add --no-cache \
unzip \
ca-certificates
COPY --from=builder /server /
COPY --from=builder /beszel /
COPY ./site/dist /site/dist
EXPOSE 8080
ENTRYPOINT [ "/server" ]
ENTRYPOINT [ "/beszel" ]
CMD ["serve", "--http=0.0.0.0:8080"]

View File

@@ -28,11 +28,16 @@ import (
"golang.org/x/crypto/ssh"
)
var Version = "0.0.1-alpha.0"
var app *pocketbase.PocketBase
var serverConnections = make(map[string]Server)
func main() {
app = pocketbase.New()
app.RootCmd.Version = Version
app.RootCmd.Use = "beszel"
app.RootCmd.Short = ""
// loosely check if it was executed using "go run"
isGoRun := strings.HasPrefix(os.Args[0], os.TempDir())