Set default theme Keycloak 17 - keycloak

I´m migrating to Keycloak 17 but I´m struggling with the custom themes.
On my previous version (16.1.1) I was able to set the default theme with the KEYCLOAK_DEFAULT_THEME env variable, which pointed to my custom theme.
Now i´m still able to load the themes correctly (They appear on the web console), but v17 it´s not responding to this env.
I found a way to set up the welcome theme on startup with:
kc.sh start --spi-theme-welcome-theme=custom
but this option doesn´t work for other kind of themes like login or admin.
Is there any other env or flag that i can use on startup?

You can still use it via ENV, but you have to set KC_SPI_THEME_DEFAULT. Additionally, you may have to start Keycloak with the --auto-build option.

If you start your server with kc.sh start --spi-theme-default=custom-theme, then it should use the supplied custom theme, according to: https://github.com/keycloak/keycloak/blob/bfce612641a70e106b20b136431f0e4046b5c37f/services/src/main/java/org/keycloak/theme/DefaultThemeManager.java#L57
This worked for me with Keycloak 18.

I have same problem, in the end I set custom theme to each realm manually.

Related

How to disable cache-control for SAPUI5 Web IDE only?

I have set a cache-control in the neo-app.json and it's working fine on production but I want to disable on dev mode (SAP Web IDE) without opening Chrome DevTools and enabling "disable cache".
Can someone help ?
Thanks
I guess the default run configuration itself has this in URL parameter ...&sap-ui-appCacheBuster=..%2F..%2F&sap-ui-xx-componentPreload=off&sap-ui-xx-viewCache=false#Shell-home
Not sure if I understand what your problem is, but we usually define separate launch-html pages, like one index.html for production and one index-webIDE.html for launching the app from the webIDE.
You can set up the configs like this:
Right-click the project -> Run -> Run Configurations
Then define your alternate starting html page for bootstrapping the app.

Is it possible to auto select different "gcloud" configs for different projects in multiple workspaces / folders ? Gcloud on multiple projects

From this question and this article we get that is possible to create multiple configs for the gcloud SDK.
But it seems that you have to manually switch between then, by running:
gcloud config configurations activate <CONFIG_NAME>
But is there a way for each config to be automatically selected whenever I open up a project workspace/folder on VSCode? How can I do this?
I've just tested activating a new config on a different VSCode project. That seems to update it globally. Now, all of my VSCode windows (different projects) are seeing the same activated config.
Isn't it dangerous? I mean, I could be uploading stuff to the cloud on a different project that I'm not aware of. How do people usually handle this? Do I need to run the activate command on every script before deploying something?
Unfortunately, I am not aware of such a possibility, however I have found something interesting that may help you. There is following extension:
GCP Project Switcher
The extension only allows you to change projects, however as I looked into the code it is running gcloud set config project command under the hood. You could raise a request to add the possibility to change the whole configuration to the instead of project only, as it is a very similar approach.

Invoke install4j updater with custom proxy settings

