Initial commit
Deploy Solar Relay / deploy (push) Failing after 4s

This commit is contained in:
franzz committed 2026-11-01 22:33:32 +01:00
1 parent 36180dffd7
commit ec75ac15b0
30 files changed
+3042 -1

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
# Include inside the existing HTTPS VirtualHost for rpioffice.nest.lutran.ch.
# Enable modules: sudo a2enmod proxy proxy_http headers
# Keep the host's existing SSLEngine and certificate configuration.
ProxyRequests Off
ProxyPreserveHost On
RedirectMatch 308 ^/solar-relay$ /solar-relay/
ProxyPass /solar-relay/ http://127.0.0.1:8765/ connectiontimeout=3 timeout=15
ProxyPassReverse /solar-relay/ http://127.0.0.1:8765/
<Location /solar-relay/>
RequestHeader set X-Forwarded-Proto "https"
</Location>
+16
View File
@@ -0,0 +1,16 @@
# Include these locations in the existing HTTPS server block for rpioffice.nest.lutran.ch.
# The trailing slash on proxy_pass removes /solar-relay/ before forwarding.
location = /solar-relay {
return 308 /solar-relay/;
}
location ^~ /solar-relay/ {
proxy_pass http://127.0.0.1:8765/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 3s;
proxy_read_timeout 15s;
}
+25
View File
@@ -0,0 +1,25 @@
[Unit]
Description=Fronius local recorder and solar website relay
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
DynamicUser=yes
WorkingDirectory=/var/www/html/solar-relay
ExecStart=/var/www/html/solar-relay/.venv/bin/python -m solar_relay --config /etc/solar-relay/config.toml run
EnvironmentFile=-/etc/solar-relay/solar-relay.env
StateDirectory=solar-relay
StateDirectoryMode=0700
UMask=0077
Restart=on-failure
RestartSec=10
TimeoutStopSec=45
NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=/var/lib/solar-relay
[Install]
WantedBy=multi-user.target