eeg_portal/setup-server.sh
Bernhard Müller 975f76dbd3 feat(community): add metering data upload and query with XLSX support
Implement complete metering data management for energy communities:

- MeteringData entity with unique constraint (metering_point_id, interval_start, data_type)
- Bulk upload via JSON or XLSX (multipart) with validation
- XLSX parser using Apache POI with comma-decimal support
- Ownership check on GET endpoints (userId must match metering point owner)
- Deduplication: existing records overwritten on re-upload
- DataSource tracking (EMAIL_XLSX, API, MANUAL)
- Query endpoints: by metering point, by type, by upload batch

Additional fixes:
- MapStruct annotation processor: add to execution-level annotationProcessorPaths
  (Spring Boot parent POM was overriding plugin-level config)
- EnergyCommunityMapper + MeteringDataMapper: componentModel=spring
- UserMapper: ignore passwordResetToken/Expiry (unmapped target policy ERROR)
- TariffService: add TariffInviteRepository dependency + invitation check
- TariffServiceTest: add missing @Mock for TariffInviteRepository
- SecurityConfig: permit /actuator/health and /actuator/info
- pom.xml: add poi-ooxml, postgresql, spring-boot-starter-actuator
- .gitignore: add *.log, survey/, backend.log

Tests: 137/137 passing
2026-07-22 12:42:27 +02:00

55 lines
1.6 KiB
Bash

#!/bin/bash
# ============================================================
# EEG Portal - Hetzner Server Setup Script
# Run this on a fresh Debian/Ubuntu server
# ============================================================
set -e
echo "=== Hetzner Server Setup for EEG Portal ==="
echo ""
# Update system
echo "Updating system packages..."
apt update && apt upgrade -y
# Install Docker
echo "Installing Docker..."
apt install -y ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Enable Docker
systemctl enable docker
systemctl start docker
# Install Git
echo "Installing Git..."
apt install -y git
# Install Certbot for SSL
echo "Installing Certbot..."
apt install -y certbot
echo ""
echo "=== Server setup complete! ==="
echo ""
echo "Next steps:"
echo " 1. Clone your repository:"
echo " git clone <your-repo-url>"
echo " cd eeg_portal"
echo ""
echo " 2. Create .env file:"
echo " cp .env.example .env"
echo " nano .env"
echo ""
echo " 3. Start the application:"
echo " bash deploy.sh"
echo ""
echo " 4. For SSL (after DNS is configured):"
echo " certbot certonly --standalone -d your-domain.at"