Giter Club home page Giter Club logo

Comments (4)

mjbright avatar mjbright commented on June 4, 2024

Agreed.
I compiled it without problem a couple of weeks ago but then it had a problem reading my known_hosts file (typical windows pathname problem) reported as #37.
open C:\tools\cygwin\home\windo\.ssh\known_hosts: The system cannot find the path specified

When I have some time I'll try a workaround and retest to see if the known_hosts is the only blocker ...

from mole.

davrodpin avatar davrodpin commented on June 4, 2024

I've spent some time today to understand what need to be changed to allow mole to be both compiled and executed on Windows and here are my findings:

Environment

Operating System: Windows 10
Go Version: go version go1.11.2 windows/amd64

No linux emulation software was installed during this investigation.

Changes Required

  1. Add golang.org/x/sys/windows to vendor directory to allow the Go compiler to generate the windows executable
  2. mole is trying to get the user home directory through the HOME environment variable, which does not exist on Windows. USERPROFILE should be used instead.
    We might need to set what env. variable should be used to get the home user directory by using build flags (i.e. https://stackoverflow.com/questions/19847594/how-to-reliably-detect-os-platform-in-go).
$ ag HOME --ignore vendor
cmd/mole/main.go
31:     instancesDir = fmt.Sprintf("%s/.mole/instances", os.Getenv("HOME"))

docs/index.md
16:  * Leverage the SSH Config File: use some options (e.g. user name, identity key and port), specified in *$HOME/.ssh/config* whenever possible, so there is no need to have the same SSH server configuration in multiple places.
174:$ cat $HOME/.ssh/config

storage/storage_test.go
104:    os.Setenv("HOME", dir)

storage/storage.go
135:    return filepath.Join(os.Getenv("HOME"), ".mole.conf")

tunnel/config.go
20:// ssh config file from $HOME/.ssh/config.
22:     configPath := filepath.Join(os.Getenv("HOME"), ".ssh", "config")
127:                    return filepath.Join(os.Getenv("HOME"), id[1:])

tunnel/example_test.go
18:     // tunnel.NewServer will not try to lookup any value using $HOME/.ssh/config

tunnel/tunnel.go
26:// NewServer creates a new instance of Server using $HOME/.ssh/config to
69:             key = filepath.Join(os.Getenv("HOME"), ".ssh", "id_rsa")
251:    knownHostFile := filepath.Join(os.Getenv("HOME"), ".ssh", "known_hosts")

tunnel/tunnel_test.go
250:    os.Setenv("HOME", home)

tunnel/doc.go
3:forwarding, leveraging the SSH configuration file (e.g. $HOME/.ssh/config) to
9:The module looks for the ssh config file stored on $HOME/.ssh/config only.

I no one else picks this issue before me, I will try to work on them later this week, whenever I get some free cycles.

@mjbright, once I get it working under the scenario I described, I can take a look what is the issue with Cygwin

from mole.

mjbright avatar mjbright commented on June 4, 2024

from mole.

davrodpin avatar davrodpin commented on June 4, 2024

New version, 0.3.0, was just released and it includes support for windows!

https://github.com/davrodpin/mole/releases/tag/v0.3.0

from mole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.