<div dir="ltr">We&#39;ve had chats with folks that know about the patching tools now and it turns out that by simply moving the themes from standalone/configuration/themes they can be patched. If someone has changed the built-in themes they will get a warning and be asked if they want to cancel the patching or overwrite the file.<div><br></div><div>So problem solved by simply moving themes from standalone/configuration/themes to standalone/themes.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 February 2016 at 16:15, Marko Strukelj <span dir="ltr">&lt;<a href="mailto:mstrukel@redhat.com" target="_blank">mstrukel@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m thinking of a workflow I would find useful, and I think it would<br>
be something like this:<br>
<br>
There is a directory with extracted theme files which I don&#39;t touch -<br>
$KEYCLOAK_HOME/standalone/configuration/themes/expanded. Keycloak<br>
automatically extracts files into it upon startup. I as a developer do<br>
a &#39;git init &amp;&amp; git add * &amp;&amp; git commit -a -m &quot;Keycloak 1.9.0.CR1&quot;&#39; in<br>
it to turn it into a git repo.<br>
<br>
My theme development repo is somewhere else on the disk, outside the<br>
KEYCLOAK_HOME, let&#39;s say in ~/kc-theme.<br>
<br>
In there a have a .git repo with:<br>
git init<br>
git remote add kcinstall<br>
file://$KEYCLOAK_HOME/standalone/configuration/themes/expanded<br>
<br>
Now I can do:<br>
git fetch kcinstall<br>
git reset --hard remotes/kcinstall/master<br>
<br>
I have my inital custom theme. I make changes and work on it.<br>
<br>
When patching is performed on keycloak install it would result in<br>
either complete rewrite of standalone/configuration/themes/expanded or<br>
in only some files changing. If it is the former then I can simply<br>
reinit git repo there as the first time, it it&#39;s the latter I just do<br>
&#39;git add * &amp;&amp; git commit -a -m &quot;Keycloak 1.9.0.Final&quot;&#39;. Then in my<br>
working dir I say:<br>
<br>
git fetch kcinstall<br>
git rebase remotes/kcinstall/master<br>
<br>
Now I fix any merge conflicts ...<br>
<br>
The effective theme dir for my Keycloak instance can be under<br>
standalone/configuration/themes/public, and in that directory I can<br>
expand my theme copy. Or for development I can configure in<br>
keycloak-server.json to use my working directory ~/ks-theme.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Mon, Feb 15, 2016 at 3:40 PM, Stan Silvert &lt;<a href="mailto:ssilvert@redhat.com">ssilvert@redhat.com</a>&gt; wrote:<br>
&gt; On 2/15/2016 9:03 AM, Bill Burke wrote:<br>
&gt;<br>
&gt; Users will be editing and playing with our existing themes to figure how to<br>
&gt; extend things.  I&#39;ll go as far to say that *EVERY* user will do this.  It<br>
&gt; needs to be really easy to do and is just as important as playing nicely<br>
&gt; with the patch mechanism.<br>
&gt;<br>
&gt; I agree on making it really easy.<br>
&gt;<br>
&gt; IMO, the real solution is to make themes fully manageable from the admin<br>
&gt; console.  You should be able to upload and download themes.  Then, you could<br>
&gt; download the default themes and copy them but not allow overwrite.<br>
&gt;<br>
&gt; This also solves the openshift problem as you would be able to upload themes<br>
&gt; to an openshift-based Keycloak instance.  And, we wouldn&#39;t have to do<br>
&gt; anything special to account for the patch tool as the default themes would<br>
&gt; just be read from the module and never modified unless patched.<br>
&gt;<br>
&gt; Obviously, that&#39;s more of a long-term solution though.  It would take a fair<br>
&gt; amount of work to implement.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On 2/15/2016 4:08 AM, Stian Thorgersen wrote:<br>
&gt;<br>
&gt; Keeping it as is isn&#39;t an option IMO. There&#39;s a pretty big chance that we<br>
&gt; will need to patch themes. There&#39;s several issues with that as it stands:<br>
&gt;<br>
&gt; * Users need to deal with two separate patching mechanisms and we also need<br>
&gt; to create tools, patches, documentation separately<br>
&gt; * What if users change the built-in themes, rather than extending. We tell<br>
&gt; users not to, but if they can they will. If a built-in theme has been<br>
&gt; changed patches probably won&#39;t work<br>
&gt; * EAP supports roll-back of patches, applies patches atomically. It&#39;s a<br>
&gt; proper tool that helps users to do it right<br>
&gt; * EAP supports domain mode<br>
&gt;<br>
&gt; What Stan is proposing might be worth considering. It doesn&#39;t solve the case<br>
&gt; that users can modify the files though.<br>
&gt;<br>
&gt; I would actual prefer that built-in themes are always loaded from the<br>
&gt; module, but we have the templates available in exames/themes/templates.<br>
&gt;<br>
&gt; Another relevant thing is what do we do when users have modified templates.<br>
&gt; How can we help them apply the required changes to the custom template?<br>
&gt;<br>
&gt; On 12 Feb 2016 19:32, &quot;Stan Silvert&quot; &lt;<a href="mailto:ssilvert@redhat.com">ssilvert@redhat.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; BTW, how do you deal with theme changes on OpenShift?  Looks like a year<br>
&gt;&gt; ago the answer was, &quot;fork the cartridge&quot;.  Is that still the only solution?<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://lists.jboss.org/pipermail/keycloak-user/2015-February/001675.html" rel="noreferrer" target="_blank">http://lists.jboss.org/pipermail/keycloak-user/2015-February/001675.html</a><br>
&gt;&gt;<br>
&gt;&gt; On 2/12/2016 12:46 PM, Bill Burke wrote:<br>
&gt;&gt;<br>
&gt;&gt; Keep it the way it is, IMO.  Write directions on how to handle a theme<br>
&gt;&gt; patch.<br>
&gt;&gt;<br>
&gt;&gt; On 2/12/2016 11:01 AM, Stan Silvert wrote:<br>
&gt;&gt;<br>
&gt;&gt; Another way to deal with this might be to unjar the files ourselves at<br>
&gt;&gt; startup.  The files could live in the same place they live today.<br>
&gt;&gt;<br>
&gt;&gt; We would just have keep track of versioning.  If a newer version of the<br>
&gt;&gt; theme is installed we overwrite the old version in<br>
&gt;&gt; standlone/configuration/themes.  Of course, if the theme has been modified<br>
&gt;&gt; by the user we wouldn&#39;t overwrite, but instead just unjar to another<br>
&gt;&gt; location.<br>
&gt;&gt;<br>
&gt;&gt; On 2/12/2016 9:44 AM, Stian Thorgersen wrote:<br>
&gt;&gt;<br>
&gt;&gt; Currently we include built-in themes in the themes jar as well as<br>
&gt;&gt; extracted to standalone/configuration/themes. We have to remove the<br>
&gt;&gt; extracted files.<br>
&gt;&gt;<br>
&gt;&gt; This is due to patching. The patching tools only supports patching<br>
&gt;&gt; modules, not files. If we need to patch the theme templates (quite likely we<br>
&gt;&gt; will) we can then only patch the jar. As the extracted themes override the<br>
&gt;&gt; jar it won&#39;t work unless we remove them.<br>
&gt;&gt;<br>
&gt;&gt; The main problem with removing the extracted files is that they are useful<br>
&gt;&gt; for someone that needs to modify the templates. I think the best would just<br>
&gt;&gt; be to give people instructions on how to extract these from the jar. It&#39;s<br>
&gt;&gt; just a zip after all.<br>
&gt;&gt;<br>
&gt;&gt; Thoughts??<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; keycloak-dev mailing list<br>
&gt;&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; keycloak-dev mailing list<br>
&gt;&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Bill Burke<br>
&gt;&gt; JBoss, a division of Red Hat<br>
&gt;&gt; <a href="http://bill.burkecentral.com" rel="noreferrer" target="_blank">http://bill.burkecentral.com</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; keycloak-dev mailing list<br>
&gt;&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; keycloak-dev mailing list<br>
&gt;&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; keycloak-dev mailing list<br>
&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Bill Burke<br>
&gt; JBoss, a division of Red Hat<br>
&gt; <a href="http://bill.burkecentral.com" rel="noreferrer" target="_blank">http://bill.burkecentral.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; keycloak-dev mailing list<br>
&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; keycloak-dev mailing list<br>
&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
</div></div></blockquote></div><br></div>