Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b952398
chore(tilt): initial commit generate tilt file
zoran-sinnema Sep 5, 2025
f91f71a
chore(CH-217): removed some debug code from tilt generator
zoran-sinnema Sep 5, 2025
9789fb5
(chore) linting fix
filippomc Sep 8, 2025
7b83e67
chore(tilt): fix for tasks dockerfile
zoran-sinnema Sep 9, 2025
fdc128f
chore(tilt): add non deployment builds to parent app as requirement
zoran-sinnema Sep 9, 2025
272e2f5
chore(tilt): fix for tasks dockerfile
zoran-sinnema Sep 9, 2025
4d411fe
chore: add option to skip ingress controller install
zoran-sinnema Sep 10, 2025
81b002a
chore(CH-217): added opt-in for setup infrastructure
zoran-sinnema Sep 11, 2025
d456084
chore(CH-217): add some sleep time to give ingress tme to start
zoran-sinnema Sep 11, 2025
955f078
chore(CH-217): some fixes for jupyterhub
zoran-sinnema Sep 19, 2025
4bd4fea
fix: mongodb k8s probes
zoran-sinnema Nov 27, 2025
c69e68b
fix: tilt set app in debug mode
zoran-sinnema Nov 27, 2025
ca23ef7
chore(tilt): enable --watch cli parameter
zoran-sinnema Nov 27, 2025
a796cb3
chore: create api user now also (re)sets the password to the one stor…
zoran-sinnema Dec 2, 2025
6ad98d1
fix: keycloak update attributes clearing the first and lastname
zoran-sinnema Dec 2, 2025
d430b3d
Merge branch 'develop' into IFNS-29-upgrade-ifn
zoran-sinnema Dec 3, 2025
f858ab2
Revert "Merge branch 'develop' into IFNS-29-upgrade-ifn"
zoran-sinnema Dec 3, 2025
28992bd
CH-207 fix images path - reverts CH-194
filippomc Nov 18, 2025
1ba1da3
fix: init kc event listener on app startup
zoran-sinnema Dec 4, 2025
af6f409
chore: small code cleanup and fix in ch django events
zoran-sinnema Dec 4, 2025
53907b4
chore: wait 1s before processing the KC event, this will make sure KC…
zoran-sinnema Dec 4, 2025
61b8d39
fix: added missing ,"unmanagedAttributePolicy":"ENABLED" to realm.jso…
zoran-sinnema Dec 5, 2025
aafe2e6
chore: resolve merge conflicts
zoran-sinnema Dec 5, 2025
2788eb0
chore: resolve merge conflicts
zoran-sinnema Dec 5, 2025
1bd49c2
chore: resolve merge conflicts
zoran-sinnema Dec 5, 2025
1bd4412
feat: refactor accounts realm.json to use templates
zoran-sinnema Dec 5, 2025
ec405ce
chore: resolve merge conflicts
zoran-sinnema Dec 10, 2025
57a3d20
chore: resolve merge conflicts
zoran-sinnema Dec 11, 2025
e4f3c04
deployment configuration using ip local machine rather than cluster i…
ddelpiano Jan 20, 2026
48ae70f
dns resolution issue
ddelpiano Jan 20, 2026
be98297
some fixes due to values.yaml generated not picking up the correct lo…
ddelpiano Jan 21, 2026
ca4a6d0
fixing user profile schema for new keycloak to work with mnp-checkout
ddelpiano Apr 14, 2026
20ae3c7
Merge branch 'develop' of github.com:MetaCell/cloud-harness into IFNS…
ddelpiano Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret! TODO change this
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-81kv$0=07xac7r(pgz6ndb5t0at4-z@ae6&f@u6_3jo&9d#4kl"

# SECURITY WARNING: don't run with debug turned on in production!
Expand Down Expand Up @@ -164,4 +164,3 @@
]

KC_DEFAULT_USER_ROLE = None # don't add the user role to the realm default role
SESSION_COOKIE_AGE = 3600
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret! TODO change this
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-81kv$0=07xac7r(pgz6ndb5t0at4-z@ae6&f@u6_3jo&9d#4kl"

# SECURITY WARNING: don't run with debug turned on in production!
Expand Down Expand Up @@ -165,4 +165,3 @@
]

KC_DEFAULT_USER_ROLE = None # don't add the user role to the realm default role
SESSION_COOKIE_AGE = 3600
9 changes: 5 additions & 4 deletions application-templates/flask-server/backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
connexion[swagger-ui,flask,gunicorn]>=3.0.0,<4.0.0
swagger-ui-bundle>=1.1.0
python_dateutil >= 2.9.0
connexion[swagger-ui]==2.14.2
Flask == 2.2.5
swagger-ui-bundle==0.0.9
python_dateutil >= 2.6.0
setuptools >= 21.0.0
gunicorn


6 changes: 3 additions & 3 deletions applications/accounts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/keycloak/keycloak:26.4
FROM quay.io/keycloak/keycloak:26.4.0

