Implement comprehensive configuration management with CLI flags for WiFi interface, device discovery method, and file paths. Add ARP table parsing as an alternative to DHCP leases for more reliable device detection. Improve WiFi scanning to handle concurrent scan requests gracefully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
47 lines
932 B
Go
47 lines
932 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"log"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
|
|
"github.com/nemunaire/repeater/internal/app"
|
|
"github.com/nemunaire/repeater/internal/config"
|
|
)
|
|
|
|
//go:embed all:static
|
|
var assets embed.FS
|
|
|
|
func main() {
|
|
// Load and parse options
|
|
cfg, err := config.ConsolidateConfig()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
// Create application instance
|
|
application := app.New(assets)
|
|
|
|
// Initialize the application
|
|
if err := application.Initialize(cfg); err != nil {
|
|
log.Fatalf("Failed to initialize application: %v", err)
|
|
}
|
|
defer application.Shutdown()
|
|
|
|
// Handle graceful shutdown
|
|
sigChan := make(chan os.Signal, 1)
|
|
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
|
go func() {
|
|
<-sigChan
|
|
log.Println("Shutting down gracefully...")
|
|
application.Shutdown()
|
|
os.Exit(0)
|
|
}()
|
|
|
|
// Start the server
|
|
if err := application.Run(cfg.Bind); err != nil {
|
|
log.Fatalf("Failed to start server: %v", err)
|
|
}
|
|
}
|