This commit is contained in:
Alexandre
2024-04-26 18:11:19 +02:00
parent e8f7dd4feb
commit e891245aaf
94 changed files with 358 additions and 616 deletions

View File

@@ -1,202 +1,24 @@
## 5c8ffd24-ls153-3 (05-04-2024)
## 1.4 (26-04-2024)
- Minor bugs fixed
## 5c8ffd24-ls153-2 (04-04-2024)
## 1.3 (26-04-2024)
- Minor bugs fixed
## 5c8ffd24-ls153 (04-04-2024)
- Addition of other ports ; must be manually activated through the addon options
## 4.16-r0-ls89-xfce12 (08-09-2023)
## 1.2 (25-04-2024)
- Minor bugs fixed
## 4.16-r0-ls89-xfce11 (05-09-2023)
## 1.0 (25-04-2024)
- Minor bugs fixed
## 4.16-r0-ls89-xfce3 (04-09-2023)
- Ingress enabled
## 4.16-r0-ls89-xfce (03-09-2023)
- MAJOR REWORK : is now operational with Webtop 2.0
- Based on Ubuntu XFCE
## 4.16-r0-ls80 (06-12-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls79 (27-11-2022)
- Update to latest version from linuxserver/docker-webtop
- WARNING : update to supervisor 2022.11 before installing
## 4.16-r0-ls78 (22-11-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls77 (14-11-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls76 (08-11-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls75 (25-10-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls74 (20-10-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls73 (18-10-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls72 (04-10-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls71 (27-09-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls70 (20-09-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls69 (09-09-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls68 (30-08-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls67 (16-08-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls66 (09-08-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls65 (04-08-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls64 (26-07-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls63 (19-07-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls62 (05-07-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls61 (21-06-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls60 (14-06-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls59 (06-06-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls58 (31-05-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls57 (24-05-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls56 (17-05-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls55 (10-05-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls54 (01-05-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls53 (26-04-2022)
- Update to latest version from linuxserver/docker-webtop
- Fix custom timezone
## 4.16-r0-ls52 (19-04-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls51 (11-04-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls50 (05-04-2022)
- Update to latest version from linuxserver/docker-webtop
- Devicetree feature removed as cause issue on some systems
## 4.16-r0-ls49 (27-03-2022)
- Update to latest version from linuxserver/docker-webtop
- Add codenotary sign
## 4.16-r0-ls48 (22-03-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls47 (14-03-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls46 (06-03-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls45 (27-02-2022)
- Update to latest version from linuxserver/docker-webtop
- Map device tree
## 4.16-r0-ls44 (20-02-2022)
- Update to latest version from linuxserver/docker-webtop
## 4.16-r0-ls43 (13-02-2022)
- Update to latest version from linuxserver/docker-webtop
- New feature : addition of ingress
- New feature : change password from addon options
## 4.16-r0-ls42 (07-02-2022)
- Update to latest version from linuxserver/docker-webtop
- Option to enable rpi graphic drivers
- Option to enable edge repositories
- Code improvement
## 4.16-r0-ls40 (04-02-2022)
- Update to latest version from linuxserver/docker-webtop
- Alpine KDE
- To update, uninstall and reinstall
- Add several custom repositories by default to increase installable apps
## 4.16 (07-01-2022)
- Update to latest version from linuxserver/docker-webtop
- New standardized logic for Dockerfile build and packages installation
- Initial release
## 0.9 (25-04-2024)
- Minor bugs fixed
## 0.6 (24-04-2024)
- Minor bugs fixed
## 0.7 (24-04-2024)
- Minor bugs fixed
## 0.3 (23-04-2024)
- Minor bugs fixed
## 0.1 (23-04-2024)
- Minor bugs fixed
## 0.2 (23-04-2024)
- Feat : Allow to define the /clips folder
- Feat : Allow mounting of SMB and local drives
## 0.5.1 (22-04-2024)
- Initial build

View File

