Added license and made a few more packaging tweaks.

This commit is contained in:
Aaron Heise 2023-02-10 22:34:32 -06:00
parent ce225dfbcd
commit ec5f9a0157
9 changed files with 203 additions and 54 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
# MIT License
#
# Copyright (c) 2023 Aaron Heise
#
# 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 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.

View File

@ -1,7 +1,7 @@
# `r n s h` Shell over Reticulum # `r n s h`  Shell over Reticulum
`rnsh` is a utility written in Python that facilitates opening `rnsh` is a utility written in Python that facilitates shell
shell sessions over Reticulum networks. It is based off the `rnx` sessions over Reticulum networks. It is based off the `rnx`
utility that ships with Reticulum. utility that ships with Reticulum.
`rnsh` is still pretty raw; there are some things that are `rnsh` is still pretty raw; there are some things that are
@ -12,26 +12,22 @@ out.
## Quickstart ## Quickstart
`rnsh` isn't quite ready to be available on pip, but it will be. Requires Python 3.11+ on Linux or Unix. WSL probably works. Cygwin might work, too.
For the folks who are brave enough to try it now, you'll need
Python 3.11. Clone this repo, start a venv, and install a few
packages (I'll keep adding them as I remember more things I
installed)
- psutil - Activate a virtualenv
- docopt - `pip3 install rnsh`
- RNS (from source, at least one pre-release feature is used) - Or from a `whl` release, `pip3 install /path/to/rnsh-0.0.1-py3-none-any.whl`
- Configure Reticulum interfaces, check with `rnstatus`
Then you can run it in using - Ready to run `rnsh`. The options are shown below.
`python <path_to_rnsh>/rnsh.py <options>`
``` ```
Usage: Usage:
rnsh [--config <configdir>] [-i <identityfile>] [-s <service_name>] [-l] -p rnsh [--config <configdir>] [-i <identityfile>] [-s <service_name>] [-l] -p
rnsh -l [--config <configfile>] [-i <identityfile>] [-s <service_name>] [-v...] [-q...] [-b] rnsh -l [--config <configfile>] [-i <identityfile>] [-s <service_name>]
(-n | -a <identity_hash> [-a <identity_hash>]...) [--] <program> [<arg>...] [-v...] [-q...] [-b] (-n | -a <identity_hash> [-a <identity_hash>]...)
rnsh [--config <configfile>] [-i <identityfile>] [-s <service_name>] [-v...] [-q...] [-N] [-m] [--] <program> [<arg>...]
[-w <timeout>] <destination_hash> rnsh [--config <configfile>] [-i <identityfile>] [-s <service_name>]
[-v...] [-q...] [-N] [-m] [-w <timeout>] <destination_hash>
rnsh -h rnsh -h
rnsh --version rnsh --version
@ -51,44 +47,45 @@ Options:
-q --quiet Increase quietness -q --quiet Increase quietness
--version Show version --version Show version
-h --help Show this help -h --help Show this help
``` ```
## How it works ## How it works
### Listeners
Listener instances are the servers. Each listener is configured
with an RNS identity, and a service name. Together, RNS makes
these into a destination hash that can be used to connect to
your listener.
Multiple listeners can use the same identity. As long as
they are given different service names. They will have
different destination hashes and not conflict.
1. Set up one or more listeners. Each listener is configured Listeners must be configured with a command line to run (at
with an RNS identity, and a service name. Together, RNS makes least at this time). The identity hash string is set in the
these into a destination hash that can be used to connect to environment variable RNS_REMOTE_IDENTITY for use in child
your listener. programs.
Listeners are set up using the `-l` flag.
Multiple listeners can use the same identity. As long as ### Initiators
they are given different service names. They will have Initiators are the clients. Each initiator has an identity
different destination hashes and not conflict. hash which is used as an authentication mechanism on Reticulum.
You'll need this value to configure the listener to allow
Listeners must be configured with a command line to run (at your connection. It is possible to run the server without
least at this time). The identity hash string is set in the authentication, but hopefully it's obvious that this is an
environment variable RNS_REMOTE_IDENTITY for use in child advanced use case.
programs.
Listeners are set up using the `-l` flag.
2. Set up your initiator (client) and get the identity hash.
You'll need this value to configure the listener to allow
your connection. It is possible to run the server without
authentication, but hopefully it's obvious that this is an
advanced use case.
To get the identity hash, use the `-p` flag. To get the identity hash, use the `-p` flag.
With the initiator identity set up in the listener command With the initiator identity set up in the listener command
line, and with the listener identity copied (you'll need to line, and with the listener identity copied (you'll need to
do `-p` on the listener side, too), you can run the do `-p` on the listener side, too), you can run the
initiator. initiator.
I recommend staying pretty vanilla to start with and I recommend staying pretty vanilla to start with and
trying `/bin/zsh` or whatever your favorite shell is these trying `/bin/zsh` or whatever your favorite shell is these
days. The shell should start in login mode. Ideally it days. The shell should start in login mode. Ideally it
works just like an `ssh` shell session. works just like an `ssh` shell session.
## Roadmap ## Roadmap
1. Plan a better roadmap 1. Plan a better roadmap

