RASCSI/src/web
Daniel Markstedt 39c65beb99
Better Pi shutdown handling in Web Interface (#522)
* Add shutdown method

* Use shutdown method

* Use proto shutdown commands; remove old shell commands

* Add explicit monitor_rascsi shutdown

* Better method name

* Add code comment

* Fix bug
2021-12-13 19:37:28 -08:00
..
mock/bin Cleanup rascsi-web mocking for current develop (#301) 2021-10-05 20:39:26 -05:00
pwa RaSCSI logo favicons (#237) 2021-09-19 14:36:43 -07:00
service-infra Updates for running on Bullseye (#469) 2021-11-14 19:34:24 +01:00
static Display image properties inline in the image list, and remove the previous UI 2021-10-23 23:00:40 -07:00
templates Better Pi shutdown handling in Web Interface (#522) 2021-12-13 19:37:28 -08:00
.pylintrc Web UI code cleanup and refactoring (#409) 2021-11-06 19:25:02 -05:00
device_utils.py Web UI code cleanup and refactoring (#409) 2021-11-06 19:25:02 -05:00
drive_properties.json Use a byte size the Floptical driver recognizes. Remove the 21MB profile as it doesn't work. (#492) 2021-11-27 20:22:50 -06:00
file_cmds.py Rename image file in web interface (#521) 2021-12-13 20:50:36 -06:00
pi_cmds.py Better Pi shutdown handling in Web Interface (#522) 2021-12-13 19:37:28 -08:00
ractl_cmds.py Better Pi shutdown handling in Web Interface (#522) 2021-12-13 19:37:28 -08:00
README.md Web UI code cleanup and refactoring (#409) 2021-11-06 19:25:02 -05:00
requirements.txt User authentication in the Web Interface (#483) 2021-11-26 22:41:10 -06:00
settings.py User authentication in the Web Interface (#483) 2021-11-26 22:41:10 -06:00
socket_cmds.py Resolve pylint warnings (#488) 2021-11-27 14:11:59 -06:00
start.sh Pipe only stdout to /dev/null when checking pip return code (#517) 2021-12-12 18:53:08 -06:00
web.py Better Pi shutdown handling in Web Interface (#522) 2021-12-13 19:37:28 -08:00

RaSCSI Web

Setup local dev env

# Make a virtual env named venv
$ python3 -m venv venv
# Use that virtual env in this shell
$ source venv/bin/activate
# Install requirements
$ pip install -r requirements.txt
# Use mocks and a temp dir - start the web server
$ BASE_DIR=/tmp/images/ PATH=$PATH:`pwd`/mock/bin/ python3 web.py

Mocks for local development

You may edit the files under mock/bin to simulate Linux command responses. TODO: rascsi-web uses protobuf commands to send and receive data from rascsi. A separate mocking solution will be needed for this interface.

Static analysis with pylint

It is recommended to run pylint against new code to protect against bugs and keep the code readable and maintainable. The local pylint configuration lives in .pylintrc

sudo apt install pylint3
pylint3 python_source_file.py

Pushing to the Pi via git

Setup a bare repo on the rascsi

$ ssh pi@rascsi
$ mkdir /home/pi/dev.git && cd /home/pi/dev.git
$ git --bare init
Initialized empty Git repository in /home/pi/dev.git

Locally

$ cd ~/source/RASCSI
$ git remote add pi ssh://pi@rascsi/home/pi/dev.git
$ git push pi master