EXPOSE 9000
EXPOSE 8080
Expand All @@ -12,7 +12,7 @@ USER keycloak
COPY themes/custom /opt/keycloak/themes/custom

# # keycloak kafka listener plugin
COPY plugins/* /opt/keycloak/providers/
COPY plugins/metacell-admin-event-listener-module-1.0.0.jar /opt/keycloak/providers/

ENTRYPOINT [ "/opt/keycloak/bin/kc-entrypoint.sh" ]
CMD [ "start", "--import-realm" ]
CMD [ "start-dev", "--import-realm", "--health-enabled=true", "--metrics-enabled=true" ]
2 changes: 1 addition & 1 deletion applications/accounts/admin-event-listener/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Building
```
mvn clean install
cp ./ear-module/target/metacell-admin-event-listener-bundle-0.1.0.ear ../plugins/
cp ./jar-module/target/metacell-admin-event-listener-module-1.0.0.jar ../plugins/
```

## Install
Expand Down
4 changes: 2 additions & 2 deletions applications/accounts/deploy/templates/_components.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"subComponents": {},
"config": {
"kc.user.profile.config": [
"{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}],\"unmanagedAttributePolicy\":\"ENABLED\"}"
"{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"stripe_uid\",\"displayName\":\"Stripe UID\",\"validations\":{},\"annotations\":{},\"permissions\":{\"view\":[\"admin\"],\"edit\":[\"admin\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}],\"unmanagedAttributePolicy\":\"ENABLED\"}"
]
}
}
Expand Down Expand Up @@ -72,4 +72,4 @@
{{template "deploy_accounts_utils.user_profile_provider_component" }},
{{template "deploy_accounts_utils.key_provider_component" }}
},
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
{{- end -}}
],
{{- end }}
{{- end -}}
{{- end -}}
3 changes: 0 additions & 3 deletions applications/accounts/deploy/values-local.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions applications/accounts/deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,25 @@ admin:
user: admin
role: administrator
editUsernameAllowed: true
<<<<<<< HEAD
useEvents: false
identityProviders:
- github
- google
=======
useEvents: true
identityProviders:
- github
- google
>>>>>>> 9f4f35931c012c1aeb753c466f0b5c1164a4ff10
theme:
login: "keycloak"
account: "keycloak"
admin: "keycloak"
<<<<<<< HEAD
email: "keycloak"
=======
email: "keycloak"
realm:
organizationsEnabled: false
>>>>>>> 9f4f35931c012c1aeb753c466f0b5c1164a4ff10
5 changes: 5 additions & 0 deletions applications/accounts/dev/disable-theme-cache.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
embed-server --std-out=echo --server-config=standalone-ha.xml
/subsystem=keycloak-server/theme=defaults/:write-attribute(name=cacheThemes,value=false)
/subsystem=keycloak-server/theme=defaults/:write-attribute(name=cacheTemplates,value=false)
/subsystem=keycloak-server/theme=defaults/:write-attribute(name=staticMaxAge,value=-1)
stop-embedded-server
80 changes: 41 additions & 39 deletions applications/accounts/dev/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
name: keycloak-dev
version: '3.2'

services:
postgres:
image: postgres
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- pg_data:/var/lib/postgresql/data/pgdata
image: postgres
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- pg_data:/var/lib/postgresql/data/pgdata

keycloak:
image: quay.io/keycloak/keycloak:26.3.4
command: ["start-dev",
"--spi-theme-static-max-age=1",
"--spi-theme-cache-themes=false",
"--spi-theme-cache-templates=false",
"--hostname", "http://localhost:8080",
"--hostname-backchannel-dynamic", "true"]
environment:
KC_DB_VENDOR: POSTGRES
KC_DB_URL_HOST: postgres
KC_DB: postgres
KC_DB_URL_DATABASE: "postgres"
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: password
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: Pa55w0rd
KC_HEALTH_ENABLED: "true"
KC_METRICS_ENABLED: "true"
KC_HTTP_ENABLED: "true"
KC_HOSTNAME_STRICT: "false"
KC_HOSTNAME_STRICT_HTTPS: "false"
ports:
- "8080:8080"
depends_on:
- postgres
volumes:
- type: bind
source: ../themes/custom
target: /opt/keycloak/themes/custom
image: quay.io/keycloak/keycloak:16.1.1
environment:
DB_VENDOR: POSTGRES
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_USER: keycloak
DB_SCHEMA: public
DB_PASSWORD: password
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: Pa55w0rd

ports:
- 8080:8080
depends_on:
- postgres
volumes:
- type: bind
source: ../themes/custom
target: /opt/jboss/keycloak/themes/custom
# disable cache
- type: bind
source: ./disable-theme-cache.cli
target: /opt/jboss/startup-scripts/disable-theme-cache.cli
- type: bind
source: ../scripts/create_api_user.sh
target: /opt/jboss/startup-scripts/create_api_user.sh
- type: bind
source: ../plugins/metacell-admin-event-listener-bundle-1.0.0.ear
target: /opt/jboss/keycloak/standalone/deployments/metacell-admin-event-listener-bundle-1.0.0.ear
volumes:
pg_data:
pg_data:
Binary file not shown.
2 changes: 1 addition & 1 deletion applications/accounts/scripts/kc-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ for script in /opt/keycloak/startup-scripts/*.sh;
fi
done

wait
wait
40 changes: 40 additions & 0 deletions applications/common/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,46 @@ servers:
url: /api
description: SwaggerHub API Auto Mocking
paths:
'/sentry/getdsn/{appname}':
get:
tags:
- Sentry
responses:
'200':
content:
application/json:
schema:
type: object
description: Sentry DSN for the given application
'400':
content:
application/json:
schema:
type: object
text/html:
schema:
type: string
description: Sentry not configured for the given application
'404':
content:
application/problem+json:
schema:
type: object
text/html:
schema:
type: string
description: Sentry not configured for the given application
operationId: getdsn
summary: Gets the Sentry DSN for a given application
description: Gets the Sentry DSN for a given application
x-openapi-router-controller: common.controllers.sentry_controller
parameters:
-
name: appname
schema:
type: string
in: path
required: true
/accounts/config:
get:
tags:
Expand Down
3 changes: 0 additions & 3 deletions applications/common/deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ harness:
auto: true
port: 8080
name: common
proxy:
gatekeeper:
replicas: 1
deployment:
auto: true
name: common
Expand Down
3 changes: 1 addition & 2 deletions applications/common/server/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ Dockerfile
*/__main__.py
*/test/*
test-requirements.txt
.dockerignore
*/requirements.txt
.dockerignore
1 change: 1 addition & 0 deletions applications/common/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ COPY . /usr/src/app
ENV FLASK_ENV=production
ENV APP_SETTINGS=common.config.ProductionConfig
RUN pip3 install -e /usr/src/app
ENTRYPOINT gunicorn --workers=$WORKERS --bind=0.0.0.0:$PORT $MODULE_NAME.__main__:app
12 changes: 11 additions & 1 deletion applications/common/server/common/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