View File

@ -1 +1,21 @@
# package # MIT License
#
# Copyright (c) 2023 Aaron Heise
#
# 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 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.

View File

@ -1 +1,23 @@
# MIT License
#
# Copyright (c) 2023 Aaron Heise
#
# 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 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.
__version__ = "0.0.1" __version__ = "0.0.1"

View File

@ -1,3 +1,25 @@
# MIT License
#
# Copyright (c) 2023 Aaron Heise
#
# 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 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 asyncio
import contextlib import contextlib
import errno import errno
@ -365,7 +387,7 @@ async def main():
A test driver for the CallbackProcess class. A test driver for the CallbackProcess class.
python ./process.py /bin/zsh --login python ./process.py /bin/zsh --login
""" """
import testlogging import rnsh.testlogging
log = module_logger.getChild("main") log = module_logger.getChild("main")
if len(sys.argv) <= 1: if len(sys.argv) <= 1:

View File

@ -1,3 +1,25 @@
# MIT License
#
# Copyright (c) 2023 Aaron Heise
#
# 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 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 asyncio
import logging import logging
import threading import threading

View File

@ -791,10 +791,11 @@ async def main():
usage = ''' usage = '''
Usage: Usage:
rnsh [--config <configdir>] [-i <identityfile>] [-s <service_name>] [-l] -p rnsh [--config <configdir>] [-i <identityfile>] [-s <service_name>] [-l] -p
rnsh -l [--config <configfile>] [-i <identityfile>] [-s <service_name>] [-v...] [-q...] [-b] rnsh -l [--config <configfile>] [-i <identityfile>] [-s <service_name>]
(-n | -a <identity_hash> [-a <identity_hash>]...) [--] <program> [<arg>...] [-v...] [-q...] [-b] (-n | -a <identity_hash> [-a <identity_hash>]...)
rnsh [--config <configfile>] [-i <identityfile>] [-s <service_name>] [-v...] [-q...] [-N] [-m] [--] <program> [<arg>...]
[-w <timeout>] <destination_hash> rnsh [--config <configfile>] [-i <identityfile>] [-s <service_name>]
[-v...] [-q...] [-N] [-m] [-w <timeout>] <destination_hash>
rnsh -h rnsh -h
rnsh --version rnsh --version

View File

@ -1,3 +1,25 @@
# MIT License
#
# Copyright (c) 2023 Aaron Heise
#
# 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 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 logging import logging
from logging import Handler, getLevelName from logging import Handler, getLevelName
from types import GenericAlias from types import GenericAlias

View File

@ -1,3 +1,25 @@
# MIT License
#
# Copyright (c) 2023 Aaron Heise
#
# 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 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 logging as __logging import logging as __logging
import os import os