Run with gunicorn or waitress #14

Open
opened 2023-04-08 19:37:04 -05:00 by W1CDN · 4 comments
Owner

gunicorn will be more secure/stable than the internal Flask server. Use and document.

gunicorn will be more secure/stable than the internal Flask server. Use and document. - https://docs.gunicorn.org/en/stable/run.html
W1CDN added the
enhancement
label 2023-04-08 19:37:04 -05:00
W1CDN changed title from Run with gunicorn to Run with gunicorn or waitress 2023-04-08 19:57:55 -05:00
Author
Owner

It may have been waitress I was thinking of. Example script:

# run.py from https://www.devdungeon.com/content/run-python-wsgi-web-app-waitress
import os
from waitress import serve
from app import app  # Import your app

# Run from the same directory as this script
this_files_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(this_files_dir)

# `url_prefix` is optional, but useful if you are serving app on a sub-dir
# behind a reverse-proxy.
serve(app, host='127.0.0.1', port=5000)
It may have been waitress I was thinking of. Example script: ``` # run.py from https://www.devdungeon.com/content/run-python-wsgi-web-app-waitress import os from waitress import serve from app import app # Import your app # Run from the same directory as this script this_files_dir = os.path.dirname(os.path.abspath(__file__)) os.chdir(this_files_dir) # `url_prefix` is optional, but useful if you are serving app on a sub-dir # behind a reverse-proxy. serve(app, host='127.0.0.1', port=5000) ```
Author
Owner

I think the URL needs to be changed to access from another machine.

I think the URL needs to be changed to access from another machine.
Author
Owner

My issue with getting this going locally is that I am running my digipeater on an SBC behind another machine running yunohost, so getting ports and subdomains lined up is a new challenge for me. Once I figure it out, I'll share what I did.

My issue with getting this going locally is that I am running my digipeater on an SBC behind another machine running yunohost, so getting ports and subdomains lined up is a new challenge for me. Once I figure it out, I'll share what I did.
Author
Owner

I got the reverse proxy figured out.

Now can run in screen with ./start-aprs_api.sh as of 23d52a80da.

I got the reverse proxy figured out. Now can run in screen with `./start-aprs_api.sh` as of 23d52a80dae7c95ca366a88b647d74352dea045c.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: W1CDN/aprs_tool#14
No description provided.