Rename: Hamlet -> Ham Lab (binary/module/service/config hamlab)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
436732dac0
commit
d76da4b37a
@@ -1,4 +1,4 @@
|
||||
// Hamlet — Proxmox-style web console for a bare-metal Debian host.
|
||||
// Ham Lab — Proxmox-style web console for a bare-metal Debian host.
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -17,25 +17,25 @@ import (
|
||||
|
||||
"golang.org/x/term"
|
||||
|
||||
"hamlet/internal/api"
|
||||
"hamlet/internal/auth"
|
||||
"hamlet/internal/config"
|
||||
"hamlet/internal/store"
|
||||
hterm "hamlet/internal/term"
|
||||
"hamlet/internal/web"
|
||||
"hamlab/internal/api"
|
||||
"hamlab/internal/auth"
|
||||
"hamlab/internal/config"
|
||||
"hamlab/internal/store"
|
||||
hterm "hamlab/internal/term"
|
||||
"hamlab/internal/web"
|
||||
)
|
||||
|
||||
var version = "dev"
|
||||
|
||||
func main() {
|
||||
defaultCfg := os.Getenv("HAMLET_CONFIG")
|
||||
defaultCfg := os.Getenv("HAMLAB_CONFIG")
|
||||
if defaultCfg == "" {
|
||||
home, _ := os.UserHomeDir()
|
||||
defaultCfg = filepath.Join(home, "apps", "hamlet", "config.json")
|
||||
defaultCfg = filepath.Join(home, "apps", "hamlab", "config.json")
|
||||
}
|
||||
cfgPath := flag.String("config", defaultCfg, "path to config.json")
|
||||
flag.Usage = func() {
|
||||
fmt.Fprintf(os.Stderr, "usage: hamlet [-config path] [serve|passwd|version]\n")
|
||||
fmt.Fprintf(os.Stderr, "usage: hamlab [-config path] [serve|passwd|version]\n")
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
flag.Parse()
|
||||
@@ -50,7 +50,7 @@ func main() {
|
||||
}
|
||||
switch cmd {
|
||||
case "version":
|
||||
fmt.Println("hamlet", version)
|
||||
fmt.Println("hamlab", version)
|
||||
case "passwd":
|
||||
if err := passwd(cfg); err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -98,7 +98,7 @@ func passwd(cfg *config.Config) error {
|
||||
|
||||
func serve(cfg *config.Config) error {
|
||||
if cfg.PasswordHash == "" {
|
||||
return fmt.Errorf("no password set — run: hamlet -config %s passwd", cfg.Path())
|
||||
return fmt.Errorf("no password set — run: hamlab -config %s passwd", cfg.Path())
|
||||
}
|
||||
if err := os.MkdirAll(cfg.DataDir(), 0o700); err != nil {
|
||||
return err
|
||||
@@ -152,7 +152,7 @@ func serve(cfg *config.Config) error {
|
||||
_ = hs.Shutdown(ctx)
|
||||
mgr.Shutdown()
|
||||
}()
|
||||
log.Printf("hamlet %s listening on %s as %s (shell %s)", version, cfg.Listen, u.Username, shell)
|
||||
log.Printf("hamlab %s listening on %s as %s (shell %s)", version, cfg.Listen, u.Username, shell)
|
||||
if err := hs.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) {
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user