astrosonic / sanctuary

A secure synchronous lightweight chatroom with zero logging and total transience
GNU General Public License v3.0
54 stars 11 forks source link

Package the chatroom server in an executable binary #56

Open gridhead opened 4 years ago

gridhead commented 4 years ago

Use PyInstaller. Make sure that the binary is compliant to Python 3.8.

CptOrange16 commented 4 years ago

Hello, can i take on this issue?

CptOrange16 commented 4 years ago

What should be packaged in a single executable? The Chatroom server (servchat.py) script only or also the WebSockets Server (chatroom.py)?

gridhead commented 4 years ago

Cool. I will assign you this issue. Be sure to get yourself registered at https://organize.mlh.io/participants/events/4659-hack-astrosonic, our official Hacktoberfest event to stay in touch with the fellow contributors of this project.

The problem statement was a bit vague so I made it precise. You need to package the chatroom server here in an executable binary.

Also, feel free to leave a star on the project - should you find it worth your time. Happy hacking! :smile:

amaank404 commented 4 years ago

Hello, I am a good programmer and can package your project into executables for 2 platforms

It will take 30 minutes for me to make them shall I initiate a pull request regarding that

amaank404 commented 4 years ago

I have added a bunch of files and features for your project

amaank404 commented 4 years ago

4 issues will be solved

CptOrange16 commented 4 years ago

@t0xic0der I've generated a couple of binaries (windows and ubuntu) , but i can not get the server working from the executables. I always get the following error:

 jinja2.exceptions.TemplateNotFound: chatroom.html

It seems that when building the binary there is something missing along the way.

Click for full error description Traceback (most recent call last): File "flask\app.py", line 2464, in __call__ File "flask\app.py", line 2450, in wsgi_app File "flask\app.py", line 1867, in handle_exception File "flask\_compat.py", line 39, in reraise File "flask\app.py", line 2447, in wsgi_app File "flask\app.py", line 1952, in full_dispatch_request File "flask\app.py", line 1821, in handle_user_exception File "flask\_compat.py", line 39, in reraise File "flask\app.py", line 1950, in full_dispatch_request File "flask\app.py", line 1936, in dispatch_request File "servchat.py", line 11, in chatroom File "flask\templating.py", line 138, in render_template File "jinja2\environment.py", line 930, in get_or_select_template File "jinja2\environment.py", line 883, in get_template File "jinja2\environment.py", line 857, in _load_template File "jinja2\loaders.py", line 115, in load File "flask\templating.py", line 59, in get_source File "flask\templating.py", line 81, in _get_source_explained jinja2.exceptions.TemplateNotFound: chatroom.html
gridhead commented 4 years ago

Hi @CptOrange16, the problem is understandable. I had the same issue when I was packaging sysmon. I have listed a potential hint here - take a look.

gridhead commented 4 years ago

Hello, I am a good programmer and can package your project into executables for 2 platforms

* Linux

* Windows

It will take 30 minutes for me to make them shall I initiate a pull request regarding that

Hi @xcodz-dot, this issue has already been assigned to @CptOrange16. You are requested to look for other issues in the organization repository.

CptOrange16 commented 4 years ago

@t0xic0der thanks for the tip, I was missing the configurations on the servchat.py script. I generated 2 binaries: one for windows and one for linux (i used Ubuntu 18.04). They are both running and working as expected. To run use (for example):

I also left the .spec files because even though they have my system path they may be useful to see the configurations needed to generate a binary in the future.

Let me know if there is anything wrong or if you want to add anything else. Also thanks for not closing the issue, it allowed me to learn how to use pyinstaller 👍 .