Final polish for deploy
This commit is contained in:
2
debian/sensorpajen.debhelper.log
vendored
2
debian/sensorpajen.debhelper.log
vendored
@@ -1 +1 @@
|
||||
dh_auto_install
|
||||
dh_builddeb
|
||||
|
||||
2
debian/sensorpajen/DEBIAN/control
vendored
2
debian/sensorpajen/DEBIAN/control
vendored
@@ -2,7 +2,7 @@ Package: sensorpajen
|
||||
Version: 2.0.0-dev
|
||||
Architecture: all
|
||||
Maintainer: Fredrik <fredrik@wahlberg.se>
|
||||
Installed-Size: 109
|
||||
Installed-Size: 110
|
||||
Depends: python3 (>= 3.9), python3-venv, python3-pip, bluetooth, bluez, libcap2-bin
|
||||
Recommends: mosquitto-clients
|
||||
Section: misc
|
||||
|
||||
5
debian/sensorpajen/DEBIAN/md5sums
vendored
5
debian/sensorpajen/DEBIAN/md5sums
vendored
@@ -1,4 +1,5 @@
|
||||
90ea43f1be78ca18b9210f2d370001c4 opt/sensorpajen/pyproject.toml
|
||||
3b3c15c00bf48fc519b8fbe507a93a7e opt/sensorpajen/pyproject.toml
|
||||
0894789523a53bb372980c0906a7d0b5 opt/sensorpajen/requirements.txt
|
||||
940d73f24eb9f971ce27f9355e3072f3 opt/sensorpajen/scripts/approve-sensors.sh
|
||||
20eb4f3839b990a530410768897402c0 opt/sensorpajen/src/sensorpajen/__init__.py
|
||||
1f452c46e42f8dc3751dba6ca68256e9 opt/sensorpajen/src/sensorpajen/approve_sensors.py
|
||||
@@ -13,6 +14,6 @@ c9c22f9c1d65bfafd89fa45f16b7192b usr/lib/systemd/system/sensorpajen.service
|
||||
bd2f1371c60af415bc9d0dbc1111184d usr/share/doc/sensorpajen/ROADMAP.md.gz
|
||||
380e8e6b01b757ceac05bc5805844ae4 usr/share/doc/sensorpajen/changelog.Debian.gz
|
||||
14152a98d7cd7fe8daf280aacc4cbf3f usr/share/doc/sensorpajen/examples/discovered_sensors.json.example
|
||||
b0249deee21ceb834bc2fe9947be82d3 usr/share/doc/sensorpajen/examples/sensorpajen.env.example
|
||||
387cb9ee7f22570312604e2cc07ca7a0 usr/share/doc/sensorpajen/examples/sensorpajen.env.example
|
||||
292efbddd951c39cb2c9546d5fac5e05 usr/share/doc/sensorpajen/examples/sensors.json.example
|
||||
5f647c63bfc3b174611694779fd215e0 usr/share/doc/sensorpajen/readme.md.gz
|
||||
|
||||
24
debian/sensorpajen/DEBIAN/postinst
vendored
24
debian/sensorpajen/DEBIAN/postinst
vendored
@@ -42,13 +42,24 @@ case "$1" in
|
||||
venv/bin/pip install --upgrade pip setuptools wheel
|
||||
fi
|
||||
|
||||
# Install Python dependencies from pyproject.toml
|
||||
# Install Python dependencies from requirements.txt
|
||||
echo "Installing Python dependencies..."
|
||||
venv/bin/pip install -e . || {
|
||||
echo "Warning: pip install failed. You may need to install dependencies manually."
|
||||
}
|
||||
if [ -f "/opt/sensorpajen/requirements.txt" ]; then
|
||||
venv/bin/pip install -r /opt/sensorpajen/requirements.txt
|
||||
else
|
||||
echo "Warning: requirements.txt not found, installing bluepy and paho-mqtt directly"
|
||||
venv/bin/pip install bluepy paho-mqtt
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: Failed to install dependencies"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set Bluetooth capabilities on Python executable
|
||||
# Set ownership of application directory BEFORE setting capabilities
|
||||
chown -R sensorpajen:sensorpajen /opt/sensorpajen
|
||||
|
||||
# Set Bluetooth capabilities on Python executable (after ownership change)
|
||||
PYTHON_PATH=$(readlink -f /opt/sensorpajen/venv/bin/python3)
|
||||
if command -v setcap >/dev/null 2>&1; then
|
||||
setcap cap_net_raw,cap_net_admin+eip "$PYTHON_PATH" || {
|
||||
@@ -59,9 +70,6 @@ case "$1" in
|
||||
echo "Warning: setcap not found (install libcap2-bin package)"
|
||||
fi
|
||||
|
||||
# Set ownership of application directory
|
||||
chown -R sensorpajen:sensorpajen /opt/sensorpajen
|
||||
|
||||
# Install systemd service file
|
||||
if [ -f /opt/sensorpajen/debian/sensorpajen.service ]; then
|
||||
cp /opt/sensorpajen/debian/sensorpajen.service /etc/systemd/system/
|
||||
|
||||
@@ -26,6 +26,7 @@ classifiers = [
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
"pybluez>=0.31",
|
||||
"bluepy>=1.3.0",
|
||||
"paho-mqtt>=1.6.0",
|
||||
]
|
||||
|
||||
3
debian/sensorpajen/opt/sensorpajen/requirements.txt
vendored
Normal file
3
debian/sensorpajen/opt/sensorpajen/requirements.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
pybluez
|
||||
bluepy
|
||||
paho-mqtt
|
||||
@@ -13,7 +13,7 @@ DISCOVERED_SENSORS_FILE=config/discovered_sensors.json
|
||||
WATCHDOG_TIMEOUT=5
|
||||
ENABLE_BATTERY=true
|
||||
LOG_LEVEL=INFO
|
||||
CONFIG_RELOAD_INTERVAL=900 # 15 minutes in seconds
|
||||
CONFIG_RELOAD_INTERVAL=900
|
||||
|
||||
# ntfy Notifications (optional)
|
||||
NTFY_ENABLED=false
|
||||
|
||||
Reference in New Issue
Block a user