aboutsummaryrefslogtreecommitdiffstats
path: root/gerrit
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2018-04-24 21:32:26 +0800
committerHarald Welte <laforge@gnumonks.org>2018-04-24 16:19:49 +0000
commitb210f3aa6e3cc3d10aaff77b85b9c0eac7dff01e (patch)
tree01d92ad22dcc6f2ec19e34867204d5b07662754a /gerrit
parent2f61bf81e908ccaa989a1e773fb193935b0eee43 (diff)
Add Dockerfile for gerrit and monkey patch
The openid support doesn't allow to add custom providers but we like the convenience of a single click. Take the official docker image and patch the HTML template. It seems to have changed little over the time, and it might continue like that... I have filed https://bugs.chromium.org/p/gerrit/issues/detail?id=8828 so that we can drop this hack in the future... Change-Id: I713948fbb93355c2e33e3b92969e2389cb88c938
Diffstat (limited to 'gerrit')
-rw-r--r--gerrit/Dockerfile18
-rw-r--r--gerrit/add_osmocom.diff11
2 files changed, 29 insertions, 0 deletions
diff --git a/gerrit/Dockerfile b/gerrit/Dockerfile
new file mode 100644
index 0000000..e67c760
--- /dev/null
+++ b/gerrit/Dockerfile
@@ -0,0 +1,18 @@
+FROM gerritcodereview/gerrit
+
+USER root
+RUN yum -y install zip unzip patch
+
+RUN \
+ unzip /var/gerrit/bin/gerrit.war WEB-INF/lib/gerrit-openid-libopenid.jar && \
+ unzip WEB-INF/lib/gerrit-openid-libopenid.jar com/google/gerrit/httpd/auth/openid/LoginForm.html
+
+COPY add_osmocom.diff /tmp
+RUN patch -p0 < /tmp/add_osmocom.diff
+
+RUN \
+ zip -u WEB-INF/lib/gerrit-openid-libopenid.jar com/google/gerrit/httpd/auth/openid/LoginForm.html && \
+ zip -u /var/gerrit/bin/gerrit.war WEB-INF/lib/gerrit-openid-libopenid.jar
+
+USER gerrit
+
diff --git a/gerrit/add_osmocom.diff b/gerrit/add_osmocom.diff
new file mode 100644
index 0000000..f078a96
--- /dev/null
+++ b/gerrit/add_osmocom.diff
@@ -0,0 +1,11 @@
+--- com/google/gerrit/httpd/auth/openid/LoginForm.html.orig 2018-04-24 21:07:24.000000000 +0800
++++ com/google/gerrit/httpd/auth/openid/LoginForm.html 2018-04-24 21:08:26.000000000 +0800
+@@ -70,6 +70,8 @@
+ <div id="providers">
+ </div>
+
++ <div id="provider_osmocom"><a href="?id=https://osmocom.org/openid" id="id_osmocom">Sign in with Osmocom</a></div>
++
+ <div id="provider_launchpad">
+ <img height="16" width="16" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAHKSURBVCiRjZI9SFtRGIafc5tiVFCkhUxKBAcLYoPWwE0GEUPBwc0f1MHFoWLBiKABobWtBh2kacFYwUUQRXBoB3EJCVUvyBVrIB1UskTawUGFQOoP5h6H3ki8deg7vuc853zvxyuklORLDUc9QH9nZeAL0AGM+1v0cywSOVANR8uBaaALOOysDLwCYsAp8AaY97fo2RyoqOFooRqOvgUOTMiqJ8AsEA9tuH13IFkcQD1QZHpbQE+bPXEADAK5MSsA1/p+1SMAoTbF9oAh2WYUAcWbz5tThiQE1EsI7VxVzMWvHe2lGWP1RaqgWyKe1g5vjyhAHfBdrCmuWG1zqSHRAS9gFxBQC451/+PdhbqUPSYR00JSAmDLy+IE7ICwZHRkbBQKqMo3lQeW8V/KB5PAMSAtd06Kb7iQf8/vgXuA9/2V9nN7dCKjCNyABlxKmPqx7HQvDjX0HX29bBLIUSlIA4gNT9Bpw/gMtJqPaYD/2evJX5FgTQcwDpQBaeCD8+XZx8aZZFaxYZyYv/4xQS+wFAnWVAOfTAgzRrxxJpkFUHza2IVPG3sHVAMrD+zhFBgAXL0JPZIzhbXkEe+kB+j/nf52V/LexL8lvwVTCpkwGXEEfAAAAABJRU5ErkJggg=="/>
+ <a href="?id=https://login.launchpad.net/%2Bopenid" id="id_launchpad">Sign in with a Launchpad ID</a>