-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GUI whitelabel runtime system #8942
base: main
Are you sure you want to change the base?
Conversation
interesting |
@blueorangutan package |
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 9322 |
@blueorangutan test alma9 kvm-alma9 keepEnv |
@DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests |
[SF] Trillian test result (tid-9917)
|
@blueorangutan package |
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9365 |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
[SF] Trillian test result (tid-9967)
|
nice work @BryanMLima , haven't reviewed all of it, but I like it so far. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8942 +/- ##
============================================
- Coverage 15.78% 15.77% -0.02%
- Complexity 12565 12583 +18
============================================
Files 5627 5640 +13
Lines 492260 493080 +820
Branches 63882 62479 -1403
============================================
+ Hits 77710 77775 +65
- Misses 406076 406828 +752
- Partials 8474 8477 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great, just a few minor remarks.
server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java
Outdated
Show resolved
Hide resolved
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
3bb39f7
to
a6ad100
Compare
@blueorangutan package |
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11366 |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-11707)
|
Description
1. Problem description
Currently ACS allows the GUI personalization (color changing, add a personalized logo, and so on); however, those configurations are set for the whole environment, which does not allow Apache CloudStack to have a personalized GUI by domain, account and so on. In a scenario of cloud providers reselling the infrastructure, the current behavior does not allow the operators to personalize the GUI for each use case (reseller, domain, account, and so on).
2. Proposed Changes
This spec introduces the concept of Runtime White Label to the Apache CloudStack GUI, which combines the market concept of White Label and enables it to be configured in runtime and by scope (domain, account, and so on). Briefly, we will introduce APIs to allow the operators to define GUI themes for a set of Internet common names (fixed or wildcard), a set of ACS domain UUIDs (also known as ID for the end-user), and a set of ACS account UUIDs (also known as ID for the end-user). The APIs will receive the CSS and JSON configuration as parameter and will store them into the database. When accessing Apache CloudStack, the UI will retrieve the CSS and JSON configurations according to the access definition and import them into the browser. If there are no themes match, the GUI will fallback to the current environment configuration.
Operations that create/modify/remove the themes will be registered with events in ACS.
2.1. Database model
A table named
gui_themes
will be created in thecloud
schema and will have the following columns:*acme.com,acme2.com
.common_names
is informed. If thedomain_uuids
oraccount_uuids
is informed, it is considered asfalse
.2.2. APIs
Right below there are the descriptions of the APIs to be introduced to allow the management of GUI themes by scope.
2.2.1. createGuiTheme
The API
createGuiTheme
will be accessible only by the operators (Root Admin accounts) and will allow them to create themes for several scopes. It will have the following parameters:*acme.com,acme2.com
domainnames
is informed. If thedomainids
oraccountids
is informed, it is considered asfalse
.Either
css
orjsonconfiguration
parameter must be informed for the GUI theme creation. If neithercommonnames
,domainids
, andaccountids
is defined, the theme will be considered as the default; there can exist only one default theme and it automatically will be public. If there are no themes match, the GUI will fallback to the current environment configuration.2.2.2. listGuiThemes
The API
listGuiThemes
will be accessible by anyone and will retrieve the themes according to the parameters and the caller access. It will have the following parameters:true
, than all other parameters are ignored.In order to allow the theme to be displayed yet in the login web page, it will be possible to call this API without authentication; however, there will be limitations and all the parameters will be ignored. An unauthenticated call to the API
listGuiThemes
will retrieve no entry or only a single entry; the single entry will be the default theme or the public, most recently, and active theme that matches the Internet common name requesting the API.2.2.3. updateGuiTheme
The API
updateGuiTheme
will be accessible only by the operators (Root Admin accounts) and will allow them to update a theme. It will have the following parameters:*acme.com,acme2.com
domainnames
is informed. If thedomainids
oraccountids
is informed, it is considered asfalse
.By default, all the parameters are
null
; therefore, to remove one of the parameters, it will be necessary to explicitly pass it as an empty string. Ifcommonnames
,domainids
, andaccountids
are passed as empty, the theme will be considered as the default; there can exist only one default theme and it automatically will be public. If there are no themes match, the GUI will fallback to the current environment configuration.2.2.4. removeGuiTheme
The API
removeGuiTheme
will be accessible only by the operators (Root Admin accounts) and will allow them to remove a theme. It will have the following parameter:If the default theme is removed and there is no match to a theme access configuration, the GUI will fallback to the current environment configuration.
3.0. Future works
With this proposal, it will be only possible to manage the themes via API; for the future, we plan to add support for the themes management on the GUI. We will extend the feature to comply with projects, identity federation and domains change. Also, we will extend the feature to allow domain admins and users to manage their own themes.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
There were two themes added with this PR: Dark theme and Apache Foundation theme. They can be used by anyone using the
createGuiTheme
API. They serve only to demonstrate the usage of this new feature, as presented in the screenshots below:Dark theme:
How Has This Been Tested?
I created multiple themes for specific accounts, domains and common names; they were correctly assigned.
How did you try to break this feature and the system with this change?