cloudstack-mirror/ui
Daman Arora 33c3967b6b
Some checks are pending
CodeQL Analysis / CodeQL (actions) (push) Waiting to run
Docker Image Build / build (push) Waiting to run
Sonar Quality Check (Main) / Sonar JaCoCo Coverage (push) Waiting to run
Add per-domain OAuth (Google, GitHub) provider support (#12702)
* Add domain_id to oauth_provider table and VO

* Add domain-aware methods to OauthProviderDao

* Add domainId parameter to OAuth provider API commands and response

* Add domain support to OAuth2AuthManager

* Add domain-aware OAuth verification

* Add domain support to ListOAuthProvidersCmd and update related tests

* fix domain path issue

* Add domainId support to OAuth provider

* Return domain name and UUID in OAuth provider API responses using ApiDBUtils

* Refactor domain ID resolution in VerifyOAuthCodeAndGetUserCmd to improve code clarity

* Enhance OAuth2 plugin support for domain-level configuration and authentication checks

* Update OAuth2 tests and VerifyOAuthCodeAndGetUserCmdTest

* Add method to find OAuth provider by domain with global fallback

* Update OAuth provider configuration to use 'domain' instead of 'domainid' in columns and details

* Refactor OAuth provider methods to support domain-level queries and enhance user verification

* Add caching for access token retrieval in GithubOAuth2Provider

* Refactor access token checks in GithubOAuth2Provider to use StringUtils for improved readability and consistency

* Refactor null checks to use utility for improved readability and consistency

* Update OAuth2UserAuthenticatorTest to include domainId in user verification method

* Remove unnecessary blank line and unused imports in OAuth provider command classes

* Refactor and cleanup

* Remove unnecessary blank lines

* Enhance RegisterOAuthProviderCmdTest with additional provider mock data

* Remove startup gate from OAuth plugin initialization to support dynamic config toggling

* Add strictScope to ConfigKey to disable global fallback for domain-scoped oauth2.enabled

* Add domain-scoped provider filtering to listOauthProvider and centralize domain resolution in OAuth2AuthManager

* Add External OAuth tab with domain-scoped provider selection to login page

* code cleanup

* test fix

* Handle login page provider visibility

* UI cleanup

* UI Cleanup

* Keep text color consistent

* add unit tests

* Add Multiple-domain OAuth tests

* Refactor as per PR comments

* Use idempotent DDL helpers for oauth_provider schema migration

* Use global config check for global providers and extract oauthEnabled variable

* Make strictScope return null when id is null

* Rename verification methods to use 'verifySecretCodeAndFetchEmail' for consistency

* Refactor domain handling in OAuth2AuthManagerImpl to use DomainService instead of DomainDao

* Enhance domain ID descriptions in OAuth command classes for clarity

* Add domain path handling to OAuth provider commands and improve descriptions

* Update domain path description in VerifyOAuthCodeAndGetUserCmd to clarify behavior with Domain ID

* Replace remove method with expunge in deleteOauthProvider and add corresponding unit test

* Add external login label to Login.vue and update i18n locale handling

* Fix stale value issue in updateConfiguration response handling in ConfigurationValue.vue

* Enhance OAuth login error handling and add unit test for missing parameters

* Add validation to reject enabling OAuth provider when plugin is disabled at domain scope

* Add domain reassignment support to UpdateOAuthProviderCmd and enhance validation in OAuth2AuthManagerImpl

* Add domain ID to OAuth provider arguments in config

* Fix condition for OAuth verification URL handling in router

* Add domain path to OauthProviderResponse and update UI config to display it

* Update config to remove 'secretkey' from columns and details

* Add secretkey to details in config and display in DetailsTab

* Implement normalization of ROOT domain to null for global OAuth provider handling and add corresponding unit tests

* Refactor OAuth plugin domain scope handling to use a centralized method for enabling checks

* Add strict scope handling to ConfigKey and update OAuth2AuthManager usage

* Implement domain removal listener to clean up OAuth providers on domain deletion

* Enhance OAuth tab icons with disabled state styling for better UX

* Add domain-specific provider prompt and update OAuth provider handling

---------

Co-authored-by: Daman Arora <daman.arora@shapeblue.com>
2026-07-09 16:30:31 +05:30
..
docs [CI] Create .codespellrc; upgrade codespell hook; fix typos (#12824) 2026-03-31 15:04:05 +02:00
nginx docker: add container build files and instructions (#22) 2021-01-20 07:06:14 +05:30
public Add per-domain OAuth (Google, GitHub) provider support (#12702) 2026-07-09 16:30:31 +05:30
src Add per-domain OAuth (Google, GitHub) provider support (#12702) 2026-07-09 16:30:31 +05:30
tests UI: Fix missing label.allocated key in Status widget test mock (#13546) 2026-07-07 12:43:07 +02:00
.babelrc pre-commit: apply end-of-file-fixer to all files (#7551) 2023-08-02 13:47:21 +02:00
.editorconfig editorconf: Remove CRLF editor config (#23) 2021-01-20 07:06:14 +05:30
.env.local.example README updates and CS_URL fix 2021-01-20 07:06:13 +05:30
.env.local.https.example vue: allow both http and https configuration (#2) 2021-01-20 07:06:14 +05:30
.env.primate-qa ui: show zones and offerings to users (#7557) 2023-05-25 13:44:44 +02:00
.env.qa Merge branch '4.19' into 4.20 2025-05-16 15:51:37 +02:00
.gitattributes pre-commit: apply end-of-file-fixer to all files (#7551) 2023-08-02 13:47:21 +02:00
.gitignore local versions of .env ignored (#6256) 2022-04-13 09:46:07 -03:00
.prettierrc
babel.config.js Explore Test Automation (#320) 2021-01-20 07:06:24 +05:30
docker.sh Possiblity to choose between docker and podman from the command line (#5217) 2021-08-19 13:13:34 +05:30
Dockerfile Removed deprecated instruction MAINTAINER (#8846) 2024-09-20 09:28:46 +02:00
index.html Use lowercase HTTP header field names so we are compatible with HTTP/2 (#7006) 2023-01-23 11:17:54 +01:00
jest.config.js Generate coverage for Simulator based integration tests & ui tests in github actions (#7784) 2023-09-11 14:14:12 +05:30
jsconfig.json
LICENSE
package-lock.json Allow configuring Announcement banner by admin (#10951) 2025-07-07 13:56:58 +05:30
package.json ui: bump nodejs v24 LTS usage (#12471) 2026-01-28 12:16:34 +01:00
postbuild.sh ui: prevent same string docHelp override (#5014) 2021-05-12 16:20:17 +05:30
prebuild.sh ui: prevent same string docHelp override (#5014) 2021-05-12 16:20:17 +05:30
README.md Remove broken ViserJS attribution link from UI README (#12724) 2026-03-03 16:15:09 +01:00
theme.config.js UI: Upgrade to Vue3 library (#5151) 2022-03-09 09:47:09 -03:00
vue.config.js 4.19 fix saml account selector (#10311) 2025-04-14 12:59:43 +02:00
webstorm.config.js src: add apache v2.0 license header to files 2021-01-20 07:06:14 +05:30

CloudStack UI

A modern role-based progressive CloudStack UI based on Vue.js and Ant Design.

Screenshot

Getting Started

Install node: (Debian/Ubuntu)

curl -sL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt-get install -y nodejs
# Or use distro provided: sudo apt-get install npm nodejs

Install node: (CentOS/Fedora/RHEL)

curl -sL https://rpm.nodesource.com/setup_24.x | sudo bash -
sudo yum install nodejs

Install node: (Mac OS)

brew install node@24

Optionally, you may also install system-wide dev tools:

sudo npm install -g @vue/cli npm-check-updates

Development

Clone the repository:

git clone https://github.com/apache/cloudstack.git
cd cloudstack/ui
npm install

Override the default CS_URL to a running CloudStack management server:

cp .env.local.example .env.local
Change the `CS_URL` in the `.env.local` file

To configure https, you may use .env.local.https.example.

To use the community Simulator QA server you can do this:

echo "CS_URL=https://qa.cloudstack.cloud" > .env.local

This may be required for newer npm versions:

export NODE_OPTIONS=--openssl-legacy-provider

Build and run:

npm run serve
# Or run: npm start

Upgrade dependencies to the latest versions:

ncu -u

Run Lint and Unit Tests:

npm run lint
npm run test:unit

Fix issues and vulnerabilities:

npm audit

A basic development guide and explanation of the basic components can be found here

Production

Fetch dependencies and build:

npm install
npm run build

This creates a static webpack application in dist/, which can then be served from any web server or CloudStack management server (jetty).

To use CloudStack management server (jetty), you may copy the built UI to the webapp directory on the management server host. For example:

npm install
npm run build
cd dist
mkdir -p /usr/share/cloudstack-management/webapp/
cp -vr . /usr/share/cloudstack-management/webapp/
# Access UI at {management-server}:8080/client in browser

If the webapp directory is changed, please change the webapp.dir in the /etc/cloudstack/management/server.properties and restart the management server host.

To use a separate webserver, note that the API server is accessed through the path /client, which needs be forwarded to an actual CloudStack instance.

For example, a simple way to serve UI with nginx can be implemented with the following nginx configuration (to be put into /etc/nginx/conf.d/default.conf or similar):

server {
    listen       80;
    server_name  localhost;
    location / {
        # /src/ui/dist contains the built UI webpack
        root   /src/ui/dist;
        index  index.html;
    }
    location /client/ {
        # http://127.0.0.1:800 should be replaced your CloudStack management
        # server's actual URI
        proxy_pass   http://127.0.0.1:8000;
    }
}

Docker

A production-ready Docker container can also be built with the provided Dockerfile and build script.

Make sure Docker is installed, then run:

bash docker.sh

Change the example configuration in nginx/default.conf according to your needs.

Run UI:

docker run -ti --rm -p 8080:80 -v $(pwd)/nginx:/etc/nginx/conf.d:ro cloudstack-ui:latest

Packaging

The following is tested to work on any Ubuntu 18.04/20.04 base installation or docker container:

# Install nodejs (lts)
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs debhelper rpm
# Install build tools
npm install -g @vue/cli webpack eslint
# Clone this repository and run package.sh
cd <cloned-repository>/packaging
bash -x package.sh

Documentation

Attributions

The UI uses the following:

History

The modern UI, originally called Primate, was created by Rohit Yadav over several weekends during late 2018 and early 2019. During ApacheCon CCCUS19, on 9th September 2019, Primate was introduced and demoed as part of the talk Modern UI for CloudStack (video). Primate was accepted by the Apache CloudStack project on 21 Oct 2019. The original repo was merged with the main apache/cloudstack repo on 20 Jan 2021.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.