Tons of fixes, improvements and ideas...

This commit is contained in:
Johannes Findeisen 2023-02-03 04:17:40 +01:00
commit d7192913e0
44 changed files with 71 additions and 78 deletions

View file

@ -2,5 +2,4 @@
Role: Founder, developer and maintainer Role: Founder, developer and maintainer
Email: you@hanez.org Email: you@hanez.org
Homepage: https://hanez.org/ Homepage: https://hanez.org/
Git: https://git.unixpeople.org/hanez
GitHub: https://github.com/hanez/ GitHub: https://github.com/hanez/

View file

@ -2,25 +2,9 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license).
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.
""" """
# TODO: VERY IMPORTANT! IMPLEMENT ERROR HANDLING ALL THE WAY...!!!
import argparse import argparse
import sys import sys

View file

@ -2,26 +2,13 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license).
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.
""" """
# TODO: Make use of the "rich" library to for rich text and beautiful formatting in the terminal.
import argparse 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
import logging.handlers import logging.handlers
import os import os
@ -41,12 +28,17 @@ __version__ = '0.0.1.dev1'
__author__ = 'Johannes Findeisen <you@hanez.org>' __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(): def parse_args():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='lish is part of the linspector project and is a CLI client to connect to a ' description='lish is part of the linspector project and is a shell style client for '
'linspector instance configured to load the rpc plugin for remote connections.', 'connecting to a linspector instance configured to load the rpc plugin for '
'remote connections.',
epilog='author: ' + __author__, epilog='author: ' + __author__,
prog='linspector') prog='lish')
parser.add_argument('host', metavar='HOST', parser.add_argument('host', metavar='HOST',
help='the configuration path to use') help='the configuration path to use')

9
bin/litui Normal file
View 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.

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import configparser import configparser
import glob import glob

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import datetime import datetime
import importlib import importlib

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import atexit import atexit
import os import os

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import logging import logging
import os import os

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import configparser import configparser
import hashlib import hashlib

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import configparser import configparser
import copy import copy

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 #see http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 queue import Queue
from threading import Event, Thread from threading import Event, Thread

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.notification import Notification

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.notification import Notification

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import gammu import gammu

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.notification import Notification

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import xmpp import xmpp

View 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.

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import cherrypy import cherrypy
import json import json

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.plugin import Plugin

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.service import Service

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.service import Service

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.service import Service

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from fritzconnection.lib.fritzstatus import FritzStatus

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from fritzconnection.lib.fritzstatus import FritzStatus

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.service import Service

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import socket import socket

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import calendar import calendar
import requests import requests

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE (MIT license) See LICENSE.txt (MIT license).
""" """
import os import os
import paramiko import paramiko

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.service import Service

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from pysnmp.entity.rfc3413.oneliner import cmdgen

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.task import Task

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.task import Task

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.task import Task

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.task import Task

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.task import Task

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.task import Task

View file

@ -1,7 +1,7 @@
""" """
This file is part of Linspector (https://linspector.org/) This file is part of Linspector (https://linspector.org/)
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved. 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 from linspector.core.task import Task

View file

@ -9,6 +9,7 @@ paramiko==3.0.0
pysnmp==4.4.12 pysnmp==4.4.12
requests==2.28.2 requests==2.28.2
rich==13.3.1 rich==13.3.1
syslog2==0.5.0
textual==0.10.1 textual==0.10.1
typer==0.7.0 typer==0.7.0
xmpp2==0.4 xmpp2==0.4