From 32a1cdf494e72514682635e63ebff9c62870770b Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 27 Apr 2026 00:12:27 +0200 Subject: [PATCH] Credit Aaron Heise for original rnsh program --- README.md | 1 + RNS/Utilities/rnsh/__init__.py | 20 +++++++++++++++---- RNS/Utilities/rnsh/args.py | 34 +++++++++++++++++++++++++++++++++ RNS/Utilities/rnsh/exception.py | 34 +++++++++++++++++++++++++++++++++ RNS/Utilities/rnsh/helpers.py | 34 +++++++++++++++++++++++++++++++++ RNS/Utilities/rnsh/initiator.py | 22 +++++++++++++++------ RNS/Utilities/rnsh/listener.py | 22 +++++++++++++++------ RNS/Utilities/rnsh/loop.py | 34 +++++++++++++++++++++++++++++++++ RNS/Utilities/rnsh/process.py | 20 +++++++++++++++---- RNS/Utilities/rnsh/protocol.py | 34 +++++++++++++++++++++++++++++++++ RNS/Utilities/rnsh/retry.py | 4 ++-- RNS/Utilities/rnsh/rnsh.py | 22 ++++++++++++++++----- RNS/Utilities/rnsh/session.py | 34 +++++++++++++++++++++++++++++++++ 13 files changed, 288 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 87b3882..bcb49f2 100755 --- a/README.md +++ b/README.md @@ -379,4 +379,5 @@ projects: - [Configobj](https://github.com/DiffSK/configobj) by Michael Foord, Nicola Larosa, Rob Dennis & Eli Courtwright, *BSD License* - [ifaddr](https://github.com/pydron/ifaddr) by Stefan C. Mueller, *MIT License* - [Umsgpack.py](https://github.com/vsergeev/u-msgpack-python) by [Ivan A. Sergeev](https://github.com/vsergeev) +- [rnsh](https://github.com/acehoss/rnsh) by [Aaron Heise](https://github.com/acehoss) - [Python](https://www.python.org) diff --git a/RNS/Utilities/rnsh/__init__.py b/RNS/Utilities/rnsh/__init__.py index cc07f45..376fdfb 100644 --- a/RNS/Utilities/rnsh/__init__.py +++ b/RNS/Utilities/rnsh/__init__.py @@ -1,6 +1,10 @@ -# MIT License +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License # -# Copyright (c) 2023 Aaron Heise +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -9,8 +13,16 @@ # 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 shall be included in all -# copies or substantial portions of the Software. +# - The Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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, diff --git a/RNS/Utilities/rnsh/args.py b/RNS/Utilities/rnsh/args.py index a9ace4c..71a411d 100644 --- a/RNS/Utilities/rnsh/args.py +++ b/RNS/Utilities/rnsh/args.py @@ -1,3 +1,37 @@ +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License +# +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist +# +# 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 Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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. + import argparse import sys diff --git a/RNS/Utilities/rnsh/exception.py b/RNS/Utilities/rnsh/exception.py index 0a2a178..bff7a2c 100644 --- a/RNS/Utilities/rnsh/exception.py +++ b/RNS/Utilities/rnsh/exception.py @@ -1,3 +1,37 @@ +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License +# +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist +# +# 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 Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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. + import contextlib from contextlib import AbstractContextManager import logging diff --git a/RNS/Utilities/rnsh/helpers.py b/RNS/Utilities/rnsh/helpers.py index 35033b8..dd43167 100644 --- a/RNS/Utilities/rnsh/helpers.py +++ b/RNS/Utilities/rnsh/helpers.py @@ -1,3 +1,37 @@ +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License +# +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist +# +# 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 Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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. + import asyncio import time diff --git a/RNS/Utilities/rnsh/initiator.py b/RNS/Utilities/rnsh/initiator.py index c83a442..806d94b 100644 --- a/RNS/Utilities/rnsh/initiator.py +++ b/RNS/Utilities/rnsh/initiator.py @@ -1,8 +1,10 @@ -#!/usr/bin/env python3 - -# MIT License +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License # -# Copyright (c) 2016-2022 Mark Qvist / unsigned.io +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -11,8 +13,16 @@ # 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 shall be included in all -# copies or substantial portions of the Software. +# - The Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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, diff --git a/RNS/Utilities/rnsh/listener.py b/RNS/Utilities/rnsh/listener.py index 5fb4991..f9a1ec9 100644 --- a/RNS/Utilities/rnsh/listener.py +++ b/RNS/Utilities/rnsh/listener.py @@ -1,8 +1,10 @@ -#!/usr/bin/env python3 - -# MIT License +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License # -# Copyright (c) 2016-2022 Mark Qvist / unsigned.io +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -11,8 +13,16 @@ # 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 shall be included in all -# copies or substantial portions of the Software. +# - The Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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, diff --git a/RNS/Utilities/rnsh/loop.py b/RNS/Utilities/rnsh/loop.py index 19f83ba..cf8a2b6 100644 --- a/RNS/Utilities/rnsh/loop.py +++ b/RNS/Utilities/rnsh/loop.py @@ -1,3 +1,37 @@ +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License +# +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist +# +# 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 Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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. + import asyncio import functools from typing import Callable diff --git a/RNS/Utilities/rnsh/process.py b/RNS/Utilities/rnsh/process.py index e0ebce4..6ff79fa 100644 --- a/RNS/Utilities/rnsh/process.py +++ b/RNS/Utilities/rnsh/process.py @@ -1,6 +1,10 @@ -# MIT License +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License # -# Copyright (c) 2023 Aaron Heise +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -9,8 +13,16 @@ # 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 shall be included in all -# copies or substantial portions of the Software. +# - The Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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, diff --git a/RNS/Utilities/rnsh/protocol.py b/RNS/Utilities/rnsh/protocol.py index 3ed20cc..7d94f17 100644 --- a/RNS/Utilities/rnsh/protocol.py +++ b/RNS/Utilities/rnsh/protocol.py @@ -1,3 +1,37 @@ +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License +# +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist +# +# 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 Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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. + from __future__ import annotations import RNS diff --git a/RNS/Utilities/rnsh/retry.py b/RNS/Utilities/rnsh/retry.py index 7bb6b4e..0157669 100644 --- a/RNS/Utilities/rnsh/retry.py +++ b/RNS/Utilities/rnsh/retry.py @@ -1,10 +1,10 @@ # Based on the original rnsh program by Aaron Heise (@acehoss) # https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise -# This version of rnsh is included in RNS under the Reticulum License +# This version of rnsh is included in RNS under the Reticulum License # # Reticulum License # -# Copyright (c) 2016-2025 Mark Qvist +# Copyright (c) 2016-2026 Mark Qvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/RNS/Utilities/rnsh/rnsh.py b/RNS/Utilities/rnsh/rnsh.py index b1ccbde..c915fbe 100644 --- a/RNS/Utilities/rnsh/rnsh.py +++ b/RNS/Utilities/rnsh/rnsh.py @@ -1,8 +1,12 @@ #!/usr/bin/env python3 - -# MIT License # -# Copyright (c) 2016-2022 Mark Qvist / unsigned.io +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License +# +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -11,8 +15,16 @@ # 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 shall be included in all -# copies or substantial portions of the Software. +# - The Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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, diff --git a/RNS/Utilities/rnsh/session.py b/RNS/Utilities/rnsh/session.py index 82b8dfa..debc638 100644 --- a/RNS/Utilities/rnsh/session.py +++ b/RNS/Utilities/rnsh/session.py @@ -1,3 +1,37 @@ +# Based on the original rnsh program by Aaron Heise (@acehoss) +# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise +# This version of rnsh is included in RNS under the Reticulum License +# +# Reticulum License +# +# Copyright (c) 2016-2026 Mark Qvist +# +# 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 Software shall not be used in any kind of system which includes amongst +# its functions the ability to purposefully do harm to human beings. +# +# - The Software shall not be used, directly or indirectly, in the creation of +# an artificial intelligence, machine learning or language model training +# dataset, including but not limited to any use that contributes to the +# training or development of such a model or algorithm. +# +# - The above copyright notice and this permission notice 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. + from __future__ import annotations import contextlib import functools