Skip to content

Commit ba3075a

Browse files
authored
Fix permissions UX issues with data directories (#538)
* Try to make `pi` user owner of data & logs directories * Try to run the hardware controller service as the `pi` user * Also set `pi` for group ownership * Bump device-backend * Try to simplify setup of dirs needed by device-backend * Bump hardware controller & pallet-standard for merged PRs
1 parent 2103311 commit ba3075a

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

software/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ All dates in this file are given in the [UTC time zone](https://en.wikipedia.org
3535

3636
- (System: networking) `planktoscope.local` and `pkscope.local` should now work on local area networks (i.e. when the PlanktoScope is connected to a router) and not just on direct connections.
3737
- (Application: GUI) The Node-RED dashboard's sample page's "Dilution Factor" input field has been renamed to "Concentration Factor", which is a less misleading name for what that input field actually represents.
38+
- (Application) The `/home/pi/data` and `/home/pi/device-backend-logs` are now created with non-`root` user ownership, so that their contents can be managed via an SFTP/SCP connection as the `pi` user. This fixes a regression introduced with v2023.9.0-beta.0.
3839

3940
## v2024.0.0 - 2024-12-25
4041

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
35b9c55
1+
ce6aa88
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8493ebe
1+
eea1e8b

software/distro/setup/planktoscope-app-env/python-hardware-controller/etc/systemd/system/planktoscope-org.device-backend.controller-adafruithat.service

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ After=nodered.service
1010
Type=simple
1111
Environment=HOME=/home/pi
1212
ExecStart=/home/pi/.local/share/pypoetry/venv/bin/poetry --directory /home/pi/device-backend/control run python -u /home/pi/device-backend/control/adafruithat/main.py
13+
User=pi
14+
Group=pi
1315

1416
[Install]
1517
WantedBy=multi-user.target

software/distro/setup/planktoscope-app-env/python-hardware-controller/etc/systemd/system/planktoscope-org.device-backend.controller-planktoscopehat.service

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ After=nodered.service
1010
Type=simple
1111
Environment=HOME=/home/pi
1212
ExecStart=/home/pi/.local/share/pypoetry/venv/bin/poetry --directory /home/pi/device-backend/control run python -u /home/pi/device-backend/control/planktoscopehat/main.py
13+
User=pi
14+
Group=pi
1315

1416
[Install]
1517
WantedBy=multi-user.target

software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ sudo cp "$config_files_root$file" "$file"
6060
# or for the PlanktoScope HAT
6161
file="/etc/systemd/system/planktoscope-org.device-backend.controller-planktoscopehat.service"
6262
sudo cp "$config_files_root$file" "$file"
63-
# FIXME: make this directory in the main.py file
64-
sudo -E mkdir -p "$HOME/data/img"
65-
sudo -E mkdir -p "$HOME/device-backend-logs/control"
6663

6764
# Select the enabled hardware controller
6865
mkdir -p "$HOME/PlanktoScope"

0 commit comments

Comments
 (0)