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

Package the chatroom server in an executable binary #56

Open
gridhead opened this issue Sep 29, 2020 · 10 comments · May be fixed by #66
Open

Package the chatroom server in an executable binary #56

gridhead opened this issue Sep 29, 2020 · 10 comments · May be fixed by #66
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Contribute to the notion of open-source this October!

Comments

@gridhead
Copy link
Member

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

@gridhead gridhead added enhancement New feature or request good first issue Good for newcomers hacktoberfest Contribute to the notion of open-source this October! labels Sep 29, 2020
@CptOrange16
Copy link

Hello, can i take on this issue?

@CptOrange16
Copy link

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

@gridhead gridhead changed the title Package the assets of the project in an executable binary Package the chatroom server in an executable binary Sep 30, 2020
@gridhead
Copy link
Member Author

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! 😄

@amaank404
Copy link
Contributor

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

@amaank404
Copy link
Contributor

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

@amaank404
Copy link
Contributor

4 issues will be solved

@CptOrange16
Copy link

@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
Copy link
Member Author

gridhead commented Oct 2, 2020

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
Copy link
Member Author

gridhead commented Oct 2, 2020

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
Copy link

@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):

  • On windows: binary.exe -s 6969-c 9696-4
  • On Linux: ./binary -s 6969-c 9696-4

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 👍 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Contribute to the notion of open-source this October!
Projects
None yet
3 participants