Page MenuHomeSoftware Heritage

keycloak: Add swh theme configuration and deployment
ClosedPublic

Authored by anlambert on Jul 16 2020, 5:28 PM.

Details

Summary

Add Software Heritage theme for Keycloak deployment and configuration.

The theme is deployed by fetching a specific tag from the theme git repository
and copying the files to the Keycloak themes folder.

I successfully tested the changes using pupperware.

Below is the relevant output of octocatalog-diff.

17:08 $ bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details -t staging kelvingrove.internal.softwareheritage.org
Found host kelvingrove.internal.softwareheritage.org
WARN     -> Environment "add-keycloak-realm-and-client" contained non-word characters, correcting name to add_keycloak_realm_and_client
WARN     -> Environment "api-remove-rl-for-m" contained non-word characters, correcting name to api_remove_rl_for_m
WARN     -> Environment "change-swh-web-static-dir" contained non-word characters, correcting name to change_swh_web_static_dir
WARN     -> Environment "icinga-rv-log" contained non-word characters, correcting name to icinga_rv_log
WARN     -> Environment "keycloak-add-swh-theme" contained non-word characters, correcting name to keycloak_add_swh_theme
WARN     -> Environment "openaire-ips" contained non-word characters, correcting name to openaire_ips
WARN     -> Environment "swh-web-conf-update" contained non-word characters, correcting name to swh_web_conf_update
WARN     -> Environment "swh-web-remove-recaptcha" contained non-word characters, correcting name to swh_web_remove_recaptcha
WARN     -> Environment "update-webapp-conf" contained non-word characters, correcting name to update_webapp_conf
WARN     -> Environment "webapp-exempt-dinsic" contained non-word characters, correcting name to webapp_exempt_dinsic
WARN     -> Environment "webapp-set-search-empty-dict" contained non-word characters, correcting name to webapp_set_search_empty_dict
Clonage dans '/tmp/swh-ocd.TUiaUmEB/environments/production/data/private'...
fait.
Clonage dans '/tmp/swh-ocd.TUiaUmEB/environments/staging/data/private'...
fait.
*** Running octocatalog-diff on host kelvingrove.internal.softwareheritage.org
I, [2020-07-16T17:09:14.324522 #20222]  INFO -- : Catalogs compiled for kelvingrove.internal.softwareheritage.org
I, [2020-07-16T17:09:15.358764 #20222]  INFO -- : Diffs computed for kelvingrove.internal.softwareheritage.org
diff origin/production/kelvingrove.internal.softwareheritage.org current/kelvingrove.internal.softwareheritage.org
*******************************************
+ File[/opt/keycloak-8.0.1/themes/swh] =>
   parameters =>
      "ensure": "directory"
      "notify": "Service[keycloak]"
      "recurse": true
      "source": "/tmp/swh-keycloak-theme/swh"
*******************************************
+ File[/tmp/swh-keycloak-theme] =>
   parameters =>
      "ensure": "absent"
      "force": true
      "purge": true
      "recurse": true
*******************************************
  Keycloak_realm[SoftwareHeritageStaging] =>
   parameters =>
     account_theme =>
      + swh
     admin_theme =>
      + swh
     login_theme =>
      + swh
*******************************************
  Keycloak_realm[SoftwareHeritage] =>
   parameters =>
     account_theme =>
      + swh
     admin_theme =>
      + swh
     login_theme =>
      + swh
*******************************************
+ Vcsrepo[/tmp/swh-keycloak-theme] =>
   parameters =>
      "ensure": "present"
      "provider": "git"
      "revision": "v0.1.1"
      "source": "https://forge.softwareheritage.org/source/swh-keycloak-theme.git"
*******************************************
*** End octocatalog-diff on kelvingrove.internal.softwareheritage.org

Closes T2354

Diff Detail

Repository
rSPSITE puppet-swh-site
Branch
keycloak-add-swh-theme
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13747
Build 21064: arc lint + arc unit

Event Timeline

ardumont added a subscriber: ardumont.

Looks fine to me.

Nice.

This revision is now accepted and ready to land.Jul 17 2020, 9:13 AM
olasd requested changes to this revision.Jul 17 2020, 1:35 PM
olasd added a subscriber: olasd.

This temporary vcsrepo and file construct will trigger a fresh vcs clone on each puppet run, which is certainly not appropriate.

You should move the vscrepo resource to a permanent location, and I think you can then just make a symlink from the keycloak theme directory to the vcsrepo location.

This revision now requires changes to proceed.Jul 17 2020, 1:35 PM
In D3534#87301, @olasd wrote:

This temporary vcsrepo and file construct will trigger a fresh vcs clone on each puppet run, which is certainly not appropriate.

You should move the vscrepo resource to a permanent location, and I think you can then just make a symlink from the keycloak theme directory to the vcsrepo location.

Ack, I will update accordingly. What will be a good permanent location for the theme: /usr/share/swh/swh-keycloak-theme, /opt/swh-keycloak-theme ?

Update: Rebase and address @olasd comments (theme is now installed permanently in /opt/swh-keycloak-theme
and a symlink to it is added in Keycloak themes folder).

Looks good, thanks a lot!

This revision is now accepted and ready to land.Jul 17 2020, 3:10 PM