Find a file
2022-09-17 02:04:30 +00:00
areas Merge branch 'main' into feat/batch-create-users 2022-07-21 17:08:41 +02:00
cliapp Show user roles in CLI 2022-08-31 17:17:27 +02:00
helpers add me endpoint 2022-07-13 10:29:25 +00:00
migrations add apps migration 2022-06-14 17:37:24 +02:00
proxy Docker based proxy 2022-06-23 09:27:54 +00:00
web replace tmp variable name, doc improvements 2022-07-21 16:53:08 +02:00
.gitignore implement logout endpoint to be called by Hydra on logout 2022-05-12 16:08:05 +02:00
.gitlab-ci.yml Rename admin-backend to dashboard-backend 2021-11-22 15:54:46 +01:00
app.py MR comments 2022-06-09 12:21:47 +02:00
config.py Refactor integrations of sso 2022-04-13 10:27:17 +02:00
database.py try to add a Migrate call so we can migrate I hope 2022-04-05 12:16:01 +02:00
docker-compose.yml chore(deps): update bitnami/kubectl docker tag to v1.25.1 2022-09-17 02:04:30 +00:00
Dockerfile fix(Dockerfile): Cleanup for dockerfile 2021-11-02 09:51:44 +01:00
LICENSE Add AGPL license 2021-11-22 16:05:48 +01:00
README.md Docker based proxy 2022-06-23 09:27:54 +00:00
renovate.json Auto-assign @luka to renovate MRs 2022-04-28 08:57:24 +00:00
requirements.txt upgrade: make changes to be compatible with Kratos 0.9.0-alpha.3 2022-04-29 12:34:12 +02:00
run_app.sh Docker based proxy 2022-06-23 09:27:54 +00:00

Stackspin dashboard backend

Backend for the Stackspin dashboard

Login application

Apart from the dashboard backend this repository contains a flask application that functions as the identity provider, login, consent and logout endpoints for the OpenID Connect (OIDC) process. The application relies on the following components:

  • Hydra: Hydra is an open source OIDC server. It means applications can connect to Hydra to start a session with a user. Hydra provides the application with the username and other roles/claims for the application. Hydra is developed by Ory and has security as one of their top priorities.

  • Kratos: This is Identity Manager and contains all the user profiles and secrets (passwords). Kratos is designed to work mostly between UI (browser) and kratos directly, over a public API endpoint. Authentication, form-validation, etc. are all handled by Kratos. Kratos only provides an API and not UI itself. Kratos provides an admin API as well, which is only used from the server-side flask app to create/delete users.

  • MariaDB: The login application, as well as Hydra and Kratos, need to store data. This is done in a MariaDB database server. There is one instance with three databases. As all databases are very small we do not foresee resource limitation problems.

If Hydra hits a new session/user, it has to know if this user has access. To do so, the user has to login through a login application. This application is developed by the Stackspin team (Greenhost) and is part of this repository. It is a Python Flask application The application follows flows defined in Kratos, and as such a lot of the interaction is done in the web-browser, rather then server-side. As a result, the login application has a UI component which relies heavily on JavaScript. As this is a relatively small application, it is based on traditional Bootstrap + JQuery.

Development

To develop the Dashboard, you need a Stackspin cluster that is set up as a development environment. Follow the instructions in the dashboard-dev-overrides repository in order to set up a development-capable cluster. The end-points for the Dashboard, as well as Kratos and Hydra, will point to http://stackspin_proxy:8081 in that cluster. As a result, you can run components using the docker-compose file in this repository, and still log into Stackspin applications that run on the cluster.

Setting up the local development environment

After this process is finished, the following will run locally:

The following will be available locally through a proxy and port-forwards:

  • Hydra admin
  • Kratos admin and public
  • The MariaDB database connections

These need to be available locally, because Kratos wants to run on the same domain as the front-end that serves the login interface.

1. Setup hosts file

The application will run on http://stackspin_proxy. Add the following line to /etc/hosts to be able to access that from your browser:

127.0.0.1	stackspin_proxy

2. Kubernetes access

The script needs you to have access to the Kubernetes cluster that runs Stackspin. Point the KUBECONFIG environment variable to a kubectl config. That kubeconfig will be mounted inside docker containers, so also make sure your Docker user can read it.

3. Run it all

Now, run this script that sets a few environment variables based on what is in your cluster secrets, and starts docker-compose to start a reverse proxy as well as the flask application in this repository.

./run_app.sh

4. Front-end developmenet

Start the dashboard front-end app.