README.md

This commit is contained in:
2024-08-27 11:48:53 +01:00
parent d3aaf42e9c
commit 8987486451

238
README.md
View File

@@ -2,110 +2,41 @@
Welcome to homesrv01.dev.lan git page.
- [homesrv01.dev.lan](#homesrv01devlan)
Using [code-server docker container](#code-server) for Development / Maintenance.
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Services](#services)
- [Docker](#docker)
- [External volumes](#external-volumes)
- [Portainer](#portainer)
- [Promtail](#promtail)
- [Telegraf](#telegraf)
- [Setup \& Update](#setup--update)
- [nginx](#nginx)
- [code-server](#code-server)
- [Home Assistant](#home-assistant)
- [LMS](#lms)
- [Mosquitto](#mosquitto)
- [Wyoming](#wyoming)
- [Zigbee2mqtt](#zigbee2mqtt)
- [Host](#host)
- [OS](#os)
- [Development / Maintenance Environment](#development--maintenance-environment)
- [setup](#setup)
- [Packages and Requirements](#packages-and-requirements)
- [fstab](#fstab)
- [ssh](#ssh)
- [Update](#update)
- [Services](#services)
- [External volumes](#external-volumes)
- [Portainer](#portainer)
- [Promtail](#promtail)
- [Telegraf](#telegraf)
- [Setup \& Update](#setup--update)
- [nginx](#nginx)
- [code-server](#code-server)
- [Home Assistant](#home-assistant)
- [LMS](#lms)
- [Mosquitto](#mosquitto)
- [Wyoming](#wyoming)
- [Zigbee2mqtt](#zigbee2mqtt)
## OS
Currently hosted on a proxmox ubuntu container.
``` bash
# cat /etc/pve/lxc/105.conf
arch: amd64
cmode: shell
cores: 2
features: fuse=1,keyctl=1,nesting=1
hostname: homesrv01
memory: 1500
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.2,hwaddr=42:F5:02:BC:77:81,ip=192.168.1.252/24,ip6=dhcp,type=veth
onboot: 1
ostype: ubuntu
protection: 1
rootfs: local-lvm:vm-105-disk-0,size=32G
swap: 1500
unprivileged: 1
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 none bind,optional,create=file
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
```
```bash
# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble
# uname -r
6.8.4-3-pve
```
## Development / Maintenance Environment
Currently using docker code server as an editor.
## setup
```bash
apt update -y && apt upgrade -y
apt install curl -y
apt install git -y
curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh
docker run hello-world && docker info
apt install sshfs
apt install ansible
```
## fstab
```bash
#/etc/fstab
#sshfs#media@nas.lan:/home/media /mnt/media@sshfs:nas.lan fuse defaults,_netdev,allow_other,follow_symlinks 0 0
```
## ssh
```bash
#/etc/ssh/sshd_config
PermitRootLogin no
```
```bash
systemctl restart ssh
```
## Update
```bash
./scripts/auto-update.sh
ln -s $PWD/scripts/auto-update.sh /etc/cron.daily/auto-update
journalctl -r -t auto-update
```
## Services
### Docker
### External volumes
```
``` bash
docker volume create --driver local --opt type=none --opt device=/home/admin/repos --opt o=bind hostfs_home_admin_repos
docker volume create --driver local --opt type=none --opt device=/mnt/media@sshfs:nas.lan --opt o=bind music
docker volume create --driver local --opt type=none --opt device=/ --opt o=bind hostfs
@@ -113,7 +44,7 @@ docker volume create --driver local --opt type=none --opt device=/ --opt o=bind
### Portainer
maintained by ansible myInfra.docker.portainer role
maintained by ansible myInfra.docker.portainer role
### Promtail
@@ -201,16 +132,117 @@ networks:
### Wyoming
- [Home assistant](https://github.com/home-assistant/addons/blob/master/whisper/DOCS.md)
- [Docker compose](./services/wyoming/docker-compose.yaml)
- https://github.com/rhasspy/wyoming-faster-whisper
- https://exitcode0.net/posts/wyoming-whisper-docker-compose/
- https://exitcode0.net/posts/wyoming-piper-docker-compose/
A peer-to-peer protocol for voice assistants (basically JSONL + PCM audio)
Currently using portainer stack with git reference to this repo.
```json
{ "type": "...", "data": { ... }, "data_length": ..., "payload_length": ... }
<data_length bytes (optional)>
<payload_length bytes (optional)>
```
Used in Rhasspy and Home Assistant for communication with voice services.
This is an open standard of the Open Home Foundation.
For more information about home assistant integration [check home assistant repo](/marcio.fernandes/homeassistant#wyoming).
Currently using portainer stack (name: wyoming) with git reference to this repo. [docker compose file](./services/wyoming/docker-compose.yaml).
Gitea [Continuous deploy action](./.gitea/workflows/services.wyoming.yml)
Links:
- [https://github.com/home-assistant/addons/blob/master/whisper/DOCS.md](https://github.com/home-assistant/addons/blob/master/whisper/DOCS.md)
- [https://github.com/rhasspy/wyoming-faster-whisper](https://github.com/rhasspy/wyoming-faster-whisper)
- [https://exitcode0.net/posts/wyoming-whisper-docker-compose/](https://exitcode0.net/posts/wyoming-whisper-docker-compose/)
- [https://exitcode0.net/posts/wyoming-piper-docker-compose/](https://exitcode0.net/posts/wyoming-piper-docker-compose/)
### Zigbee2mqtt
[Docker compose](./services/zigbee2mqtt//docker-compose.yaml)
Zigbee to MQTT bridge, get rid of your proprietary Zigbee bridges
Currently using portainer stack with git reference to this repo.
For more information about home assistant integration [check home assistant repo](/marcio.fernandes/homeassistant#Zigbee2mqtt).
Currently using portainer stack (name: zigbee2mqtt) with git reference to this repo. [Docker compose](./services/zigbee2mqtt/docker-compose.yaml)
Gitea [Continuous deploy action](./.gitea/workflows/services.zigbee2mqtt.yml).
Links:
- [https://www.zigbee2mqtt.io/](https://www.zigbee2mqtt.io/)
## Host
### OS
Currently hosted on a proxmox ubuntu container.
```bash
# cat /etc/pve/lxc/105.conf
arch: amd64
cmode: shell
cores: 2
features: fuse=1,keyctl=1,nesting=1
hostname: homesrv01
memory: 1500
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.2,hwaddr=42:F5:02:BC:77:81,ip=192.168.1.252/24,ip6=dhcp,type=veth
onboot: 1
ostype: ubuntu
protection: 1
rootfs: local-lvm:vm-105-disk-0,size=32G
swap: 1500
unprivileged: 1
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c0e8eeb4b38ded118e7c06f6b86ce6f8-if00-port0 none bind,optional,create=file
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
```
```bash
# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble
# uname -r
6.8.4-3-pve
```
### Packages and Requirements
```bash
apt update -y && apt upgrade -y
apt install curl -y
apt install git -y
curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh
docker run hello-world && docker info
apt install sshfs
apt install ansible
```
### fstab
```bash
#/etc/fstab
#sshfs#media@nas.lan:/home/media /mnt/media@sshfs:nas.lan fuse defaults,_netdev,allow_other,follow_symlinks 0 0
```
### ssh
```bash
#/etc/ssh/sshd_config
PermitRootLogin no
```
```bash
systemctl restart ssh
```
### Update
```bash
./scripts/auto-update.sh
ln -s $PWD/scripts/auto-update.sh /etc/cron.daily/auto-update
journalctl -r -t auto-update
```