Skip to content

Commit 2971f2b

Browse files
authored
for disk space
1 parent ffe6823 commit 2971f2b

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

s1panel/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ s1panel is now registered in the snap store.
6060

6161
```
6262
sudo snap install s1panel
63+
# to talk to LCD:
6364
sudo snap connect s1panel:raw-usb
65+
# to get all the sensors:
6466
sudo snap connect s1panel:hardware-observe
67+
# to get disk usage info:
68+
sudo snap connect s1panel:mount-observe
69+
sudo snap connect s1panel:removable-media
70+
sudo snap connect s1panel:block-devices
6571
```
6672

6773
The config/theme files should be in /root/snap/s1panel/current/ and if you want to modify them manually, make sure you stop the snap first. Here are some commands to use with snap:
@@ -72,7 +78,7 @@ sudo snap start s1panel
7278
sudo snap remove s1panel
7379
```
7480
> [!NOTE]
75-
> The disk monitoring (sensor/space.js) will not work inside the snap at this time.
81+
> For disk space monitoring, please check the s1panel log after restarting the service. You will find the lsblk output there, which you can use to determine the mappings between the Snap and the host system.
7682
7783

7884
## Dependencies

s1panel/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
{
6161
"module": "sensors/space.js",
6262
"config": {
63+
"name": "root",
6364
"mount_point": "/",
6465
"max_points": 300
6566
}

s1panel/snap/snapcraft.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ apps:
2323
daemon: simple
2424
restart-condition: on-failure
2525
restart-delay: 10s
26-
plugs: [home, network, network-bind, raw-usb, hardware-observe]
26+
plugs: [home, network, network-bind, raw-usb, hardware-observe, mount-observe, removable-media, block-devices]
2727
environment:
2828
SERVICE: 'true'
2929
NODE_ENV: 'production'
@@ -142,6 +142,7 @@ parts:
142142
sed "s|@SNAP@|$SNAP|g" "$SNAP/s1panel/in.conf/fonts.conf.in" > "$SNAP_USER_COMMON/fonts/fonts.conf"
143143

144144
fc-cache -f -r || true
145+
lsblk --fs --paths --list --exclude=7 || true
145146

146147
cd "$SNAP/s1panel"
147148
exec node ./main.js

0 commit comments

Comments
 (0)