diff --git a/cmd/imgbuilder/main.go b/cmd/imgbuilder/main.go index 4cc5087..27a8c22 100644 --- a/cmd/imgbuilder/main.go +++ b/cmd/imgbuilder/main.go @@ -10,11 +10,9 @@ import ( ) var rootCmd = &cobra.Command{ - Use: "imgbuilder", - // TODO: Fill this - // Short: "", - // Long: ``, - Args: cobra.ExactArgs(2), + Use: "imgbuilder", + Short: "Build an Alpine Linux image for Linsk. A base Alpine VM disc image is required.", + Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { baseISOPath := filepath.Clean(args[0]) outImagePath := filepath.Clean(args[1]) diff --git a/cmd/ls.go b/cmd/ls.go index 8005d29..22728ed 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -13,10 +13,9 @@ import ( ) var lsCmd = &cobra.Command{ - Use: "ls", - // TODO: Fill this - // Short: "", - Args: cobra.ExactArgs(1), + Use: "ls", + Short: "Start a VM and list all user drives within the VM. Uses lsblk command under the hood.", + Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { os.Exit(runVM(args[0], func(ctx context.Context, i *vm.VM, fm *vm.FileManager) int { lsblkOut, err := fm.Lsblk() diff --git a/cmd/root.go b/cmd/root.go index 1906076..b3783a4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -9,10 +9,12 @@ import ( ) var rootCmd = &cobra.Command{ - Use: "linsk", - // TODO: Fill this - // Short: "", - // Long: ``, + Use: "linsk", + Short: "Access Linux-native file system infrastructure (including LVM and LUKS) on macOS and Linux. Powered by a lightweight Alpine Linux VM and FTP.", + Long: `Linsk is a utility that allows you to access Linux-native file system infrastructure, including device mapping technologies like LVM and LUKS without compromise on other operating systems that have little ` + + `to no support for Linux's wide range of file systems, mainly aiming macOS and Windows. Linsk does not reimplement any file system. Instead, Linsk ` + + `utilizes a lightweight Alpine Linux VM to tap into the native Linux software ecosystem. The files are then exposed to the host via fast and widely-supported FTP, ` + + `operating at near-hardware speeds.`, } func Execute() { @@ -33,5 +35,5 @@ func init() { rootCmd.AddCommand(shellCmd) rootCmd.PersistentFlags().BoolVar(&vmDebugFlag, "vmdebug", false, "Enable VM debug mode. This will open an accessible VM monitor. You can log in with root user and no password.") - rootCmd.PersistentFlags().BoolVar(&unrestrictedNetworkingFlag, "unsafe-unrestricted-networking", false, "(UNSAFE) Enable unrestricted networking. This will allow the VM to connect to the internet.") + rootCmd.PersistentFlags().BoolVar(&unrestrictedNetworkingFlag, "unrestricted-networking", false, "Enable unrestricted networking. This will allow the VM to connect to the internet.") } diff --git a/cmd/run.go b/cmd/run.go index ca7a8ef..2c2a7ad 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -13,10 +13,9 @@ import ( ) var runCmd = &cobra.Command{ - Use: "run", - // TODO: Fill this - // Short: "", - Args: cobra.ExactArgs(3), + Use: "run", + Short: "Start a VM and expose a file share.", + Args: cobra.ExactArgs(3), Run: func(cmd *cobra.Command, args []string) { vmMountDevName := args[1] fsType := args[2] diff --git a/cmd/shell.go b/cmd/shell.go index 5f691cb..5ff054e 100644 --- a/cmd/shell.go +++ b/cmd/shell.go @@ -14,10 +14,9 @@ import ( ) var shellCmd = &cobra.Command{ - Use: "shell", - // TODO: Fill this - // Short: "", - Args: cobra.RangeArgs(0, 1), + Use: "shell", + Short: "Start a VM and access the shell. Useful for formatting drives and debugging.", + Args: cobra.RangeArgs(0, 1), Run: func(cmd *cobra.Command, args []string) { var passthroughArg string if len(args) > 0 { diff --git a/vm/vm.go b/vm/vm.go index a962d17..0b67d45 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -118,7 +118,7 @@ func NewVM(logger *slog.Logger, cfg VMConfig) (*VM, error) { if !cfg.UnrestrictedNetworking { netdevOpts += ",restrict=on" } else { - logger.Warn("Running with unsafe unrestricted networking") + logger.Warn("Running with unrestricted networking") } for _, pf := range cfg.ExtraPortForwardingRules { @@ -267,7 +267,6 @@ func (vm *VM) Run() error { knownHosts, err := ParseSSHKeyScan(sshKeyScan) if err != nil { - // TODO: Test what actually happens in inline critical errors like this. globalErrFn(errors.Wrap(err, "parse ssh key scan")) return }