Merge pull request #103 from akuker/eric/devupdates

Web and easy install updates.
This commit is contained in:
akuker 2021-05-23 11:35:19 -05:00 committed by GitHub
commit a580562d03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 16 deletions

View File

@ -134,7 +134,7 @@ function updateRaScsiWebInterface() {
}
function showRaScsiStatus() {
sudo systemctl status rascsi
sudo systemctl status rascsi | tee
}
function createDrive600MB() {
@ -221,7 +221,7 @@ function createDrive() {
if [ ! -f $drivePath ]; then
echo "Creating a ${driveSize}MB Drive"
dd if=/dev/zero of=$drivePath bs=1M count=$driveSize
truncate --size ${driveSize}m $drivePath
echo "Formatting drive with HFS"
formatDrive "$drivePath" "$driveName"

View File

@ -1,12 +1,35 @@
# RaSCSI Web
## Mocking for local development
## Setup local dev env
Set a few env vars to point to the mock scripts and base dir
```
BASE_DIR=/tmp/images/
PATH=$PATH:`pwd`/mock/bin/
```bash
# 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
```
Edit response to commands in `mock/bin/*`
### Mocks for local development
You may edit the files under `mock/bin` to simulate rascsi command responses.
## 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
```

View File

@ -17,7 +17,7 @@ def create_new_image(file_name, type, size):
file_name = file_name + "." + type
return subprocess.run(
["dd", "if=/dev/zero", "of=" + base_dir + file_name, "bs=1M", "count=" + size],
["truncate", "--size", f"{size}m", f"{base_dir}{file_name}"],
capture_output=True,
)

View File

@ -1,12 +1,12 @@
click==7.1.2
Flask==1.1.2
itsdangerous==1.1.0
Jinja2==2.11.2
Flask==2.0.0
itsdangerous==2.0.0
Jinja2==3.0.0
machfs==1.2.4
macresources==1.2
MarkupSafe==1.1.1
MarkupSafe==2.0.0
rsrcfork==1.8.0
waitress==1.4.4
Werkzeug==1.0.1
Werkzeug==2.0.0
zope.event==4.5.0
zope.interface==5.1.2

View File

@ -5,6 +5,12 @@ server {
proxy_pass http://localhost:8080;
}
# Large files
client_max_body_size 0;
proxy_read_timeout 1000;
proxy_connect_timeout 1000;
proxy_send_timeout 1000;
error_page 502 /502.html;
location = /502.html {
root /var/www/html/;

View File

@ -55,7 +55,7 @@ def config_save():
with open(file_name, "w") as csv_file:
writer = csv.writer(csv_file)
for device in list_devices():
if device["type"] is not "-":
if device["type"] != "-":
writer.writerow(device.values())
flash(f"Saved config to {file_name}!")
return redirect(url_for("index"))