@@ -14,34 +14,10 @@
# 1 Build Image #
#################
ARG BUILD_FROM
ARG BUILD_VERSION
ARG BUILD_FROM
FROM ${BUILD_FROM}
##################
# 2 Modify Image #
##################
# Set S6 wait time
ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=0
# load volume
VOLUME [ "/sys/fs/cgroup" ]
# Allow UID and GID setting
# hadolint ignore=SC2015,DL4006,SC2013,SC2086
RUN \
# Change home folder location
usermod --home /share/birdnet-pi2 abc
# Global LSIO modifications
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_lsio.sh" "/ha_lsio.sh"
ARG CONFIGLOCATION="/share/birdnet-pi2"
RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGLOCATION"; fi && rm /ha_lsio.sh
ENV DEBIAN_FRONTEND="noninteractive" \
BIRDNET_USER="pi" \
USER="pi" \
@@ -95,6 +71,36 @@ RUN \
ln -s /home/pi /app && \
chown -R 1000:1000 /home/pi /app
#USER pi
#WORKDIR /app
#RUN export DEBIAN_FRONTEND noninteractive && \
# export BIRDNET_USER="pi" && \
# export USER="pi" && \
# export HOME="/app" && \
# echo "HOME is $HOME" && \
# ls -l /app && \
# sudo chown -R pi:pi /app && \
# /./newinstaller.sh
#USER root
#sudo -E -u birdnet -s /bin/bash -c "/newinstaller.sh"
# Correct script
#sed -i "s|== 0|== 7|g" /newinstaller.sh && \
#sed -i "s|sudo -n true|true|g" /newinstaller.sh && \
#sed -i "s|sudo -K|true|g" /newinstaller.sh && \
#for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do \sed -i "s|sudo ||" "$file"; done && \
#/./newinstaller.sh
# Correct for absence of sudo
#sudo -E -u birdnet -s /bin/bash -c "/newinstaller.sh"
##################
# 2 Modify Image #
##################
# Set S6 wait time
ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=0
##################
# 3 Install apps #
##################
@@ -108,14 +114,14 @@ RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; f
if [ ! -f /bin/bash ] && [ -f /usr/bin/bash ]; then ln -s /usr/bin/bash /bin/bash; fi
# Modules
ARG MODULES="00-banner.sh 01-custom_script.sh 00-local_mounts.sh 00-smb_mounts.sh 90-dns_set.sh"
ARG MODULES="00-local_mounts.sh 00-smb_mounts.sh"
# Automatic modules download
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automodules.sh" "/ha_automodules.sh"
RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh
# Manual apps
ENV PACKAGES="nginx engrampa"
ENV PACKAGES="alsa-utils libasound2-plugins nginx"
# Automatic apps & bashio
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"
@@ -133,8 +139,9 @@ ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templat
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint_modif.sh" "/ha_entrypoint_modif.sh"
RUN chmod 777 /ha_entrypoint.sh /ha_entrypoint_modif.sh && /ha_entrypoint_modif.sh && rm /ha_entrypoint_modif.sh
#
#WORKDIR /
# Avoid config.yaml interference
WORKDIR /config
#ENTRYPOINT ["/lib/systemd/systemd"]
#ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/ha_entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@@ -169,6 +176,15 @@ LABEL \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}
####################
# 6 HealthcheckNOT #
####################
#################
# 6 Healthcheck #
#################
ENV HEALTH_PORT="80" \
HEALTH_URL=""
HEALTHCHECK \
--interval=5s \
--retries=5 \
--start-period=30s \
--timeout=25s \
CMD curl --fail "http://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}" &>/dev/null || exit 1

View File

