diff --git a/CHANGELOG.md b/CHANGELOG.md index 379964abf2e8543af633b4e2fe69275ee56308ab..bd54ee168695b4d78934fee9f10325f17a575db2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +- Only show app version numbers in the dashboard tiles to admin users. + +## 0.11.1 + +- Fix password reset form in case no email address is pre-filled. + ## 0.11.0 - Allow pre-filling user's email address in a link to the password (re)set diff --git a/backend/migration_reset.py b/backend/migration_reset.py index 4f674c75ecff4e31ccf744818978580270e4ef48..79281ba19d963b8d10755c6d8f52d84df2689f12 100644 --- a/backend/migration_reset.py +++ b/backend/migration_reset.py @@ -1,4 +1,4 @@ -from sqlalchemy import exc +from sqlalchemy import exc, text from database import db import logging @@ -17,7 +17,7 @@ def reset(): logging.info("Checking if alembic version needs to be reset.") version = None try: - result = db.session.execute("select version_num from alembic_version") + result = db.session.execute(text("select version_num from alembic_version")) for row in result: version = row[0] except exc.ProgrammingError: diff --git a/backend/requirements.in b/backend/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..c03c6e99bd6d5e5d1eedb2b535ac0c2cbf61cc62 --- /dev/null +++ b/backend/requirements.in @@ -0,0 +1,23 @@ +APScheduler==3.10.4 +# CLI creation kit +click==8.1.7 +Flask==3.0.3 +# Flask-Cors==3.0.10 +# flask-expects-json==1.7.0 +Flask-JWT-Extended==4.6.0 +# Flask-Migrate==4.0.1 +Flask-SQLAlchemy==3.1.1 +# jsonschema==4.4.0 +# Jinja2==3.0.3 +# jinja2-base64-filters==0.1.4 +kubernetes==30.1.0 +pymysql==1.1.1 +NamedAtomicLock==1.1.3 +ory-kratos-client==1.2.0 +ory-hydra-client==2.2.0 +pip-install==1.3.5 +posix-ipc==1.1.1 +PyYAML==6.0.2 +regex==2024.9.11 +requests==2.32.3 +requests-oauthlib==2.0.0 diff --git a/backend/requirements.txt b/backend/requirements.txt index b06a97967da972a7109d0132353666c5ed723f5c..c31b88900ce2730bf3c4340d2a086bc614a6c9f0 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,44 +1,130 @@ -APScheduler==3.9.1 -attrs==21.4.0 -black==22.1.0 -certifi==2021.10.8 -cffi==1.15.0 -charset-normalizer==2.0.12 -click==8.0.4 -cryptography==36.0.2 -Flask==2.0.3 -Flask-Cors==3.0.10 -flask-expects-json==1.7.0 -Flask-JWT-Extended==4.3.1 -Flask-Migrate==4.0.1 -Flask-SQLAlchemy==2.5.1 -gunicorn==20.1.0 -idna==3.3 -install==1.3.5 -itsdangerous==2.1.1 -jsonschema==4.4.0 -Jinja2==3.0.3 -jinja2-base64-filters==0.1.4 -kubernetes==24.2.0 -MarkupSafe==2.1.1 -mypy-extensions==0.4.3 -NamedAtomicLock==1.1.3 -oauthlib==3.2.0 -ory-kratos-client==1.0.0 -ory-hydra-client==1.11.8 -pathspec==0.9.0 -platformdirs==2.5.1 +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --no-emit-index-url --output-file=requirements.txt --strip-extras requirements.in +# +annotated-types==0.7.0 + # via pydantic +apscheduler==3.10.4 + # via -r requirements.in +blinker==1.8.2 + # via flask +cachetools==5.5.0 + # via google-auth +certifi==2024.8.30 + # via + # kubernetes + # requests +charset-normalizer==3.3.2 + # via requests +click==8.1.7 + # via + # -r requirements.in + # flask +flask==3.0.3 + # via + # -r requirements.in + # flask-jwt-extended + # flask-sqlalchemy +flask-jwt-extended==4.6.0 + # via -r requirements.in +flask-sqlalchemy==3.1.1 + # via -r requirements.in +google-auth==2.34.0 + # via kubernetes +greenlet==3.0.3 + # via sqlalchemy +idna==3.8 + # via requests +itsdangerous==2.2.0 + # via flask +jinja2==3.1.4 + # via flask +kubernetes==30.1.0 + # via -r requirements.in +markupsafe==2.1.5 + # via + # jinja2 + # werkzeug +namedatomiclock==1.1.3 + # via -r requirements.in +oauthlib==3.2.2 + # via + # kubernetes + # requests-oauthlib +ory-hydra-client==2.2.0 + # via -r requirements.in +ory-kratos-client==1.2.0 + # via -r requirements.in +pip-install==1.3.5 + # via -r requirements.in posix-ipc==1.1.1 -pycparser==2.21 -PyJWT==2.3.0 -pymysql==1.0.2 -pyrsistent==0.18.1 -PyYAML==6.0.1 -regex==2022.3.15 -requests==2.27.1 -requests-oauthlib==1.3.1 + # via -r requirements.in +pyasn1==0.6.0 + # via + # pyasn1-modules + # rsa +pyasn1-modules==0.4.0 + # via google-auth +pydantic==2.9.0 + # via ory-kratos-client +pydantic-core==2.23.2 + # via pydantic +pyjwt==2.9.0 + # via flask-jwt-extended +pymysql==1.1.1 + # via -r requirements.in +python-dateutil==2.9.0.post0 + # via + # kubernetes + # ory-hydra-client + # ory-kratos-client +pytz==2024.1 + # via apscheduler +pyyaml==6.0.2 + # via + # -r requirements.in + # kubernetes +regex==2024.9.11 + # via -r requirements.in +requests==2.32.3 + # via + # -r requirements.in + # kubernetes + # requests-oauthlib +requests-oauthlib==2.0.0 + # via + # -r requirements.in + # kubernetes +rsa==4.9 + # via google-auth six==1.16.0 -tomli==1.2.3 -typing-extensions==4.1.1 -urllib3==1.26.8 -Werkzeug==2.0.3 + # via + # apscheduler + # kubernetes + # python-dateutil +sqlalchemy==2.0.34 + # via flask-sqlalchemy +typing-extensions==4.12.2 + # via + # ory-kratos-client + # pydantic + # pydantic-core + # sqlalchemy +tzdata==2024.1 + # via pydantic +tzlocal==5.2 + # via apscheduler +urllib3==2.0.7 + # via + # kubernetes + # ory-hydra-client + # ory-kratos-client + # requests +websocket-client==1.8.0 + # via kubernetes +werkzeug==3.0.4 + # via + # flask + # flask-jwt-extended diff --git a/backend/web/login/login.py b/backend/web/login/login.py index 46cf292395dc90d376d9492cc9b94a18b2906b35..344a046f74835fe24de7d4d3b94952a80361078c 100644 --- a/backend/web/login/login.py +++ b/backend/web/login/login.py @@ -75,7 +75,7 @@ def recovery(): flow = request.args.get("flow") if not flow: - email = request.args.get("email") + email = request.args.get("email", "") response = redirect(KRATOS_PUBLIC_URL + "self-service/recovery/browser") response.set_cookie("recovery_preset_email", email) return response diff --git a/backend/web/static/base.js b/backend/web/static/base.js index 92095ef107faac4f26a4733341eb1e590010bef3..7b98e040cd19c95736af79b50554ba887905e783 100644 --- a/backend/web/static/base.js +++ b/backend/web/static/base.js @@ -363,11 +363,6 @@ function render_messages(data) { return ""; } - // Not show again if already shown. User probably just reloaded the screen - if (Cookies.get("last_flow_id_rendered_message") == data.id) { - return; - } - var html = ""; messages.forEach((message) => { var type = message.type; @@ -380,9 +375,6 @@ function render_messages(data) { }); $("#contentMessages").html(html); - // Store we shown these messages - Cookies.set("last_flow_id_rendered_message", data.id); - return html; } @@ -456,7 +448,7 @@ function getFormElement(node, context) { "Please provide your e-mail address. If it is registered, we will send a recovery link to that address."; var email = Cookies.get("recovery_preset_email"); if (email) { - value = email; + value = email; Cookies.set("recovery_preset_email", ""); } } diff --git a/deployment/helmchart/CHANGELOG.md b/deployment/helmchart/CHANGELOG.md index 2ffc6427f347850295a23073b9cc79452261ee13..fb410bbb72791778c9ae9c75bd28e5801e704d9c 100644 --- a/deployment/helmchart/CHANGELOG.md +++ b/deployment/helmchart/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.11.1 + +* Update dashboard to version 0.11.1. + ## 1.11.0 * Update dashboard to version 0.11.0. diff --git a/deployment/helmchart/Chart.yaml b/deployment/helmchart/Chart.yaml index 051647d8f5f67ae711a2c1768abc6552b4b9ee86..d311f6f3d309332be5f35f836fafff14e305804a 100644 --- a/deployment/helmchart/Chart.yaml +++ b/deployment/helmchart/Chart.yaml @@ -1,7 +1,7 @@ annotations: category: Dashboard apiVersion: v2 -appVersion: 0.11.0 +appVersion: 0.11.1 dependencies: - name: common # https://artifacthub.io/packages/helm/bitnami/common @@ -23,4 +23,4 @@ name: stackspin-dashboard sources: - https://open.greenhost.net/stackspin/dashboard/ - https://open.greenhost.net/stackspin/dashboard-backend/ -version: 1.11.0 +version: 1.11.1 diff --git a/deployment/helmchart/values.yaml b/deployment/helmchart/values.yaml index 20816c7febf80bd019cf63025d6eba1db382aec9..0ba5d94f204a16ec62af914689f84071951d6802 100644 --- a/deployment/helmchart/values.yaml +++ b/deployment/helmchart/values.yaml @@ -68,7 +68,7 @@ dashboard: image: registry: open.greenhost.net:4567 repository: stackspin/dashboard/dashboard - tag: 0.11.0 + tag: 0.11.1 digest: "" ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -236,7 +236,7 @@ backend: image: registry: open.greenhost.net:4567 repository: stackspin/dashboard/dashboard-backend - tag: 0.11.0 + tag: 0.11.1 digest: "" ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -723,7 +723,7 @@ tests: image: registry: open.greenhost.net:4567 repository: stackspin/dashboard/cypress-test - tag: 0.11.0 + tag: 0.11.1 pullPolicy: IfNotPresent credentials: user: "" diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e9b064f527150ea91098e49e638a920a3544bd97..2758bce7760c11cc9bdc4d2f07b235354944514b 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -41,7 +41,7 @@ function App() { ) : ( <Layout> <Routes> - <Route path="/dashboard" element={<Dashboard />} /> + <Route path="/dashboard" element={<Dashboard isAdmin={isAdmin} />} /> <Route path="/users" element={<ProtectedRoute />}> <Route index element={<Users />} /> </Route> diff --git a/frontend/src/modules/dashboard/Dashboard.tsx b/frontend/src/modules/dashboard/Dashboard.tsx index 45ce92b14e6703e4c223925201647fe641b1fdb8..48be9f0e31e9e3397e62ed80ee1147eef2426347 100644 --- a/frontend/src/modules/dashboard/Dashboard.tsx +++ b/frontend/src/modules/dashboard/Dashboard.tsx @@ -15,7 +15,11 @@ import { AppStatusEnum } from 'src/services/apps/types'; import { DashboardCard, DashboardUtility, UpdateAlert, VersionInfo } from './components'; import { DASHBOARD_QUICK_ACCESS, HIDDEN_APPS, UTILITY_APPS } from './consts'; -export const Dashboard: React.FC = () => { +type DashboardProps = { + isAdmin: boolean; +}; + +export const Dashboard = ({ isAdmin }: DashboardProps) => { const host = window.location.hostname; const splitedDomain = host.split('.'); splitedDomain.shift(); @@ -67,7 +71,7 @@ export const Dashboard: React.FC = () => { .filter((app) => app.status !== AppStatusEnum.NotInstalled) // .filter((app) => !app.external) .map((app) => { - const version = appVersions[app.slug as keyof typeof appVersions]; + const version = isAdmin ? appVersions[app.slug as keyof typeof appVersions] : ''; return <DashboardCard app={app} key={app.name} version={version} />; })} </div> diff --git a/renovate.json b/renovate.json index 3644c8c9361cc137031cbd352145bb7f4dade9be..1d9a3a789a0f9c9f0e6fbd55041cc43d23132a2a 100644 --- a/renovate.json +++ b/renovate.json @@ -9,8 +9,8 @@ "packageRules": [ { "matchDepNames": ["node"], - "matchFiles": ["frontend/Dockerfile", ".gitlab-ci.yml"], - "allowedVersions": "!/^\d*[13579](-.*)?$/" + "matchFileNames": ["frontend/Dockerfile", ".gitlab-ci.yml"], + "allowedVersions": "!/^\\d*[13579](-.*)?$/" } ] }