diff --git a/server/docker-compose.yml b/server/docker-compose.yml deleted file mode 100644 index 0a355f5a..00000000 --- a/server/docker-compose.yml +++ /dev/null @@ -1,239 +0,0 @@ -# sudo docker compose down --volumes -# sudo docker compose up -d --remove-orphans - -name: server - -services: - # --- NGINX Proxy Manager --- - nginx-proxy-manager: - image: "docker.io/jc21/nginx-proxy-manager:latest" - restart: unless-stopped - container_name: nginx-proxy-manager - ports: - - "80:80" - - "81:81" # Admin interface (Do not expose) - - "443:443" - environment: - - DISABLE_IPV6=true - volumes: - - ${NGINX_DATA}:/data - - ${NGINX_LETSENCRYPT}:/etc/letsencrypt - networks: - - server-network - - # --- Nextcloud --- - nextcloud: # :80 - image: nextcloud:latest - restart: unless-stopped - container_name: nextcloud - depends_on: - - nextcloud-db - - nextcloud-redis - environment: - - POSTGRES_HOST=nextcloud-db - - POSTGRES_DB=nextcloud - - POSTGRES_USER=nextcloud - - POSTGRES_PASSWORD=${NEXTCLOUD_DB_PASSWORD} - - NEXTCLOUD_TRUSTED_DOMAINS=localhost - - OVERWRITEPROTOCOL=https - - OVERWRITECLIURL=https://${NC_DOMAIN} - - OVERWRITEHOST=${NC_DOMAIN} - - TRUSTED_PROXIES=172.16.0.0/12 - - NEXTCLOUD_INIT_HTACCESS=true - volumes: - - ${NEXTCLOUD_DATA}:/var/www/html - networks: - - server-network - - nextcloud-network - - nextcloud-cron: - image: nextcloud:apache - restart: unless-stopped - container_name: nextcloud-cron - entrypoint: /cron.sh - depends_on: - - nextcloud-db - - nextcloud-redis - environment: - - POSTGRES_HOST=nextcloud-db - - POSTGRES_DB=nextcloud - - POSTGRES_USER=nextcloud - - POSTGRES_PASSWORD=${NEXTCLOUD_DB_PASSWORD} - - REDIS_HOST=nextcloud-redis - - REDIS_HOST_PASSWORD=${REDIS_PASSWORD} - volumes: - - ${NEXTCLOUD_DATA}:/var/www/html - networks: - - nextcloud-network - - nextcloud-db: - image: postgres:latest - restart: unless-stopped - container_name: nextcloud-db - environment: - - POSTGRES_DB=nextcloud - - POSTGRES_USER=nextcloud - - POSTGRES_PASSWORD=${NEXTCLOUD_DB_PASSWORD} - volumes: - - ${NEXTCLOUD_DB_DATA}:/var/lib/postgresql/data - networks: - - nextcloud-network - - nextcloud-redis: - image: redis:alpine - restart: unless-stopped - container_name: nextcloud-redis - command: redis-server --requirepass ${REDIS_PASSWORD} - networks: - - nextcloud-network - - # --- Gitea --- - gitea: # :3000 - ports: - - "22:22" - image: gitea/gitea:latest - container_name: gitea - restart: unless-stopped - volumes: - - ${GITEA}:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - networks: - - server-network - - # --- N8N Automation --- - n8n: # :5678 - image: n8nio/n8n:latest - restart: unless-stopped - container_name: n8n - env_file: - - .env - environment: - - N8N_HOST=${N8N_HOST} - - N8N_PORT=5678 - - N8N_PROTOCOL=https # Nginx Proxy Manager will handle HTTPS - - NODE_ENV=production - - WEBHOOK_URL=https://${N8N_HOST}/ - - GENERIC_TIMEZONE=${TZ} - - N8N_RUNNERS_ENABLED=true - - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true - volumes: - - ${N8N_DATA}:/home/node/.n8n - - ${N8N_FILES}:/files - networks: - - server-network - - # --- Home Assistant --- - homeassistant: # :8123 - image: "ghcr.io/home-assistant/home-assistant:stable" - container_name: homeassistant - env_file: - - .env - volumes: - - ${HA_CONFIG}:/config - - /etc/localtime:/etc/localtime:ro - - /run/dbus:/run/dbus:ro - restart: unless-stopped - # devices: - # - /dev/ttyUSB0:/dev/ttyUSB0 - privileged: true - networks: - - ha-network - - server-network - - piper: # :10200 - image: homeassistant/amd64-addon-piper:latest - container_name: piper - entrypoint: python3 - command: > - -m wyoming_piper - --piper '/usr/share/piper/piper' - --uri 'tcp://0.0.0.0:10200' - --length-scale "1" - --noise-scale "0.667" - --speaker "0" - --voice "en_US-lessac-medium" - --max-piper-procs "1" - --data-dir /data - --data-dir /share/piper - --download-dir /data - volumes: - - ${PIPER_DATA}:/data - restart: unless-stopped - networks: - - ha-network - - whisper: # :10300 - image: homeassistant/amd64-addon-whisper:latest - container_name: whisper - entrypoint: python3 - command: > - -m wyoming_faster_whisper - --uri tcp://0.0.0.0:10300 - --model small-int8 - --beam-size 1 - --language en - --data-dir /data - --download-dir /data - volumes: - - ${WHISPER_DATA}:/data - restart: unless-stopped - networks: - - ha-network - - # --- ESPHome --- - esphome: - container_name: esphome - image: ghcr.io/esphome/esphome:latest - volumes: - - ${ESPHOME_CONFIG}:/config - - /etc/localtime:/etc/localtime:ro - restart: unless-stopped - privileged: true - # network_mode: host - ports: - - "6052:6052" # Web interface - - # --- ejabberd XMPP Client --- - ejabberd: # :5280 (Admin interface) - image: ejabberd/ecs:latest - container_name: ejabberd - restart: unless-stopped - depends_on: - - ejabberd-db - volumes: - - ${EJABBERD_CONF}/ejabberd.yml:/opt/ejabberd/conf/ejabberd.yml - ports: - - "5222:5222" # XMPP client - - "5223:5223" # XMPP client (TLS) - - "5269:5269" # XMPP server-to-server (in) - - "5443:5443" # HTTP upload - - "5478:5478/udp" # STUN/TURN - - "1883:1883" # MQTT - networks: - - server-network - - ejabberd-network - - ejabberd-db: # Edit DB settings here: /mnt/md0/ejabberd/conf/ejabberd.yml - image: postgres:latest - container_name: ejabberd-db - restart: unless-stopped - environment: - - POSTGRES_DB=ejabberd - - POSTGRES_USER=ejabberd - - POSTGRES_PASSWORD=${EJABBERD_DB_PASSWORD} - volumes: - - ${EJABBERD_DB_DATA}:/var/lib/postgresql/data - networks: - - ejabberd-network - -networks: - server-network: - driver: bridge - nextcloud-network: - driver: bridge - ha-network: - driver: bridge - ejabberd-network: - driver: bridge - diff --git a/server/ha-sensors/blank-template.yaml b/server/ha-sensors/blank-template.yaml deleted file mode 100644 index eb94d956..00000000 --- a/server/ha-sensors/blank-template.yaml +++ /dev/null @@ -1,112 +0,0 @@ -esphome: - name: name - friendly_name: Name - - # Boot sequence - start with WiFi connecting effect - on_boot: - - priority: 600 - then: - - logger.log: "Device booting, starting WiFi connection" - - light.turn_on: - id: status_led - effect: "wifi_connecting" - -esp32: - board: esp32-s3-devkitc-1 - framework: - type: esp-idf - sdkconfig_options: - CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y" - CONFIG_ESP32S3_DATA_CACHE_64KB: "y" - CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y" - CONFIG_AUDIO_BOARD_CUSTOM: "y" - -psram: - mode: octal - speed: 80MHz - -# Enable logging -logger: - -# Enable Home Assistant API -api: - encryption: - key: "ZGLTCJYjvXIJA0LIP8o/k9Vp+Tia9AhHgXZ/WHCQ1gQ=" - - # API connection event handlers - on_client_connected: - - logger.log: "Home Assistant API connected" - - light.turn_off: status_led - - on_client_disconnected: - - logger.log: "Home Assistant API disconnected" - - light.turn_on: - id: status_led - effect: "ha_connecting" - -# Allow Over-The-Air updates -ota: - - platform: esphome - password: !secret ota_password - -wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - # WiFi connection event handlers - on_connect: - - logger.log: "WiFi connected, attempting Home Assistant connection" - - light.turn_on: - id: status_led - effect: "ha_connecting" - - on_disconnect: - - logger.log: "WiFi disconnected" - - light.turn_on: - id: status_led - effect: "wifi_connecting" - - # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "Living-Room-Sensor Hotspot" - password: !secret ota_password - -# Status LED configuration -light: - - platform: esp32_rmt_led_strip - id: status_led - name: "Status LED" - pin: GPIO48 - num_leds: 1 - chipset: ws2812 - rgb_order: GRB - effects: - # Yellow blinking during WiFi connection - - strobe: - name: "wifi_connecting" - colors: - - state: true - brightness: 80% - red: 100% - green: 100% - blue: 0% - duration: 500ms - - state: false - duration: 500ms - # Orange blinking during Home Assistant connection - - strobe: - name: "ha_connecting" - colors: - - state: true - brightness: 80% - red: 100% - green: 65% - blue: 0% - duration: 300ms - - state: false - duration: 300ms - -button: - - platform: restart - name: "Restart Sensor" - id: restart_button diff --git a/server/ha-sensors/living-room-sensor.yaml b/server/ha-sensors/living-room-sensor.yaml deleted file mode 100644 index b07670c9..00000000 --- a/server/ha-sensors/living-room-sensor.yaml +++ /dev/null @@ -1,183 +0,0 @@ -esphome: - name: esphome-web-e28960 - friendly_name: Living Room Sensor - min_version: 2025.5.0 - name_add_mac_suffix: false - - # Boot sequence - start with WiFi connecting effect - on_boot: - - priority: 600 - then: - - logger.log: "Device booting, starting WiFi connection" - - light.turn_on: - id: status_led - effect: "wifi_connecting" - -esp32: - board: esp32-s3-devkitc-1 - framework: - type: esp-idf - sdkconfig_options: - CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y" - CONFIG_ESP32S3_DATA_CACHE_64KB: "y" - CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y" - CONFIG_AUDIO_BOARD_CUSTOM: "y" - -psram: - mode: octal - speed: 80MHz - -# Enable logging -logger: - -# UART configuration for LD2420 mmWave sensor -uart: - tx_pin: GPIO17 - rx_pin: GPIO16 - baud_rate: 115200 - parity: NONE - stop_bits: 1 - -# Enable Home Assistant API -api: - encryption: - key: "ZGLTCJYjvXIJA0LIP8o/k9Vp+Tia9AhHgXZ/WHCQ1gQ=" - - # API connection event handlers - on_client_connected: - - logger.log: "Home Assistant API connected" - - light.turn_off: status_led - - on_client_disconnected: - - logger.log: "Home Assistant API disconnected" - - light.turn_on: - id: status_led - effect: "ha_connecting" - -# Allow Over-The-Air updates -ota: - - platform: esphome - password: !secret ota_password - -wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - # WiFi connection event handlers - on_connect: - - logger.log: "WiFi connected, attempting Home Assistant connection" - - light.turn_on: - id: status_led - effect: "ha_connecting" - - on_disconnect: - - logger.log: "WiFi disconnected" - - light.turn_on: - id: status_led - effect: "wifi_connecting" - - # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "Living-Room-Sensor Hotspot" - password: !secret ota_password - -# Status LED configuration -light: - - platform: esp32_rmt_led_strip - id: status_led - name: "Status LED" - pin: GPIO48 - num_leds: 1 - chipset: ws2812 - rgb_order: GRB - effects: - # Yellow blinking during WiFi connection - - strobe: - name: "wifi_connecting" - colors: - - state: true - brightness: 80% - red: 100% - green: 100% - blue: 0% - duration: 500ms - - state: false - duration: 500ms - # Orange blinking during Home Assistant connection - - strobe: - name: "ha_connecting" - colors: - - state: true - brightness: 80% - red: 100% - green: 65% - blue: 0% - duration: 300ms - - state: false - duration: 300ms - -button: - - platform: restart - name: "Restart Sensor" - id: restart_button - - - platform: ld2420 - apply_config: - name: Apply Config - factory_reset: - name: Factory Reset - restart_module: - name: Restart Module - revert_config: - name: Undo Edits - -# DHT-22 Temperature and Humidity Sensor -sensor: - - platform: dht - pin: GPIO4 - model: DHT22 - temperature: - name: "Living Room Temperature" - id: living_room_temperature - humidity: - name: "Living Room Humidity" - id: living_room_humidity - update_interval: 60s - - - platform: ld2420 - moving_distance: - name: Moving Distance - -# LD2420 Presence Sensor -ld2420: - -text_sensor: - - platform: ld2420 - fw_version: - name: LD2420 Firmware - -binary_sensor: - - platform: ld2420 - has_target: - name: Presence - -select: - - platform: ld2420 - operating_mode: - name: Operating Mode - -number: - - platform: ld2420 - presence_timeout: - name: Detection Presence Timeout - min_gate_distance: - name: Detection Gate Minimum - max_gate_distance: - name: Detection Gate Maximum - # See "Number" section below for detail - gate_select: - name: Select Gate to Set - still_threshold: - name: Set Still Threshold Value - move_threshold: - name: Set Move Threshold Value diff --git a/server/ha-sensors/office-sensor.yaml b/server/ha-sensors/office-sensor.yaml deleted file mode 100644 index 3489e8cf..00000000 --- a/server/ha-sensors/office-sensor.yaml +++ /dev/null @@ -1,144 +0,0 @@ -esphome: - name: office-sensor - friendly_name: Office Sensor - - # Boot sequence - start with WiFi connecting effect - on_boot: - - priority: 600 - then: - - logger.log: "Device booting, starting WiFi connection" - - light.turn_on: - id: status_led - effect: "wifi_connecting" - -esp32: - board: esp32-s3-devkitc-1 - framework: - type: esp-idf - sdkconfig_options: - CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y" - CONFIG_ESP32S3_DATA_CACHE_64KB: "y" - CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y" - CONFIG_AUDIO_BOARD_CUSTOM: "y" - -psram: - mode: octal - speed: 80MHz - -# Enable logging -logger: - -# I2C configuration for sensors -i2c: - sda: GPIO4 - scl: GPIO5 - scan: true - id: scd40_bus - -# Enable Home Assistant API -api: - encryption: - key: "ZGLTCJYjvXIJA0LIP8o/k9Vp+Tia9AhHgXZ/WHCQ1gQ=" - - # API connection event handlers - on_client_connected: - - logger.log: "Home Assistant API connected" - - light.turn_off: status_led - - on_client_disconnected: - - logger.log: "Home Assistant API disconnected" - - light.turn_on: - id: status_led - effect: "ha_connecting" - - actions: - - action: calibrate_co2_value - variables: - co2_ppm: int - then: - - scd4x.perform_forced_calibration: - value: !lambda "return co2_ppm;" - id: scd40_sensor - - action: factory_reset_co2_sensor - then: - - scd4x.factory_reset: scd40_sensor - -# Allow Over-The-Air updates -ota: - - platform: esphome - password: !secret ota_password - -wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - # WiFi connection event handlers - on_connect: - - logger.log: "WiFi connected, attempting Home Assistant connection" - - light.turn_on: - id: status_led - effect: "ha_connecting" - - on_disconnect: - - logger.log: "WiFi disconnected" - - light.turn_on: - id: status_led - effect: "wifi_connecting" - - # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "Living-Room-Sensor Hotspot" - password: !secret ota_password - -# Status LED configuration -light: - - platform: esp32_rmt_led_strip - id: status_led - name: "Status LED" - pin: GPIO48 - num_leds: 1 - chipset: ws2812 - rgb_order: GRB - effects: - # Yellow blinking during WiFi connection - - strobe: - name: "wifi_connecting" - colors: - - state: true - brightness: 80% - red: 100% - green: 100% - blue: 0% - duration: 500ms - - state: false - duration: 500ms - # Orange blinking during Home Assistant connection - - strobe: - name: "ha_connecting" - colors: - - state: true - brightness: 80% - red: 100% - green: 65% - blue: 0% - duration: 300ms - - state: false - duration: 300ms - -# SCD40 CO2, Temperature, and Humidity Sensor -sensor: - - platform: scd4x - id: scd40_sensor - co2: - name: "Office CO2" - temperature: - name: "Office Temperature" - humidity: - name: "Office Humidity" - measurement_mode: low_power_periodic - update_interval: 30s - -button: - - platform: restart - name: "Restart Sensor" - id: restart_button diff --git a/server/nextcloud.sh b/server/nextcloud.sh deleted file mode 100755 index 82af52a1..00000000 --- a/server/nextcloud.sh +++ /dev/null @@ -1 +0,0 @@ -docker exec -u www-data -it nextcloud php "$@" diff --git a/server/notes.md b/server/notes.md deleted file mode 100644 index 9c6599ee..00000000 --- a/server/notes.md +++ /dev/null @@ -1,23 +0,0 @@ -# Port forward - -| Name | Ext Port | Int Port | Protocol | -|-------------|--------------|--------------|----------| -| NGINX 80 | 80 | 80 | TCP | -| NGINX 443 | 443 | 443 | TCP | -| GITEA SSH | 22 | 22 | TCP | -| EJ 5222 | 5222 | 5222 | TCP | -| EJ 5223 | 5223 | 5223 | TCP | -| EJ 5269 | 5269 | 5269 | TCP | -| EJ 5443 | 5443 | 5443 | TCP | -| EJ 5478 | 5478 | 5478 | UDP | -| EJ 1883 | 1883 | 1883 | TCP | - -# How to change public IP -- Edit `turn_ipv4_address:` at `/mnt/md0/ejabberd/conf/ejabberd.yml`. -- Point domain to the new IP and all subdomains. - -# Change private IP -- Edit port forward settings to point to the new IP. - -# Configure port forward from scratch -- Forward every port explicitly declared in `ports` field of every container.