from cloudharness.utils.server import init_flask, main
from cloudharness import log
from flask_cors import CORS
from common.repository.db import open_db
from common.controllers.sentry_controller import global_dsn


app = init_flask()
def init_fn(app):
log.info("initializing database from app")
cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
if not global_dsn:
open_db(app)


app = init_flask(init_app_fn=init_fn)

if __name__ == '__main__':
main()
53 changes: 53 additions & 0 deletions applications/common/server/common/controllers/sentry_controller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import os
import requests

from cloudharness import applications, log
from cloudharness.utils.env import get_sentry_service_cluster_address
from common.repository.sentry import get_token, get_dsn, SentryProjectNotFound


try:
global_dsn = os.environ.get("SENTRY_DSN", "")
if len(global_dsn) < 1:
global_dsn = None
except:
global_dsn = None


def getdsn(appname): # noqa: E501
"""
Gets the Sentry DSN for a given application or returns the global dsn when set
global dsn can be set using the kubectl command
kubectl create secret generic -n mnp mnp-sentry --from-literal=dsn=<dsn>
:param appname:
:type appname: str
:rtype: str
"""
try:
ch_app = applications.get_configuration(appname)
except applications.ConfigurationCallException as e:
return {"error": f"Application `{appname}` does not exist"}, 400
if ch_app.is_sentry_enabled():
if global_dsn:
# if a global dsn env var is set and not empty then use this
dsn = global_dsn
else:
try:
dsn = get_dsn(appname)
except SentryProjectNotFound as e:
# if project not found, create one
try:
sentry_api_token = get_token()
headers = {'Authorization': 'Bearer ' + sentry_api_token}
url = get_sentry_service_cluster_address() + f'/api/0/teams/sentry/sentry/projects/'
data = {'name': appname}
response = requests.post(
url, data, headers=headers, verify=False)
dsn = get_dsn(appname)
except:
log.error("Error on Sentry initialization", exc_info=True)
# FIXME temporary fix
return {"error": "Sentry not initialized"}, 400
else:
dsn = ''
return {'dsn': dsn}
5 changes: 3 additions & 2 deletions applications/common/server/common/encoder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from connexion.apps.flask_app import FlaskJSONEncoder
import six

from common.models.base_model import Model
from common.models.base_model_ import Model


class JSONEncoder(FlaskJSONEncoder):
Expand All @@ -9,7 +10,7 @@ class JSONEncoder(FlaskJSONEncoder):
def default(self, o):
if isinstance(o, Model):
dikt = {}
for attr in o.openapi_types:
for attr, _ in six.iteritems(o.openapi_types):
value = getattr(o, attr)
if value is None and not self.include_nulls:
continue
Expand Down
3 changes: 3 additions & 0 deletions applications/common/server/common/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# coding: utf-8

# flake8: noqa
from __future__ import absolute_import
# import models into model package
from common.models.app_version import AppVersion
from common.models.get_config200_response import GetConfig200Response
Loading
Loading