@@ -1,10 +1,10 @@
# Home assistant add-on: Webtop KDE Alpine
# Home assistant add-on: birdnet-pi
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-pi2%2Fconfig.json)
![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-pi2%2Fconfig.json)
![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-pi2%2Fconfig.json)
![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-pi%2Fconfig.json)
![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-pi%2Fconfig.json)
![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-pi%2Fconfig.json)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c6cf10bdbba45ecb202d7f579b5be0e)](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade)
[![GitHub Super-Linter](https://img.shields.io/github/actions/workflow/status/alexbelgium/hassio-addons/weekly-supelinter.yaml?label=Lint%20code%20base)](https://github.com/alexbelgium/hassio-addons/actions/workflows/weekly-supelinter.yaml)
@@ -16,41 +16,43 @@ _Thanks to everyone having starred my repo! To star it click on the image below,
[![Stargazers repo roster for @alexbelgium/hassio-addons](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.github/stars2.svg)](https://github.com/alexbelgium/hassio-addons/stargazers)
![downloads evolution](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/birdnet-pi2/stats.png)
![downloads evolution](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/birdnet-pi/stats.png)
## About
[webtop](https://github.com/webtop/webtop) is a full desktop environments accessible via any modern web browser.
This addon is based on the docker image https://github.com/linuxserver/docker-webtop
---
[birdnet-pi](https://github.com/tphakala/birdnet-pi/tree/main) is an AI solution for continuous avian monitoring and identification developed by @tphakala
This addon is based on their docker image.
## Configuration
Webui can be found with ingress or at <http://homeassistant:PORT>. The port is by default disabled but can be enabled through the addon options.
Install, then start the addon a first time
Webui can be found at <http://homeassistant:8080>.
By default the image is based around the abc user and we recommend using this user as all of the init/config is based around it. The default password is also abc . If you want to change this password and require authentication when accessing the interface simply issue passwd inside a gui terminal in the webtop. Then when accessing the web interface use the path:
You'll need a microphone : either use one connected to HA or the audio stream of a rstp camera.
http://localhost:3000/?login=true
Options can be configured through three ways :
Apps installations are not remanent, you need to do it via addon options. Their config, however, is.
If graphics don't work, use the DRINODE feature to select your graphic device.
See all potential ENV variables here : https://docs.linuxserver.io/images/docker-webtop#optional-environment-variables
- Addon options
```yaml
TZ: timezone ; Country/City according to https://manpages.ubuntu.com/manpages/trusty/man3/DateTime::TimeZone::Catalog.3pm.html
additional_apps: engrampa,thunderbird # Allows installation of apps, as they are not persistent
DRINODE: specify a custom graphic device, default is /dev/dri/renderD128
DNS_servers: 8.8.8.8,1.1.1.1 # Keep blank to use routers DNS, or set custom DNS to avoid spamming in case of local DNS ad-remover
localdisks: sda1 #put the hardware name of your drive to mount separated by commas, or its label. ex. sda1, sdb1, MYNAS...
networkdisks: "//SERVER/SHARE" # optional, list of smb servers to mount, separated by commas
cifsusername: "username" # optional, smb username, same for all smb shares
cifspassword: "password" # optional, smb password
cifsdomain: "domain" # optional, allow setting the domain for the smb share
ALSA_CARD : number of the card (0 or 1 usually), see https://github.com/tphakala/birdnet-pi/blob/main/doc/installation.md#deciding-alsa_card-value
TZ: Etc/UTC specify a timezone to use, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
COMMAND : realtime --rtsp url # allows to provide arguments to birdnet-pi
```
- Config.yaml
Additional variables can be configured using the config.yaml file found in /config/db21ed7f_birdnet-pi/config.yaml using the Filebrowser addon
- Config_env.yaml
Additional environment variables can be configured there
## Installation
---
The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on.
1. Add my add-ons repository to your home assistant instance (in supervisor addons store at top right, or click button below if you have configured my HA)
@@ -62,12 +64,18 @@ The installation of this add-on is pretty straightforward and not different in c
1. Check the logs of the add-on to see if everything went well.
1. Open the webUI and adapt the software options
## Integration with HA
Not yet available
## Common issues
Not yet available
## Support
Create an issue on github
## Illustration
---
![illustration](https://www.linuxserver.io/user/pages/content/images/2021/05/menu.png)
[repository]: https://github.com/alexbelgium/hassio-addons
![illustration](https://raw.githubusercontent.com/tphakala/birdnet-pi/main/doc/birdnet-pi-dashboard.webp)

View File

@@ -1,6 +1,6 @@
#include <tunables/global>
profile birdnet-pi2_addon flags=(attach_disconnected,mediate_deleted) {
profile birdnet-pi_addon flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
capability,
@@ -22,7 +22,7 @@ profile birdnet-pi2_addon flags=(attach_disconnected,mediate_deleted) {
capability setuid,
capability sys_admin,
capability dac_read_search,
capability dac_override,
# capability dac_override,
# capability sys_rawio,
# S6-Overlay
@@ -52,11 +52,7 @@ profile birdnet-pi2_addon flags=(attach_disconnected,mediate_deleted) {
/dev/nvme1 mrwkl,
/dev/mmcblk0p1 mrwkl,
/dev/* mrwkl,
/udev/* mrwkl,
/tmp/** mrkwl,
/dev/fuse/** mrkwl,
/dev/** mrkwl,
/sys/firmware/** mrkwl,
# Data access
/data/** rw,

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: avahi alias"
exec \
s6-setuidgid "$USER" /usr/bin/avahi-publish -a -R %I "$(hostname -I |cut -d' ' -f1)"

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-custom_recording

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
s6-envdir /run/user/1000
s6-setuidgid ${USER}
/usr/local/bin/custom_recording.sh

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-avahi_alias

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bashio
s6-setuidgid ${USER}
echo "Starting service: avahi alias"
/bin/bash -c "/usr/bin/avahi-publish -a -R %I $(hostname -I |cut -d' ' -f1)"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_analysis

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet analysis"
exec \
s6-setuidgid "$USER" "$PYTHON_VIRTUAL_ENV /usr/local/bin/birdnet_analysis.py"

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_log

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet log"
exec \
s6-setuidgid "$USER" "/usr/local/bin/gotty --address localhost -p 8080 --path log --title-format 'BirdNET-Pi Log' birdnet_log.sh"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 6 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_recording

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet recording"
exec \
s6-setuidgid "$USER" "/usr/local/bin/birdnet_recording.sh"

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 5 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_stats

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bashio
s6-setuidgid ${USER}
echo "Starting service: birdnet stats"
exec \
s6-setuidgid "$USER" "$HOME/BirdNET-Pi/birdnet/bin/streamlit run $HOME/BirdNET-Pi/scripts/plotly_streamlit.py --browser.gatherUsageStats false --server.address localhost --server.baseUrlPath '/stats'"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-caddy

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: caddy"
exec \
s6-setuidgid "$USER" "/usr/local/bin/caddy run --config /etc/caddy/Caddyfile"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 120 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-chart_viewer

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: chart viewer"
exec \
s6-setuidgid "$USER" "$PYTHON_VIRTUAL_ENV /usr/local/bin/daily_plot.py --daemon --sleep 2"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-getty

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: getty"
exec \
s6-setuidgid "$USER" "/sbin/agetty --autologin ${USER} --noclear %I $TERM"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-livestream

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: livestream"
exec \
s6-setuidgid "$USER" "/usr/local/bin/livestream.sh"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 10 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-spectrogram_viewer

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: spectrogram viewer"
exec \
s6-setuidgid "$USER" "/usr/local/bin/spectrogram.sh"

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-web_terminal

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: web terminal"
exec \
s6-setuidgid "$USER" "/usr/local/bin/gotty --address localhost -w -p 8888 --path terminal --title-format 'BirdNET-Pi Terminal' login"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -1,9 +0,0 @@
{
"build_from": {
"aarch64": "linuxserver/webtop:arm64v8-debian-xfce",
"amd64": "linuxserver/webtop:amd64-debian-xfce"
},
"codenotary": {
"signer": "alexandrep.github@gmail.com"
}
}

View File

@@ -0,0 +1,6 @@
---
build_from:
aarch64: jrei/systemd-debian:12
amd64: jrei/systemd-debian:12
codenotary:
signer: alexandrep.github@gmail.com

View File

@@ -5,7 +5,6 @@
],
"audio": true,
"codenotary": "alexandrep.github@gmail.com",
"description": "Full linux desktop environment accessible via any modern web browser",
"devices": [
"/dev/dri",
"/dev/dri/card0",
@@ -30,13 +29,6 @@
"/dev/nvme",
"/dev/nvme0n1p1",
"/dev/nvme0n1p2",
"/dev/nvme0n1p3",
"/dev/nvme1n1p1",
"/dev/nvme1n1p2",
"/dev/nvme1n1p3",
"/dev/nvme2n1p1",
"/dev/nvme2n1p2",
"/dev/nvme3n1p3",
"/dev/mmcblk",
"/dev/fuse",
"/dev/sda1",
@@ -65,81 +57,46 @@
"/dev/nvme1",
"/dev/nvme2"
],
"description": "Realtime BirdNET soundscape analyzer",
"environment": {
"FM_HOME": "/share/birdnet-pi2",
"HOME": "/share/birdnet-pi2",
"PGID": "0",
"PUID": "0",
"START_DOCKER": "false",
"TITLE": "Ubuntu XFCE webtop",
"shm_size": "1gb"
},
"host_dbus": true,
"image": "ghcr.io/alexbelgium/birdnet-pi2-{arch}",
"ingress": true,
"init": false,
"map": [
"config:rw",
"addon_config:rw",
"media:rw",
"share:rw",
"ssl"
"share:rw"
],
"name": "Webtop LSIO",
"name": "zzz Do not use 2",
"options": {
"DNS_server": "8.8.8.8",
"PGID": 0,
"PUID": 0,
"additional_apps": "engrampa,libreoffice"
"COMMAND": "realtime"
},
"panel_icon": "mdi:monitor",
"panel_icon": "mdi:bird",
"ports": {
"20/tcp": null,
"21/tcp": null,
"22/tcp": null,
"23/tcp": null,
"25/tcp": null,
"3000/tcp": 3000,
"3001/tcp": null,
"3002/tcp": null,
"53/tcp": null,
"80/tcp": null
"80/tcp": 80
},
"ports_description": {
"20/tcp": "FTP",
"21/tcp": "FTP",
"22/tcp": "SSH",
"23/tcp": "TELNET",
"25/tcp": "SMTP",
"3000/tcp": "Web interface",
"3001/tcp": "custom port 1",
"3002/tcp": "custom port 2",
"53/tcp": "DNS",
"80/tcp": "http"
"80/tcp": "web ui",
"8888/tcp": "web terminal",
"8080/tcp": "log",
"8501/tcp": "streamlit"
},
"privileged": [
"SYS_ADMIN",
"DAC_READ_SEARCH"
],
"schema": {
"DNS_server": "str?",
"DRINODE": "list(/dev/dri/card0|/dev/dri/card1|/dev/dri/card2|/dev/dri/renderD128|/dev/dri/renderD129|)?",
"KEYBOARD": "list(da-dk-qwerty|de-de-qwertz|en-gb-qwerty|en-us-qwerty|es-es-qwerty|fr-ch-qwertz|fr-fr-azerty|it-it-qwerty|ja-jp-qwerty|pt-br-qwerty|sv-se-qwerty|tr-tr-qwerty)?",
"PASSWORD": "str?",
"PGID": "int",
"PUID": "int",
"TZ": "match([A-Z][a-z]*./[A-Z][a-z]*.)?",
"additional_apps": "str?",
"ALSA_CARD": "int?",
"COMMAND": "str",
"TZ": "str?",
"cifsdomain": "str?",
"cifspassword": "str?",
"cifsusername": "str?",
"data_location": "str?",
"localdisks": "str?",
"networkdisks": "str?"
},
"slug": "birndet-pi2",
"tmpfs": true,
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "5c8ffd24-ls153-3",
"slug": "birdnet-pi2",
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi",
"version": "1.2",
"video": true
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -0,0 +1,15 @@
#!/usr/bin/with-contenv bashio
# Waiting for dbus
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
echo "Starting service: pulseaudio"
while :
do
if [[ ! $(/usr/bin/pulseaudio --check) ]]; then
exec \
s6-setuidgid "$USER" /usr/bin/pulseaudio --start
fi
sleep 10
done

View File

@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# Waiting for dbus
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
echo "Starting service: php pfm"
exec /usr/sbin/php-fpm* -F

View File

@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bashio
# Waiting for dbus
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
echo "Starting service: avahi daemon"
exec \
avahi-daemon --no-chroot

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet analysis"
exec \
s6-setuidgid "$USER" "$PYTHON_VIRTUAL_ENV" /usr/local/bin/birdnet_analysis.py

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet log"
exec \
s6-setuidgid "$USER" /usr/local/bin/gotty --address localhost -p 8080 --path log --title-format "BirdNET-Pi Log" birdnet_log.sh

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet recording"
exec \
s6-setuidgid "$USER" /usr/local/bin/birdnet_recording.sh

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet stats"
exec \
s6-setuidgid "$USER" "$HOME"/BirdNET-Pi/birdnet/bin/streamlit run "$HOME"/BirdNET-Pi/scripts/plotly_streamlit.py --browser.gatherUsageStats false --server.address localhost --server.baseUrlPath "/stats"

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: chart viewer"
exec \
s6-setuidgid "$USER" "$PYTHON_VIRTUAL_ENV" /usr/local/bin/daily_plot.py --daemon --sleep 2

View File

@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: getty"
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
exec \
s6-setuidgid "$USER" /sbin/agetty --autologin "${USER}"
--noclear %I "$TERM"

View File

@@ -0,0 +1,8 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: livestream"
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
exec \
s6-setuidgid "$USER" /usr/local/bin/livestream.sh

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: spectrogram viewer"
exec \
s6-setuidgid "$USER" /usr/local/bin/spectrogram.sh

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: web terminal"
exec \
s6-setuidgid "$USER" /usr/local/bin/gotty --address localhost -w -p 8888 --path terminal --title-format "BirdNET-Pi Terminal" login

View File

@@ -0,0 +1,12 @@
#!/usr/bin/with-contenv bashio
# Dependencies
until [[ -e /var/run/dbus/system_bus_socket ]] && [[ -e /run/php/php*-fpm.sock ]]; do
sleep 1s
done
# Correct fpm.sock
sed -i "s|/run/php/php-fpm.sock|$(find /run/php -name *.sock)|g" /etc/caddy/Caddyfile
echo "Starting service: caddy"
exec \
s6-setuidgid "$USER" /usr/bin/caddy run --config /etc/caddy/Caddyfile

View File

@@ -1,70 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# shellcheck disable=SC2046
set -e
# Define user
PUID=$(bashio::config "PUID")
PGID=$(bashio::config "PGID")
# Check data location
LOCATION=$(bashio::config 'data_location')
if [[ "$LOCATION" = "null" || -z "$LOCATION" ]]; then
# Default location
LOCATION="/share/birdnet-pi2"
else
bashio::log.warning "Warning : a custom data location was selected, but the previous folder will NOT be copied. You need to do it manually"
# Check if config is located in an acceptable location
LOCATIONOK=""
for location in "/share" "/config" "/data" "/mnt"; do
if [[ "$LOCATION" == "$location"* ]]; then
LOCATIONOK=true
fi
done
if [ -z "$LOCATIONOK" ]; then
LOCATION="/share/birdnet-pi2"
bashio::log.fatal "Your data_location value can only be set in /share, /config or /data (internal to addon). It will be reset to the default location : $LOCATION"
fi
fi
# Set data location
bashio::log.info "Setting data location to $LOCATION"
# Correct home locations
for file in /etc/s6-overlay/s6-rc.d/*/run; do
if [ "$(sed -n '1{/bash/p};q' "$file")" ]; then
sed -i "1a export HOME=$LOCATION" "$file"
sed -i "1a export FM_HOME=$LOCATION" "$file"
fi
done
# Correct home location
for folders in /defaults /etc/cont-init.d /etc/services.d /etc/s6-overlay/s6-rc.d; do
if [ -d "$folders" ]; then
sed -i "s|/share/birdnet-pi2|$LOCATION|g" $(find "$folders" -type f) &>/dev/null || true
fi
done
# Change user home
usermod --home "$LOCATION" abc
# Add environment variables
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/HOME; fi
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/FM_HOME; fi
{
printf "%s" "HOME=\"$LOCATION\""
printf "%s" "FM_HOME=\"$LOCATION\""
} >> ~/.bashrc
# Create folder
echo "Creating $LOCATION"
mkdir -p "$LOCATION"
# Set ownership
bashio::log.info "Setting ownership to $PUID:$PGID"
chown -R "$PUID":"$PGID" "$LOCATION"
chmod -R 755 "$LOCATION"

View File

@@ -1,45 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# shellcheck disable=SC2015
set -e
# Install specific apps
if bashio::config.has_value 'additional_apps'; then
bashio::log.info "Installing additional apps :"
# hadolint ignore=SC2005
NEWAPPS=$(bashio::config 'additional_apps')
for packagestoinstall in ${NEWAPPS//,/ }; do
bashio::log.green "... $packagestoinstall"
if command -v "apk" &>/dev/null; then
apk add --no-cache "$packagestoinstall" &>/dev/null || (bashio::log.fatal "Error : $packagestoinstall not found")
elif command -v "apt" &>/dev/null; then
apt-get install -yqq --no-install-recommends "$packagestoinstall" &>/dev/null || (bashio::log.fatal "Error : $packagestoinstall not found")
elif command -v "pacman" &>/dev/null; then
pacman --noconfirm -S "$packagestoinstall" &>/dev/null || (bashio::log.fatal "Error : $packagestoinstall not found")
fi
done
fi
# Set TZ
if bashio::config.has_value 'TZ'; then
TIMEZONE=$(bashio::config 'TZ')
bashio::log.info "Setting timezone to $TIMEZONE"
ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime
echo "$TIMEZONE" >/etc/timezone
fi || (bashio::log.fatal "Error : $TIMEZONE not found. Here is a list of valid timezones : https://manpages.ubuntu.com/manpages/focal/man3/DateTime::TimeZone::Catalog.3pm.html")
# Set keyboard
if bashio::config.has_value 'KEYBOARD'; then
KEYBOARD=$(bashio::config 'KEYBOARD')
bashio::log.info "Setting keyboard to $KEYBOARD"
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi
printf "%s" "KEYBOARD=\"$KEYBOARD\"" >> ~/.bashrc
fi || true
# Set password
if bashio::config.has_value 'PASSWORD'; then
bashio::log.info "Setting password to the value defined in options"
PASSWORD=$(bashio::config 'PASSWORD')
passwd -d abc
echo -e "$PASSWORD\n$PASSWORD" | passwd abc
fi || true

View File

@@ -1,29 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# nginx Path
NGINX_CONFIG=/etc/nginx/sites-available/ingress.conf
SUBFOLDER="$(bashio::addon.ingress_entry)"
# Copy template
cp /defaults/default.conf "${NGINX_CONFIG}"
# Remove ssl part
awk -v n=4 '/server/{n--}; n > 0' "${NGINX_CONFIG}" > tmpfile
mv tmpfile "${NGINX_CONFIG}"
# Remove ipv6
sed -i '/listen \[::\]/d' "${NGINX_CONFIG}"
# Add ingress parameters
sed -i "s|3000|$(bashio::addon.ingress_port)|g" "${NGINX_CONFIG}"
sed -i '/proxy_buffering/a proxy_set_header Accept-Encoding "";' "${NGINX_CONFIG}"
sed -i '/proxy_buffering/a sub_filter_once off;' "${NGINX_CONFIG}"
sed -i '/proxy_buffering/a sub_filter_types *;' "${NGINX_CONFIG}"
sed -i '/proxy_buffering/a sub_filter "vnc/index.html?autoconnect" "vnc/index.html?path=%%path%%/websockify?autoconnect";' "${NGINX_CONFIG}"
sed -i "s|%%path%%|${SUBFOLDER:1}|g" "${NGINX_CONFIG}"
# Correct image
sed -i "s|SUBFOLDERwebsockify|/websockify|g" "${NGINX_CONFIG}"
# Enable ingress
cp "${NGINX_CONFIG}" /etc/nginx/sites-enabled

View File

@@ -0,0 +1,24 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e
#################
# INITALISATION #
#################
# Starting dbus
echo "Starting service: dbus"
service dbus start
bashio::log.info "ALSA_CARD option is set to $(bashio::config "ALSA_CARD"). If the microphone doesn't work, please adapt it"
echo " "
########################
# CONFIGURE birdnet-pi #
########################
bashio::log.info "Starting app..."
if [ ! -f /config/birdnet.conf ]; then
cp /etc/birdnet/birdnet.conf /config
fi

View File

@@ -1,96 +0,0 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View File

@@ -1,15 +0,0 @@
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;

View File

@@ -1 +0,0 @@
resolver 127.0.0.11 ipv6=off;

View File

@@ -1,6 +0,0 @@
root /dev/null;
server_name $hostname;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;

View File

@@ -1,9 +0,0 @@
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
ssl_ecdh_curve secp384r1;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;

View File

@@ -1,3 +0,0 @@
upstream backend {
server 127.0.0.1:8080;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,9 +0,0 @@
{
"github_fulltag": "true",
"last_update": "08-04-2023",
"repository": "alexbelgium/hassio-addons",
"slug": "birdnet-pi2",
"source": "github",
"upstream_repo": "linuxserver/docker-webtop",
"upstream_version": "4.16-r0-ls95"
}