Tons of fixes, improvements and ideas...
This commit is contained in:
parent
c7b276056c
commit
d7192913e0
44 changed files with 71 additions and 78 deletions
|
|
@ -2,5 +2,4 @@
|
|||
Role: Founder, developer and maintainer
|
||||
Email: you@hanez.org
|
||||
Homepage: https://hanez.org/
|
||||
Git: https://git.unixpeople.org/hanez
|
||||
GitHub: https://github.com/hanez/
|
||||
|
|
|
|||
|
|
@ -2,25 +2,9 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
# TODO: VERY IMPORTANT! IMPLEMENT ERROR HANDLING ALL THE WAY...!!!
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
|
|
|
|||
34
bin/lish
34
bin/lish
|
|
@ -2,26 +2,13 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
# TODO: Make use of the "rich" library to for rich text and beautiful formatting in the terminal.
|
||||
import argparse
|
||||
# TODO: Remove logging in the client and barf output to the terminal directly in Lish. Implement a
|
||||
# verbose mode for this to suppress messages by default but create something like log levels which
|
||||
# can be enabled at program start.
|
||||
import logging
|
||||
import logging.handlers
|
||||
import os
|
||||
|
|
@ -41,12 +28,17 @@ __version__ = '0.0.1.dev1'
|
|||
__author__ = 'Johannes Findeisen <you@hanez.org>'
|
||||
|
||||
|
||||
# TODO: Replace all the code below! For now this is just a copy of Linspector code which makes no
|
||||
# sense for a Shell style client. Best would be if Lish will become a 100% standalone program
|
||||
# without making use of the daemon code and the it maybe makes sense to make an own project for
|
||||
# this. This also applies to the litui client but Lish and Litui can share the same backend.
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='lish is part of the linspector project and is a CLI client to connect to a '
|
||||
'linspector instance configured to load the rpc plugin for remote connections.',
|
||||
description='lish is part of the linspector project and is a shell style client for '
|
||||
'connecting to a linspector instance configured to load the rpc plugin for '
|
||||
'remote connections.',
|
||||
epilog='author: ' + __author__,
|
||||
prog='linspector')
|
||||
prog='lish')
|
||||
|
||||
parser.add_argument('host', metavar='HOST',
|
||||
help='the configuration path to use')
|
||||
|
|
|
|||
9
bin/litui
Normal file
9
bin/litui
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/python3 -d
|
||||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE.txt for more details.
|
||||
"""
|
||||
# TODO: Make this a curses style TUI interface for Linspector using urwid or maybe some more modern
|
||||
# framework like textual. Look at the Lish code for more details about backend implementation and
|
||||
# the general idea for implementing Linspector clients.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import configparser
|
||||
import glob
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import datetime
|
||||
import importlib
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import atexit
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import logging
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import configparser
|
||||
import hashlib
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import configparser
|
||||
import copy
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
|
||||
#see http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from queue import Queue
|
||||
from threading import Event, Thread
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.notification import Notification
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.notification import Notification
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import gammu
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.notification import Notification
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import xmpp
|
||||
|
||||
|
|
|
|||
8
linspector/plugins/backendapi.py
Normal file
8
linspector/plugins/backendapi.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
# TODO: Make this a backend API using the modern FastAPI framework as a replacement for the
|
||||
# traditional RPC plugin. Maybe it makes sense to maintain the RPC plugin too for simple usage by
|
||||
# the Lish but I believe it makes sense to only create one backend for all clients.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import cherrypy
|
||||
import json
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.plugin import Plugin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.service import Service
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.service import Service
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.service import Service
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from fritzconnection.lib.fritzstatus import FritzStatus
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from fritzconnection.lib.fritzstatus import FritzStatus
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.service import Service
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import socket
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import calendar
|
||||
import requests
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
import os
|
||||
import paramiko
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.service import Service
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from pysnmp.entity.rfc3413.oneliner import cmdgen
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.task import Task
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.task import Task
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.task import Task
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.task import Task
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.task import Task
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.task import Task
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
This file is part of Linspector (https://linspector.org/)
|
||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||
See LICENSE (MIT license)
|
||||
See LICENSE.txt (MIT license).
|
||||
"""
|
||||
from linspector.core.task import Task
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ paramiko==3.0.0
|
|||
pysnmp==4.4.12
|
||||
requests==2.28.2
|
||||
rich==13.3.1
|
||||
syslog2==0.5.0
|
||||
textual==0.10.1
|
||||
typer==0.7.0
|
||||
xmpp2==0.4
|
||||
Loading…
Add table
Add a link
Reference in a new issue