diff --git a/AUTHORS.txt b/AUTHORS.txt index d71a158..c2ddc07 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -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/ diff --git a/bin/linspector b/bin/linspector index df9826d..1249e8e 100755 --- a/bin/linspector +++ b/bin/linspector @@ -2,25 +2,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . 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 diff --git a/bin/lish b/bin/lish index eaccd7a..fccacfe 100755 --- a/bin/lish +++ b/bin/lish @@ -2,26 +2,13 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . 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 ' +# 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') diff --git a/bin/litui b/bin/litui new file mode 100644 index 0000000..e26c513 --- /dev/null +++ b/bin/litui @@ -0,0 +1,9 @@ +#!/usr/bin/python3 -d +""" +This file is part of Linspector (https://linspector.org/) +Copyright (c) 2023 Johannes Findeisen . 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. diff --git a/linspector/core/configuration.py b/linspector/core/configuration.py index 8eb2cb3..17656f2 100644 --- a/linspector/core/configuration.py +++ b/linspector/core/configuration.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import configparser import glob diff --git a/linspector/core/environment.py b/linspector/core/environment.py index 481cee4..be38211 100644 --- a/linspector/core/environment.py +++ b/linspector/core/environment.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ diff --git a/linspector/core/linspector.py b/linspector/core/linspector.py index 6f02dce..34ee785 100644 --- a/linspector/core/linspector.py +++ b/linspector/core/linspector.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import datetime import importlib diff --git a/linspector/core/linspectord.py b/linspector/core/linspectord.py index bfdff8c..1b6c9c7 100644 --- a/linspector/core/linspectord.py +++ b/linspector/core/linspectord.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import atexit import os diff --git a/linspector/core/logger.py b/linspector/core/logger.py index d7a1037..63e9126 100644 --- a/linspector/core/logger.py +++ b/linspector/core/logger.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import logging import os diff --git a/linspector/core/model.py b/linspector/core/model.py index afa7557..e597553 100644 --- a/linspector/core/model.py +++ b/linspector/core/model.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ diff --git a/linspector/core/monitor.py b/linspector/core/monitor.py index 9d1a54e..e51db73 100644 --- a/linspector/core/monitor.py +++ b/linspector/core/monitor.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import configparser import hashlib diff --git a/linspector/core/monitors.py b/linspector/core/monitors.py index 6826a83..6712302 100644 --- a/linspector/core/monitors.py +++ b/linspector/core/monitors.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import configparser import copy diff --git a/linspector/core/notification.py b/linspector/core/notification.py index 04e0f0f..229b2ef 100644 --- a/linspector/core/notification.py +++ b/linspector/core/notification.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ diff --git a/linspector/core/plugin.py b/linspector/core/plugin.py index e7cd9a9..f73be74 100644 --- a/linspector/core/plugin.py +++ b/linspector/core/plugin.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ diff --git a/linspector/core/service.py b/linspector/core/service.py index 5f1da34..9d5e9c4 100644 --- a/linspector/core/service.py +++ b/linspector/core/service.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ diff --git a/linspector/core/singleton.py b/linspector/core/singleton.py index f152564..a84003c 100644 --- a/linspector/core/singleton.py +++ b/linspector/core/singleton.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ #see http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern diff --git a/linspector/core/task.py b/linspector/core/task.py index f8f0ec7..259b504 100644 --- a/linspector/core/task.py +++ b/linspector/core/task.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from queue import Queue from threading import Event, Thread diff --git a/linspector/notifications/call.py b/linspector/notifications/call.py index eaf7c9c..689156a 100644 --- a/linspector/notifications/call.py +++ b/linspector/notifications/call.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.notification import Notification diff --git a/linspector/notifications/email.py b/linspector/notifications/email.py index 27ca6e8..ff9bc10 100644 --- a/linspector/notifications/email.py +++ b/linspector/notifications/email.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.notification import Notification diff --git a/linspector/notifications/sms.py b/linspector/notifications/sms.py index 03e8615..8bd0215 100644 --- a/linspector/notifications/sms.py +++ b/linspector/notifications/sms.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import gammu diff --git a/linspector/notifications/twitter.py b/linspector/notifications/twitter.py index 0bb6768..ef42f07 100644 --- a/linspector/notifications/twitter.py +++ b/linspector/notifications/twitter.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.notification import Notification diff --git a/linspector/notifications/xmpp.py b/linspector/notifications/xmpp.py index 473f6a5..3fd24fa 100644 --- a/linspector/notifications/xmpp.py +++ b/linspector/notifications/xmpp.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import xmpp diff --git a/linspector/plugins/backendapi.py b/linspector/plugins/backendapi.py new file mode 100644 index 0000000..4516700 --- /dev/null +++ b/linspector/plugins/backendapi.py @@ -0,0 +1,8 @@ +""" +This file is part of Linspector (https://linspector.org/) +Copyright (c) 2023 Johannes Findeisen . 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. \ No newline at end of file diff --git a/linspector/plugins/httpserver.py b/linspector/plugins/httpserver.py index ebfd609..a58d176 100644 --- a/linspector/plugins/httpserver.py +++ b/linspector/plugins/httpserver.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import cherrypy import json diff --git a/linspector/plugins/rpc.py b/linspector/plugins/rpc.py index 0bdb492..9903bf8 100644 --- a/linspector/plugins/rpc.py +++ b/linspector/plugins/rpc.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.plugin import Plugin diff --git a/linspector/services/http/httpkeyword.py b/linspector/services/http/httpkeyword.py index f12101c..ac090ff 100644 --- a/linspector/services/http/httpkeyword.py +++ b/linspector/services/http/httpkeyword.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.service import Service diff --git a/linspector/services/misc/dummy.py b/linspector/services/misc/dummy.py index b644c1f..a47e76a 100644 --- a/linspector/services/misc/dummy.py +++ b/linspector/services/misc/dummy.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.service import Service diff --git a/linspector/services/misc/random.py b/linspector/services/misc/random.py index 50cdba5..4f787c8 100644 --- a/linspector/services/misc/random.py +++ b/linspector/services/misc/random.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.service import Service diff --git a/linspector/services/net/fritzboxphonestatus.py b/linspector/services/net/fritzboxphonestatus.py index 6e27d6c..baa5629 100644 --- a/linspector/services/net/fritzboxphonestatus.py +++ b/linspector/services/net/fritzboxphonestatus.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT) +See LICENSE.txt (MIT license). """ from fritzconnection.lib.fritzstatus import FritzStatus diff --git a/linspector/services/net/fritzboxuplink.py b/linspector/services/net/fritzboxuplink.py index 412cf3d..29b0916 100644 --- a/linspector/services/net/fritzboxuplink.py +++ b/linspector/services/net/fritzboxuplink.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT) +See LICENSE.txt (MIT license). """ from fritzconnection.lib.fritzstatus import FritzStatus diff --git a/linspector/services/net/ping.py b/linspector/services/net/ping.py index b9e2e22..c2c1026 100644 --- a/linspector/services/net/ping.py +++ b/linspector/services/net/ping.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.service import Service diff --git a/linspector/services/net/port.py b/linspector/services/net/port.py index 2e3f6f7..d6e6105 100644 --- a/linspector/services/net/port.py +++ b/linspector/services/net/port.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import socket diff --git a/linspector/services/net/speedtest.py b/linspector/services/net/speedtest.py index 01ba029..a8dc64c 100644 --- a/linspector/services/net/speedtest.py +++ b/linspector/services/net/speedtest.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import calendar import requests diff --git a/linspector/services/net/ssh.py b/linspector/services/net/ssh.py index 329c333..51eee74 100644 --- a/linspector/services/net/ssh.py +++ b/linspector/services/net/ssh.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ import os import paramiko diff --git a/linspector/services/net/tcpconnect.py b/linspector/services/net/tcpconnect.py index 951c906..7e03f74 100644 --- a/linspector/services/net/tcpconnect.py +++ b/linspector/services/net/tcpconnect.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.service import Service diff --git a/linspector/services/snmp/get.py b/linspector/services/snmp/get.py index c2b1227..e104544 100644 --- a/linspector/services/snmp/get.py +++ b/linspector/services/snmp/get.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from pysnmp.entity.rfc3413.oneliner import cmdgen diff --git a/linspector/tasks/csv.py b/linspector/tasks/csv.py index e9896ef..eafcaeb 100644 --- a/linspector/tasks/csv.py +++ b/linspector/tasks/csv.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.task import Task diff --git a/linspector/tasks/file.py b/linspector/tasks/file.py index ebcaafc..1b7e695 100644 --- a/linspector/tasks/file.py +++ b/linspector/tasks/file.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.task import Task diff --git a/linspector/tasks/mariadb.py b/linspector/tasks/mariadb.py index 12bd4a6..a62829a 100644 --- a/linspector/tasks/mariadb.py +++ b/linspector/tasks/mariadb.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.task import Task diff --git a/linspector/tasks/redis.py b/linspector/tasks/redis.py index 6562e5f..0e8e7fc 100644 --- a/linspector/tasks/redis.py +++ b/linspector/tasks/redis.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.task import Task diff --git a/linspector/tasks/splunk.py b/linspector/tasks/splunk.py index 979ac06..bc3b6d7 100644 --- a/linspector/tasks/splunk.py +++ b/linspector/tasks/splunk.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2023 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.task import Task diff --git a/linspector/tasks/sqlite.py b/linspector/tasks/sqlite.py index f6ea0b6..725d7d6 100644 --- a/linspector/tasks/sqlite.py +++ b/linspector/tasks/sqlite.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.task import Task diff --git a/linspector/tasks/syslog.py b/linspector/tasks/syslog.py index 277099f..7cb8f84 100644 --- a/linspector/tasks/syslog.py +++ b/linspector/tasks/syslog.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2023 Johannes Findeisen . All Rights Reserved. -See LICENSE (MIT license) +See LICENSE.txt (MIT license). """ from linspector.core.task import Task diff --git a/requirements.txt b/requirements.txt index afd63eb..9dffd4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file