From fe3d81b1928847b54a056232695d9bb793befaaa Mon Sep 17 00:00:00 2001 From: Florian Schmidt Date: Fri, 17 Jul 2026 11:05:01 +0200 Subject: [PATCH] Deploy: change default HTTP port 8080 -> 8760 8080 is a very common, collision-prone port. 8760 (hours in a year) is an uncommon default that also avoids Home Assistant's 8123. Applied across Dockerfile (ASPNETCORE_URLS/EXPOSE), compose (mapping + healthcheck), the Unraid template, README and a code comment. The METERVAULT_PORT host override still works. Claude-Session: https://claude.ai/code/session_01Kib2MniVFbD95fkgLgBBnB --- README.md | 6 +++--- deploy/Dockerfile | 4 ++-- deploy/docker-compose.yml | 4 ++-- deploy/unraid-template.xml | 4 ++-- src/App/Program.cs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7cb737d..9d4557b 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ full design. ```bash docker compose -f deploy/docker-compose.yml up -d -# open http://localhost:8080 → Import → "Load reference data" for a populated demo +# open http://localhost:8760 → Import → "Load reference data" for a populated demo # ...or start pre-populated: METERVAULT_SEED=true docker compose -f deploy/docker-compose.yml up -d -# API docs at http://localhost:8080/swagger +# API docs at http://localhost:8760/swagger ``` Configuration is via environment variables (`Section__Key` double-underscore mapping), e.g.: @@ -67,7 +67,7 @@ of an environment variable, resolved at runtime. ## Pushing readings (Home Assistant) ```bash -curl -X POST http://localhost:8080/api/v1/readings \ +curl -X POST http://localhost:8760/api/v1/readings \ -H "X-Api-Key: $METERVAULT_API_KEY" -H "Content-Type: application/json" \ -d '[{"meterId": 1, "time": "2026-01-01T12:00:00Z", "value": 47200}]' ``` diff --git a/deploy/Dockerfile b/deploy/Dockerfile index d803826..b2d0aa7 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -25,8 +25,8 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends curl \ && rm -rf /var/lib/apt/lists/* COPY --from=build /app/publish ./ -ENV ASPNETCORE_URLS=http://+:8080 \ +ENV ASPNETCORE_URLS=http://+:8760 \ ASPNETCORE_ENVIRONMENT=Production \ DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false -EXPOSE 8080 +EXPOSE 8760 ENTRYPOINT ["dotnet", "MeterVault.App.dll"] diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 6e6a077..b277346 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -40,9 +40,9 @@ services: # MeterVault__ApiKeys__0: your-secret-key # MeterVault__AllowAnonymousApi: "true" ports: - - "${METERVAULT_PORT:-8080}:8080" + - "${METERVAULT_PORT:-8760}:8760" healthcheck: - test: ["CMD-SHELL", "curl -fsS http://localhost:8080/healthz || exit 1"] + test: ["CMD-SHELL", "curl -fsS http://localhost:8760/healthz || exit 1"] interval: 15s timeout: 5s retries: 5 diff --git a/deploy/unraid-template.xml b/deploy/unraid-template.xml index b504cda..1f2dc36 100644 --- a/deploy/unraid-template.xml +++ b/deploy/unraid-template.xml @@ -11,10 +11,10 @@ false Self-hosted energy & utility metering: ingest from Home Assistant/Tasmota/MQTT, normalize to consumption, and produce cost dashboards. Needs a TimescaleDB instance. HomeAutomation: Tools: Productivity: - http://[IP]:[PORT:8080]/ + http://[IP]:[PORT:8760]/ https://git.finalfactory.de/FinalFactory/MeterVault/raw/branch/master/docs/icon.png - 8080 + 8760 Host=timescaledb;Port=5432;Database=metervault;Username=metervault;Password=changeme diff --git a/src/App/Program.cs b/src/App/Program.cs index 6c5a781..70d02f5 100644 --- a/src/App/Program.cs +++ b/src/App/Program.cs @@ -60,7 +60,7 @@ try app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true); app.UseSerilogRequestLogging(); app.UseReverseProxyTrust(); - // No HTTPS redirection: the app serves plain HTTP (port 8080) behind a reverse proxy + // No HTTPS redirection: the app serves plain HTTP (port 8760) behind a reverse proxy // that terminates TLS (SDD §10). HTTPS redirection here would break the container and proxy. app.UseAntiforgery();