diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/initialisation.py b/initialisation.py new file mode 100755 index 0000000..9ebe637 --- /dev/null +++ b/initialisation.py @@ -0,0 +1,18 @@ +#!/usr/bin/python3 +import ressenger_exceptions +import pathlib + +def initialise(password, username='default', force=False): + profile_path=pathlib.Path('~/.ressenger/').expanduser() + if profile_path.exists(): + if (profile_path.is_file() or profile_path.is_symlink()): + if force: + profile_path.unlink() + else: + raise FileExistsError('Cannot create ~/.ressenger/ folder, is a file exists there?') + profile_path.mkdir(parents=True, exist_ok=True) + + +if __name__=="__main__": + initialise(password=input("Please set up a password for encryption: ")) + exit() diff --git a/ressenger_cryptography.py b/ressenger_cryptography.py new file mode 100644 index 0000000..a93a4bf --- /dev/null +++ b/ressenger_cryptography.py @@ -0,0 +1 @@ +#!/usr/bin/python3 diff --git a/ressenger_exceptions.py b/ressenger_exceptions.py new file mode 100755 index 0000000..a25f4de --- /dev/null +++ b/ressenger_exceptions.py @@ -0,0 +1,4 @@ +#!/usr/bin/python3 + +class InitialisationError(Exception): + pass diff --git a/server.py b/server.py new file mode 100755 index 0000000..37936fd --- /dev/null +++ b/server.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 +import socket, pickle, os, pathlib + + + +def start_server(host='localhost', port=5273): + server_socket=socket.socket(socket.AF_INET, socket=SOCK_STREAM) + server_socket.bind((host, port)) + server_socket.listen(1) + print(f"Listening on {host}:{port}...") + while True: + client_socket, client_address=server_socket.accept() + +def main(): + pass + +if __name__=="__main__": + main() + exit()