I want to do the following with application wrapped by Install4J:
have the Install4J Updater invoked from the code of the wrapped Java app
show the GUI dialogs, configured in the Install4J IDE to a user if there is an update available
pass custom proxy parameters to the Updater, if required
As far as I can understand Install4J I should be able to do it with the following:
List<String> args = new ArrayList<String>();
args.add("-DproxySet=true");
args.add("-DproxyHost="+MY_PROXY_SERVER);
args.add("-DproxyPort="+MY_PROXY_PORT););
args.add("-DproxyAuth=true");
args.add("-DproxyAuthUser="+MY_PROXY_USERNAME);)
args.add("-DproxyAuthPassword="+MY_PROXY_PASSWORD);
ApplicationLauncher.launchApplicationInProcess(
MY_UPDATER_ID.toString(),
args.toArray(new String[args.size()]),
null,
ApplicationLauncher.WindowMode.FRAME,
null);
but I keep getting the popup for entering proxy details.
I have tried changing parameters not to have prefix "-D", tried switching Updater to console mode or unattended mode, not passing the parameters but rather putting them to JVM directly with System.setProperty()... but with no success. I always ended either with proxy-popup or with message that "The update information could not be downloaded from ____ Please check your network settings."
Also: if I repeatedly invoke Updater but with different parameters the popup always shows the once I used for the first invocation.
Any help?
Thanks in advance.
Thanks to the support from EJ-tehnologies (developers of Install4J) we got the proxy thing working. In the moment of asking the question we were using v5.0.11, and they instructed us to use v5.1.2 (latest stable build in that moment). And finally we ended using the beta release v5.1.3 (not publicly available at the moment).
Details on how to have proxy working, without popup and with using dynamic parameters:
to the code above add additional argument that will prevent Install4J to detect system wide proxy settings:
args.add("-Dinstall4j.noProxyAutoDetect=true");
use method ApplicationLauncher.launchApplication() for invoking the Install4J wrapper as it will start it in the new JVM. starting like this is required due to JVM's handling of existing env variables, so if you start Install4J in the same JVM and append arguments in that JVM the Install4J might not pick the latest values (this is if you want to dynamically change proxy params)
wait for v5.1.3 to become stable and download it as it will support "not showing" of proxy popup dialog when proxy parameters are explicitly given to Install4J (this is my guess, I'm not speaking in the name of people from EJ-technologies)

Is it possible to change P4TICKET within P4Eclipse?

I installed Eclipse Juno recently and after it I installed the p4Eclipse 4.2 plugin from this repository:
http://www.perforce.com/downloads/http/p4-eclipse/install/4.2
Then I tried to create a new perforce connection.I entered the name of server and username and password. But I got an error message when clicking on next:
com.perforce.p4java.exception.ConfigException: java.io.FileNotFoundException: \p4tickets.txt (Access is denied)
Reading the P4Eclipse help I understood that because I didn't define the user environment variable P4TICKETS the P4Eclipse tried to define it by itself. On the help has mentioned that if the value is not explicitly is set it will be defined for windows as %USERPROFILE%\p4tickets.txt
and for all other platforms as
$HOME/.p4tickets
It seems that P4Eclipse has configured for other platforms and therefore it tried to find the file somewhere which it was not allowed. When I defined the User Environment variable P4TICKETS with the value %USERPROFILE%\p4tickets.txt it worked. The problem is that we have many clients and I don't want to define an environment variable for all of them. So I wonder if there is a set to configure P4Eclipse for Windows platform or define the P4TICKETS within eclipse and not with an environment variable!
Yes, I think you can go to the advanced configuration for the plugin and set P4TICKETS. In the release notes they describe this method for setting P4HOST:
470897 (Bug #042451)
Support for P4HOST variable. To set P4HOST variable,
either set the environment variable P4HOST (For example,
export P4HOST=123.456.789.0) or in the the preference page,
Preference>Team>Perforce>Advanced, set P4HOST properties,
(For example, name: P4HOST value: 123.456.789.0). Then
restart Eclipse to make it affect.
I'm not 100% sure that will work but you can give it a try.

Grails auto reload functionality in run-app on a custom environment

When running a custom environment with grails via grails -Dgrails.env=custom run-app it appears that the auto reload / hot deploy is turned off, does anyone know how to arbitrarily enable this for any given environment, not just dev, which appears to be the only env where it is actually on by default?
I resolved this by adding the following to my env(custom in this case) Config.groovy:
custom {
disable.auto.recompile=false
grails.gsp.enable.reload=true
}
You can also add the -reloading flag to your run config:
grails -reloading -Dgrails.env=custom run-app
Make sure it is the first arg!
Right-click your project -> Run as -> Run configurations
Blog post about auto refresh in a Grails custom env
The flag you want is "disable.auto.recompile", ex:
grails -Dgrails.env=custom -Ddisable.auto.recompile=false run-app
solve the problem with the name change of my folder containing the project ... this time a name that had spaces ... since quite the spaces everything started to work well