Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we integrate this with Vuejs #366

Open
umardraz opened this issue Jul 27, 2024 · 4 comments
Open

Can we integrate this with Vuejs #366

umardraz opened this issue Jul 27, 2024 · 4 comments

Comments

@umardraz
Copy link

Hi Bill

Is it possible that we can integrate this in Vuejs Project?

@billchurch
Copy link
Owner

The app/client can be modified to fit any framework. See (Building)[https://github.com/billchurch/webssh2/blob/main/BUILDING.md] for more information.

However, I'm working on a project to split the client out of this repo, simplifying the process and making it easier to support different frameworks or do other custom modifications.

I hope to have something usable in the next couple of weeks. Some other priorities have kept me from completing some testing.

@umardraz
Copy link
Author

Thanks, I will wait :)

@billchurch
Copy link
Owner

Ok. I don't have the "current" version refactored, but I did "refactor" and older branch. It's actually a total re-write but I had to target an old version of node for a specific use case.

The front end is:

The back end is currently in the bigip-server branch

I created a tag on dockerhub with this new version. It doesn't exactly solve your problem right now but I was hoping maybe you'd take a look at it and see what you think.

docker run -it --rm --name webssh2 -p 2222:2222 -e DEBUG="webssh2*" billchurch/webssh2:bigip-server

Documentation is kind of all over the place, and probably incomplete but you can look at the READMEs of the two repos:

The idea here is we can fork off webssh2_client for different frameworks and point them to the server instance...

Does that make sense? Let me know what you think.

@umardraz
Copy link
Author

umardraz commented Aug 20, 2024

Well I had integrated your old web2ssh into my vue app. In my app I am simply open the iframe and using token instead of any html form for username, hostname or password. The Vue app on the fly get the token from python api.

http://localhost:2222/ssh/host?token=${newToken}

then in web2ssh/server/app.js, I had modified the following to use that token


//app.get('/ssh/host/:host?', (req, res) => {
app.get('/ssh/host', (req, res) => {

  const token = req.query.token;

  if (!token) {
    return res.status(400).send('Token is required');
  }
  try {
    const decoded = jwt.verify(token, 'token_secret');

      req.session.username = decoded.user,
      req.session.userpassword = decoded.password,
      req.session.privatekey = decoded.privatekey,

      res.sendFile(path.join(path.join(publicPath, 'client.htm')));
      
      // capture, assign, and validate variables
      req.session.ssh = {
        host: decoded.host,
        port: decoded.port,
        localAddress: '',
        localPort: '',
        header: {
          name: req.query.header || config.header.text,
          background: req.query.headerBackground || config.header.background,
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants