Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
b5a10f3548
|
|||
|
77ac8fecb2
|
|||
|
093805a249
|
|||
|
cab9ed705e
|
|||
|
2faa19bc54
|
@@ -14,41 +14,6 @@ steps:
|
||||
when:
|
||||
- event: tag
|
||||
|
||||
scan:
|
||||
image: quay.io/wollud1969/woodpecker-helper:0.5.1
|
||||
environment:
|
||||
TRIVY_TOKEN:
|
||||
from_secret: trivy_token
|
||||
TRIVY_URL:
|
||||
from_secret: trivy_url
|
||||
DTRACK_API_KEY:
|
||||
from_secret: dtrack_api_key
|
||||
DTRACK_API_URL:
|
||||
from_secret: dtrack_api_url
|
||||
commands:
|
||||
- HOME=/home/`id -nu`
|
||||
- TAG="${CI_COMMIT_TAG}"
|
||||
- |
|
||||
trivy image \
|
||||
--server $TRIVY_URL \
|
||||
--token $TRIVY_TOKEN \
|
||||
--format cyclonedx \
|
||||
--scanners license \
|
||||
--output /tmp/sbom.xml \
|
||||
$FORGE_NAME/$CI_REPO:$TAG
|
||||
- cat /tmp/sbom.xml
|
||||
- |
|
||||
curl -X "POST" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "X-Api-Key: $DTRACK_API_KEY" \
|
||||
-F "autoCreate=true" \
|
||||
-F "projectName=$CI_REPO" \
|
||||
-F "projectVersion=$TAG" \
|
||||
-F "bom=@/tmp/sbom.xml"\
|
||||
"$DTRACK_API_URL/api/v1/bom"
|
||||
when:
|
||||
- event: [push, tag]
|
||||
|
||||
deploy:
|
||||
image: quay.io/wollud1969/k8s-admin-helper:0.4.1
|
||||
environment:
|
||||
|
||||
4
deployment/encrypt-secrets.sh
Executable file
4
deployment/encrypt-secrets.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
gpg --pinentry-mode=loopback --symmetric --cipher-algo AES256 --armor --output secrets.asc secrets.txt
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
-----BEGIN PGP MESSAGE-----
|
||||
|
||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Ksjej2rzk/cqfdc72zK1p5jSWAyeBUZva3qoBkCc/
|
||||
ZgZ+PuXZDW1PO/0yTaIob0SfFrHFmnAGA074VEPlg8EJlHMZjd0eVfISwsIipBg7
|
||||
rpPyyEWkMSGhnObOX/C9lGbi3/3JNbH/Q2xfkTmjRtnTjpJ3CRsW8Dek59rTfVsu
|
||||
dr7Z0gzLo7nDQRTraIfEpgS7xwjOWLV0iA5Fwjl9Vlg1WDao7RA0+uSPZwIxdnSS
|
||||
ma/Lj8XNaPYzmyeDFMcCcBaIXj9PzdONNxfKhqn57aA/94M7aUdgYSHfhgqdGBRW
|
||||
gE55Eyz+S0RgNiRGo2VIJudoUM3IWr0XM/DR943JEYs796TEUncd1oRHoJNRW5Se
|
||||
UtJurdyXfPqXPvyrj+4sqo/k8RhRdJW3EasuEfu1SHsK7EltDecZ
|
||||
=KuBv
|
||||
-----END PGP MESSAGE-----
|
||||
|
||||
@@ -16,21 +16,13 @@ from app import oidc
|
||||
@oidc.require_login
|
||||
def pvstats():
|
||||
try:
|
||||
stepX_time = time.time()
|
||||
dbh = psycopg.connect()
|
||||
engine = sqlalchemy.create_engine("postgresql+psycopg://", creator=lambda: dbh)
|
||||
|
||||
step0_time = time.time()
|
||||
df = pd.read_sql("SELECT month, cast(year AS varchar), current_energy AS value FROM pv_energy_by_month", con=engine)
|
||||
step1_time = time.time()
|
||||
duration1 = step1_time - step0_time
|
||||
logger.info(f"{duration1=}")
|
||||
df = pd.read_sql("SELECT month, cast(year AS varchar), current_energy AS value FROM pv_energy_by_month ORDER BY year, month", con=engine)
|
||||
fig_1 = px.bar(df, x='month', y='value', color='year', barmode='group')
|
||||
step2_time = time.time()
|
||||
duration2 = step2_time - step1_time
|
||||
logger.info(f"{duration2=}")
|
||||
fig_1.update_layout(
|
||||
title=f"Jahreswerte Exportierte Energie {duration1:.3f}, {duration2:.3f}",
|
||||
title=f"Jahreswerte Exportierte Energie PV-Anlage",
|
||||
xaxis_title="",
|
||||
yaxis_title="",
|
||||
legend_title="Jahr",
|
||||
@@ -43,18 +35,34 @@ def pvstats():
|
||||
)
|
||||
graph_html_1 = fig_1.to_html(full_html=False, default_height='30%')
|
||||
|
||||
df = pd.read_sql("SELECT month, cast(year AS varchar), current_energy AS value FROM car_energy_by_month ORDER BY year, month", con=engine)
|
||||
fig_2 = px.bar(df, x='month', y='value', color='year', barmode='group')
|
||||
fig_2.update_layout(
|
||||
title=f"Jahreswerte Verbrauch Elektroauto",
|
||||
xaxis_title="",
|
||||
yaxis_title="",
|
||||
legend_title="Jahr",
|
||||
xaxis=dict(
|
||||
tickmode="array",
|
||||
tickvals=list(range(1, 13)), # Monate 1–12
|
||||
ticktext=["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]
|
||||
),
|
||||
yaxis=dict(ticksuffix=" kWh")
|
||||
)
|
||||
graph_html_2 = fig_2.to_html(full_html=False, default_height='30%')
|
||||
return render_template_string(f"""
|
||||
<html>
|
||||
<head>
|
||||
<title>Jahreswerte PV-Energie</title>
|
||||
<title>Jahreswerte PV und Auto</title>
|
||||
</head>
|
||||
<body>
|
||||
{graph_html_1}
|
||||
{graph_html_2}
|
||||
</body>
|
||||
</html>
|
||||
""")
|
||||
except Exception as e:
|
||||
raise Exception(f"Error when querying energy export values: {e}")
|
||||
raise Exception(f"Error when querying energy values: {e}")
|
||||
finally:
|
||||
if dbh is not None:
|
||||
dbh.close()
|
||||
|
||||
Reference in New Issue
Block a user