Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launcher scripts / deprecate mail param / increase RSA key size #46

Merged
merged 8 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions jarbas_hive_mind/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from jarbas_hive_mind import get_listener
from jarbas_hive_mind.configuration import CONFIGURATION

def main():
import argparse
parser = argparse.ArgumentParser(description='Start HiveMind as a server')
parser.add_argument("--name", help="human readable name")
parser.add_argument("--access_key", help="access key")
parser.add_argument("--crypto_key", help="payload encryption key")
parser.add_argument("--mail", help="human readable mail")
Joanguitar marked this conversation as resolved.
Show resolved Hide resolved
parser.add_argument("--port", help="HiveMind port number")
args = parser.parse_args()
# Check if a user was defined
if args.name is not None:
from jarbas_hive_mind.database import ClientDatabase
with ClientDatabase() as db:
db.add_client(args.name, args.mail, args.access_key, crypto_key=args.crypto_key)
Joanguitar marked this conversation as resolved.
Show resolved Hide resolved
config = CONFIGURATION
listener = get_listener()
listener.load_config(config)
# Replace defined values
if args.port is not None:
listener.port = int(args.port)
listener.listen()

if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion jarbas_hive_mind/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def create_self_signed_cert(cert_dir=CERTS_PATH, name="jarbas_hivemind"):
or not exists(join(cert_dir, KEY_FILE)):
# create a key pair
k = crypto.PKey()
k.generate_key(crypto.TYPE_RSA, 1024)
k.generate_key(crypto.TYPE_RSA, 2048)

# create a self-signed cert
cert = crypto.X509()
Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='jarbas_hive_mind',
version='0.10.8',
version='0.10.9',
packages=['jarbas_hive_mind',
'jarbas_hive_mind.nodes',
'jarbas_hive_mind.configuration',
Expand All @@ -27,5 +27,10 @@
license='MIT',
author='jarbasAI',
author_email='[email protected]',
description='Mesh Networking utilities for mycroft core'
description='Mesh Networking utilities for mycroft core',
entry_points={
'console_scripts': [
'HiveMind-server=jarbas_hive_mind.__main__:main'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a HiveMind-database script to handle registering/modifying/deleting clients would be a good next step? for now only with the functionality to add a client like above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking on a web interface, but a script is necessary too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a web interface has been discussed previously but never got off the idea stage, if this is something you are interested in doing I will gladly review and recommend it in the wiki!

]
}
)