Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
5573024fd9 | |||
a58f914c40 | |||
4ec9690981 | |||
6af509c2f6 | |||
22eba69526 | |||
a2855edd47 | |||
a2f720855d | |||
cbb9ff7a23 |
@ -13,6 +13,42 @@ steps:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
when:
|
when:
|
||||||
- event: [push, tag]
|
- event: [push, 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:-$CI_COMMIT_SHA}"
|
||||||
|
- |
|
||||||
|
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:
|
deploy:
|
||||||
image: quay.io/wollud1969/k8s-admin-helper:0.2.1
|
image: quay.io/wollud1969/k8s-admin-helper:0.2.1
|
||||||
environment:
|
environment:
|
||||||
|
@ -16,7 +16,6 @@ idna==3.10
|
|||||||
importlib_metadata==8.6.1
|
importlib_metadata==8.6.1
|
||||||
itsdangerous==2.2.0
|
itsdangerous==2.2.0
|
||||||
Jinja2==3.1.5
|
Jinja2==3.1.5
|
||||||
kaleido==1.0.0rc0
|
|
||||||
loguru==0.7.3
|
loguru==0.7.3
|
||||||
MarkupSafe==3.0.2
|
MarkupSafe==3.0.2
|
||||||
msgspec==0.19.0
|
msgspec==0.19.0
|
||||||
|
25
src/run.py
25
src/run.py
@ -1,4 +1,4 @@
|
|||||||
from flask import Flask, session, g, render_template_string, Response
|
from flask import Flask, session, g, render_template_string
|
||||||
from flask_session import Session
|
from flask_session import Session
|
||||||
from flask_oidc import OpenIDConnect
|
from flask_oidc import OpenIDConnect
|
||||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
@ -8,8 +8,6 @@ import json
|
|||||||
import os
|
import os
|
||||||
import plotly.express as px
|
import plotly.express as px
|
||||||
import plotly.graph_objects as po
|
import plotly.graph_objects as po
|
||||||
import plotly.io as pio
|
|
||||||
import io
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import psycopg
|
import psycopg
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
@ -176,9 +174,12 @@ def ntpserver():
|
|||||||
fig.add_trace(po.Scatter(x=df['bucket'], y=df['stratum'], mode='lines', name='Stratum', yaxis='y2', line=dict(color='blue')))
|
fig.add_trace(po.Scatter(x=df['bucket'], y=df['stratum'], mode='lines', name='Stratum', yaxis='y2', line=dict(color='blue')))
|
||||||
|
|
||||||
fig.update_layout(
|
fig.update_layout(
|
||||||
|
title='NTP Server Numbers',
|
||||||
|
|
||||||
# Linke Y-Achse
|
# Linke Y-Achse
|
||||||
yaxis=dict(
|
yaxis=dict(
|
||||||
title='Root Dispersion'
|
title='Root Dispersion',
|
||||||
|
ticksuffix=' ms'
|
||||||
),
|
),
|
||||||
|
|
||||||
# Rechte Y-Achse
|
# Rechte Y-Achse
|
||||||
@ -193,9 +194,19 @@ def ntpserver():
|
|||||||
legend=dict(x=0.05, y=1) # Position der Legende
|
legend=dict(x=0.05, y=1) # Position der Legende
|
||||||
)
|
)
|
||||||
|
|
||||||
img = fig.to_image(format='png')
|
|
||||||
return Response(img, mimetype='image/png')
|
|
||||||
|
|
||||||
|
graph_html = fig.to_html(full_html=False, default_height='30%')
|
||||||
|
|
||||||
|
return render_template_string(f"""
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>NTP Server Numbers</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{graph_html}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
""")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception(f"Error when querying NTP server values: {e}")
|
raise Exception(f"Error when querying NTP server values: {e}")
|
||||||
finally:
|
finally:
|
||||||
@ -208,7 +219,7 @@ def ntpserver():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host="0.0.0.0", port=8080)
|
app.run(port=8080)
|
||||||
else:
|
else:
|
||||||
exposed_app = ProxyFix(app, x_for=1, x_host=1)
|
exposed_app = ProxyFix(app, x_for=1, x_host=1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user