fixes
This commit is contained in:
parent
f379011430
commit
d01ae72a5f
@ -152,6 +152,8 @@ After=go2rtc.service network.target
|
|||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/frigate
|
WorkingDirectory=/opt/frigate
|
||||||
Environment="PATH=/opt/frigate/venv/bin"
|
Environment="PATH=/opt/frigate/venv/bin"
|
||||||
|
Environment="PYTHONPATH=/opt/frigate"
|
||||||
|
ExecStartPre=/bin/mkdir -p /media/frigate/recordings /media/frigate/clips /media/frigate/snapshots
|
||||||
ExecStart=/opt/frigate/venv/bin/python3 -u -m frigate
|
ExecStart=/opt/frigate/venv/bin/python3 -u -m frigate
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
@ -13,8 +13,6 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
PYTHON_VERSION="3.12" setup_uv
|
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
python3-opencv jq \
|
python3-opencv jq \
|
||||||
@ -23,9 +21,28 @@ $STD apt-get install -y \
|
|||||||
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav \
|
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav \
|
||||||
build-essential python3-dev python3-gi pkg-config libcairo2-dev gir1.2-glib-2.0 \
|
build-essential python3-dev python3-gi pkg-config libcairo2-dev gir1.2-glib-2.0 \
|
||||||
cmake gfortran libopenblas-dev liblapack-dev libgirepository1.0-dev git
|
cmake gfortran libopenblas-dev liblapack-dev libgirepository1.0-dev git
|
||||||
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
PG_VERSION="16" setup_postgresql
|
||||||
|
|
||||||
|
msg_info "Setting up PostgreSQL Database"
|
||||||
|
DB_NAME=viseron
|
||||||
|
DB_USER=viseron_usr
|
||||||
|
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
||||||
|
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
|
||||||
|
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
|
||||||
|
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
|
||||||
|
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
|
||||||
|
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
|
||||||
|
{
|
||||||
|
echo "Hanko-Credentials"
|
||||||
|
echo "Hanko Database User: $DB_USER"
|
||||||
|
echo "Hanko Database Password: $DB_PASS"
|
||||||
|
echo "Hanko Database Name: $DB_NAME"
|
||||||
|
} >>~/hanko.creds
|
||||||
|
msg_ok "Set up PostgreSQL Database"
|
||||||
|
|
||||||
# msg_info "Setting up Hardware Acceleration"
|
# msg_info "Setting up Hardware Acceleration"
|
||||||
# if [[ "$CTTYPE" == "0" ]]; then
|
# if [[ "$CTTYPE" == "0" ]]; then
|
||||||
# chgrp video /dev/dri
|
# chgrp video /dev/dri
|
||||||
@ -45,14 +62,10 @@ msg_ok "Python Environment Setup"
|
|||||||
msg_info "Setup Viseron (Patience)"
|
msg_info "Setup Viseron (Patience)"
|
||||||
UV_HTTP_TIMEOUT=600 uv pip install --python /opt/viseron/.venv/bin/python -e /opt/viseron/.
|
UV_HTTP_TIMEOUT=600 uv pip install --python /opt/viseron/.venv/bin/python -e /opt/viseron/.
|
||||||
UV_HTTP_TIMEOUT=600 uv pip install --python /opt/viseron/.venv/bin/python -r /opt/viseron/requirements.txt
|
UV_HTTP_TIMEOUT=600 uv pip install --python /opt/viseron/.venv/bin/python -r /opt/viseron/requirements.txt
|
||||||
|
mkdir -p /config/{recordings,snapshots,segments,event_clips,thumbnails}
|
||||||
|
for d in recordings snapshots segments event_clips thumbnails; do ln -s "/config/$d" "/$d" 2>/dev/null || true; done
|
||||||
msg_ok "Setup Viseron"
|
msg_ok "Setup Viseron"
|
||||||
|
|
||||||
msg_info "Creating Configuration Directory"
|
|
||||||
mkdir -p /config
|
|
||||||
mkdir -p /config/recordings
|
|
||||||
mkdir -p /config/logs
|
|
||||||
msg_ok "Created Configuration Directory"
|
|
||||||
|
|
||||||
msg_info "Creating Default Configuration"
|
msg_info "Creating Default Configuration"
|
||||||
cat <<EOF >/config/viseron.yaml
|
cat <<EOF >/config/viseron.yaml
|
||||||
# Viseron Configuration
|
# Viseron Configuration
|
||||||
@ -105,6 +118,14 @@ motion_detection:
|
|||||||
enabled: true
|
enabled: true
|
||||||
threshold: 25
|
threshold: 25
|
||||||
sensitivity: 0.8
|
sensitivity: 0.8
|
||||||
|
|
||||||
|
storage:
|
||||||
|
connection_string: postgresql://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME
|
||||||
|
recordings: /recordings
|
||||||
|
snapshots: /snapshots
|
||||||
|
segments: /segments
|
||||||
|
event_clips: /event_clips
|
||||||
|
thumbnails: /thumbnails
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Created Default Configuration"
|
msg_ok "Created Default Configuration"
|
||||||
|
|
||||||
@ -119,7 +140,7 @@ Type=simple
|
|||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/opt/viseron
|
WorkingDirectory=/opt/viseron
|
||||||
Environment=PATH=/opt/viseron/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
Environment=PATH=/opt/viseron/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
ExecStart=/opt/viseron/bin/python -m viseron --config /config/viseron.yaml
|
ExecStart=/opt/viseron/.venv/bin/python -m viseron --config /config/viseron.yaml
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user