Giter VIP home page Giter VIP logo

ssht's People

Contributors

casdr avatar dependabot[bot] avatar hkraal avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

casdr

ssht's Issues

JSON API source

I don't like the idea of talking to the MySQL server directly from my local machine, so I would like to be able to use an API for the source with an option to set headers (authentication).

{
  "url": "https://api.local/hosts",
  "headers": [
    "X-Auth-Token": "bla"
  ]
}

Handle parser timeouts

When using the MySQL parser which connects to a host which isn't reachable from other locations ssht will stall without feedback to the user, this needs to be improved.

Use more fields for searching

Searching based on IP does not yield any result. Although it's not very useful ssht <ip> it should be possible since;

  • a user might be tempted to use ssht instead of ssh
  • a user might want to get feedback about the server it's connecting to

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Invalid JSON file format raises exception

Traceback (most recent call last):
  File "/usr/local/bin/ssht", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/ssht/ssht.py", line 75, in main
    jsonparser = JsonParser(os.path.join(home_dir, '.ssht'))
  File "/usr/local/lib/python2.7/dist-packages/ssht/plugins.py", line 64, in __init__
    self._load_data()
  File "/usr/local/lib/python2.7/dist-packages/ssht/plugins.py", line 79, in _load_data
    except json.decoder.JSONDecodeError as ex:
AttributeError: 'module' object has no attribute 'JSONDecodeError'

Refactor config for multiple sources

I would like to be able to set multiple sources for the hosts, my suggestion is to make the config like this:

{
  "sources": [
    {
      "type": "mysql",
      "host": "localhost",
      "user": "username",
      "password": "password",
      "database": "infra1",
      "query": "SELECT hostname, port, ipv4, ipv6, user FROM servers"
    },
    {
      "type": "mysql",
      "host": "localhost",
      "user": "username",
      "password": "password",
      "database": "infra2",
      "query": "SELECT hostname, port, ipv4, ipv6, user FROM servers"
    }
  ]
}

Cleanup project

  • The main() function has too many local variables and should be split up in smaller parts.
  • Remove the unused Host.__repr__ code.
  • Remove the need to pass *args, **kwargs to each parser by implementing a Config class.

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.