FreeTAKTeam / UI

FreeTAKServer Web User Interface project
MIT License
30 stars 29 forks source link

Args #12

Closed pinztrek closed 3 years ago

pinztrek commented 3 years ago

Implemented command line args for the UI to allow specification of:
target IP address, API Key, UI port, and debug mode

This allows multiple instances of the UI to be active managing multiple servers. No config file edit required.

All changes to add cmd line args is in run.py. Implementation via argparse, which is python recommended approach and easy to use/extend.

Help (-h) option

sudo FLASK_APP=/usr/local/lib/python3.7/dist-packages/FreeTAKServer-UI/run.py python3 /usr/local/lib/python3.7/dist-packages/FreeTAKServer-UI/run.py -h

usage: run.py [-h] [-i IP_ADDRESS] [-k KEY] [-p PORT] [-d]

optional arguments: -h, --help show this help message and exit -i IP_ADDRESS, --ip_address IP_ADDRESS ip address of the target host -k KEY, --key KEY Web Socket key for the UI -p PORT, --port PORT Port for the Web UI HTTP -d, --debug Enable Debug mode

Typical usage:

sudo FLASK_APP=/usr/local/lib/python3.7/dist-packages/FreeTAKServer-UI/run.py python3 /usr/local/lib/python3.7/dist-packages/FreeTAKServer-UI/run.py -i 172.16.30.30 -k NewWebsocketKey -p5001

IP Address override: 172.16.30.30 Web Socket Key override: NewWebsocketKey Web Port override: 5001 (28109) wsgi starting up on http://0.0.0.0:5001

Also added Server & UI IP/Port info to the "About" page

If you are now managing multiple servers, you need an easy way to tell which one your are watching. image Only change is in the template "about.html"

git rm'd error.log

Was properly excluded in .gitignore, but somewhere in the past it had been uploaded to the master branch

pinztrek commented 3 years ago

On April 5, 2021 4:15:52 PM EDT, naman108 @.***> wrote:

Merged #12 into master.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/FreeTAKTeam/UI/pull/12#event-4553231235

Excellent, hope it was useful. Thanks, Alan