Code Monkey home page Code Monkey logo

Comments (10)

antoniomika avatar antoniomika commented on May 8, 2024 1

Hi @fork04! Thanks for the issue! Do you have any ideas about how this information should be exposed/what type of APi semantics should be used? My immediate thought was to add it as part of the web handler and just have an APi key passed as part of the commandline. The endpoint would then just serve raw JSOn with the data

from sish.

BenHarris avatar BenHarris commented on May 8, 2024 1

Like the idea @fork04! We could even build a little web-based dashboard to poll and show the stats along the lines of https://demo.nginx.com/

@antoniomika, web handler sounds good to me. I think we would be best to start with:

  • General stats
  • List active tunnels
  • Tunnel info
  • Kill tunnel

My only slight concern with the others is that we will probably need to implement some data storage, which increases the general complexity a little. I guess we could just have some memory allocated to logs and just rotate them, although it raises the question of whether it should persist restarts.

from sish.

fork04 avatar fork04 commented on May 8, 2024

If someone wants to persist sish container logs , they can use docker "built-in" feature, for example:
docker run --log-driver syslog --log-opt syslog-address=udp://1.2.3.4:1111 [...]

from sish.

BenHarris avatar BenHarris commented on May 8, 2024

Yeah, of course. Are you thinking they should simply be output as per the current logging, as opposed to an API approach then?

from sish.

fork04 avatar fork04 commented on May 8, 2024

I think that the current loging system is sufficient, my proposal is rather to expand the application's operating parameters stored in memory, and make them available via API.
This data can later be used both as JSON from the console level and to build a simple web-based interface.

from sish.

antoniomika avatar antoniomika commented on May 8, 2024

I think we can actually get away with not needing a local datastore. My thought is we wouldn't store any requests as part of the stack and only stream those to any connected client. That would definitely make it less complex. The way I think this would work is as so:

  1. Websocket handler that streams requests in real time to the web client
  2. API methods to list and disconnect connections
  3. API handler at something like /_sish/console for each HTTP service. This would be protected by HTTP basic auth or a token created when the tunnel is made and then sent as output with all of the other tunnel output.
  4. A global /_sish/console that can be used by the sish service operator to see all of the connected services, all of the logs for each service, and the ability to disconnect clients or only select services for each client. This could be accessed by a token or httpbasic auth creds that are supplied at program runtime.

Love to hear your opinions on this. I have some downtime tomorrow that I think I could get a decent amount of this implemented.

from sish.

fork04 avatar fork04 commented on May 8, 2024

@antoniomika - for me, it`s great solution!

from sish.

antoniomika avatar antoniomika commented on May 8, 2024

@fork04 I have a PR up that implements the APIs necessary and the routes for the services. The "frontend" is extremely crude and is definitely not a production ready service, but it'll get the job done temporarily. I don't have time to work on a proper frontend, but if someone else is interested it is very easy to do. The docker image tag to play with the features is 1ceea74541767d659a91f1dd3257502134e25195

from sish.

fork04 avatar fork04 commented on May 8, 2024

Thanks for this PR @antoniomika!, in fact the interface needs some refinement but it doesn't look like much work to do. I will test the solution and propose corrections as far as I can.

from sish.

antoniomika avatar antoniomika commented on May 8, 2024

Thanks @fork04! Let's track things to fix on this issue. Something I found is that I need to fix gzip decoding when running behind a reverse proxy in my use on my production service.

from sish.

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.