From 8deb2601f26a12e15c2f7b502de4f7d6dcb3c631 Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Mon, 7 May 2018 19:37:24 +0200 Subject: [PATCH] Initial commit. --- Dockerfile | 79 +++++++++++++++++ ...Remove-references-to-project-version.patch | 62 ++++++++++++++ ...02-Remove-version-from-web-interface.patch | 84 +++++++++++++++++++ patches/0003-Remove-api-version.sh | 4 + 4 files changed, 229 insertions(+) create mode 100644 Dockerfile create mode 100644 patches/0001-Remove-references-to-project-version.patch create mode 100644 patches/0002-Remove-version-from-web-interface.patch create mode 100644 patches/0003-Remove-api-version.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e4878ec --- /dev/null +++ b/Dockerfile @@ -0,0 +1,79 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# +# Dockerfile for guacamole-client +# + +# Use args for Tomcat image label to allow image builder to choose alternatives +# such as `--build-arg TOMCAT_JRE=jre8-alpine` +# + +ARG TOMCAT_VERSION=8.0.20 +ARG TOMCAT_JRE=jre8 + +# Use official maven image for the build +FROM maven:3-jdk-8 AS builder + +ARG GUACAMOLE_GIT_URL=https://github.com/apache/guacamole-client.git +ARG GUACAMOLE_VERSION=0.9.14 + +# Build environment variables +ENV \ + BUILD_DIR=/tmp/guacamole-docker-BUILD + +# Copy source to container for sake of build +RUN \ + set -x \ + && git clone --recursive -b "${GUACAMOLE_VERSION}" "${GUACAMOLE_GIT_URL}" "${BUILD_DIR}" + +# Apply patches +COPY patches/ /patches/ +RUN cd "${BUILD_DIR}" \ + && set -x \ + && for patch in /patches/*.patch; do \ + echo Applying patch: $patch \ + && git apply "$patch" \ + ; done \ + && for script in /patches/*.sh; do \ + echo Running patch script: $script; \ + chmod -v +x "$script"; \ + "$script"; \ + done + +# Add configuration scripts +RUN mkdir -p /opt/guacamole/ +RUN cp -rv "${BUILD_DIR}/guacamole-docker/bin/" /opt/guacamole/bin/ + +# Run the build itself +RUN /opt/guacamole/bin/build-guacamole.sh "$BUILD_DIR" /opt/guacamole + +# For the runtime image, we start with the official Tomcat distribution +FROM tomcat:${TOMCAT_VERSION}-${TOMCAT_JRE} + +# This is where the build artifacts go in the runtime image +WORKDIR /opt/guacamole + +# Copy artifacts from builder image into this image +COPY --from=builder /opt/guacamole/ . + +# Start Guacamole under Tomcat, listening on 0.0.0.0:8080 +EXPOSE 8080 +CMD ["/opt/guacamole/bin/start.sh" ] + diff --git a/patches/0001-Remove-references-to-project-version.patch b/patches/0001-Remove-references-to-project-version.patch new file mode 100644 index 0000000..eac2d64 --- /dev/null +++ b/patches/0001-Remove-references-to-project-version.patch @@ -0,0 +1,62 @@ +From 77a8ef246f5dccdcf0c948f5e28f0afb9da01fb7 Mon Sep 17 00:00:00 2001 +From: Carl Kittelberger +Date: Mon, 7 May 2018 19:04:16 +0200 +Subject: [PATCH 1/2] Remove references to project version. + +--- + guacamole/src/main/webapp/index.html | 4 ++-- + guacamole/src/main/webapp/translations/en.json | 2 +- + guacamole/src/main/webapp/translations/no.json | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/guacamole/src/main/webapp/index.html b/guacamole/src/main/webapp/index.html +index 7d747cf..1c5e4de 100644 +--- a/guacamole/src/main/webapp/index.html ++++ b/guacamole/src/main/webapp/index.html +@@ -26,7 +26,7 @@ + + + +- ++ + + + +@@ -79,7 +79,7 @@ + + + +- ++ + + + +diff --git a/guacamole/src/main/webapp/translations/en.json b/guacamole/src/main/webapp/translations/en.json +index a64f64c..056fdd3 100644 +--- a/guacamole/src/main/webapp/translations/en.json ++++ b/guacamole/src/main/webapp/translations/en.json +@@ -5,7 +5,7 @@ + "APP" : { + + "NAME" : "Apache Guacamole", +- "VERSION" : "${project.version}", ++ "VERSION" : "", + + "ACTION_ACKNOWLEDGE" : "OK", + "ACTION_CANCEL" : "Cancel", +diff --git a/guacamole/src/main/webapp/translations/no.json b/guacamole/src/main/webapp/translations/no.json +index 30ea871..1d43d52 100644 +--- a/guacamole/src/main/webapp/translations/no.json ++++ b/guacamole/src/main/webapp/translations/no.json +@@ -38,7 +38,7 @@ + + "INFO_ACTIVE_USER_COUNT" : "Blir brukt av {USERS} {USERS, plural, one{user} other{users}}.", + +- "NAME" : "Guacamole ${project.version}", ++ "NAME" : "Guacamole", + + "TEXT_HISTORY_DURATION" : "{VALUE} {UNIT, select, second{{VALUE, plural, one{second} other{seconds}}} minute{{VALUE, plural, one{minute} other{minutes}}} hour{{VALUE, plural, one{hour} other{hours}}} day{{VALUE, plural, one{day} other{days}}} other{}}" + +-- +2.10.0.windows.1 + diff --git a/patches/0002-Remove-version-from-web-interface.patch b/patches/0002-Remove-version-from-web-interface.patch new file mode 100644 index 0000000..1d16797 --- /dev/null +++ b/patches/0002-Remove-version-from-web-interface.patch @@ -0,0 +1,84 @@ +From 4463c8ce139e30595e37e27e8a7fade14ec1e8d7 Mon Sep 17 00:00:00 2001 +From: Carl Kittelberger +Date: Mon, 7 May 2018 19:04:37 +0200 +Subject: [PATCH 2/2] Remove version from web interface. + +--- + .../src/main/webapp/app/login/styles/dialog.css | 36 +--------------------- + .../src/main/webapp/app/login/templates/login.html | 6 +--- + 2 files changed, 2 insertions(+), 40 deletions(-) + +diff --git a/guacamole/src/main/webapp/app/login/styles/dialog.css b/guacamole/src/main/webapp/app/login/styles/dialog.css +index c9c6a4a..a46c4f0 100644 +--- a/guacamole/src/main/webapp/app/login/styles/dialog.css ++++ b/guacamole/src/main/webapp/app/login/styles/dialog.css +@@ -70,39 +70,6 @@ + text-shadow: 1px 1px white; + } + +-.login-ui .login-dialog .version { +- padding: 0.5em 0; +-} +- +-.login-ui .login-dialog .version .app-name { +- font-weight: bold; +- text-transform: uppercase; +- text-align: center; +- font-size: 1.25em; +-} +- +-.login-ui .login-dialog .version .version-number { +- +- position: absolute; +- right: 0; +- bottom: 0; +- +- padding: 0.25em 0.75em; +- margin: 0.25em; +- +- -moz-border-radius: 0.5em; +- -webkit-border-radius: 0.5em; +- -khtml-border-radius: 0.5em; +- border-radius: 0.5em; +- +- color: white; +- background: green; +- font-size: 0.5em; +- font-style: italic; +- opacity: 0.5; +- +-} +- + .login-ui .login-dialog .logo { + display: block; + margin: 0.5em auto; +@@ -122,7 +89,6 @@ + max-width: 6in; + } + +-.login-ui.continuation .login-dialog .logo, +-.login-ui.continuation .login-dialog .version { ++.login-ui.continuation .login-dialog .logo { + display: none; + } +diff --git a/guacamole/src/main/webapp/app/login/templates/login.html b/guacamole/src/main/webapp/app/login/templates/login.html +index 26a3f18..887e1fd 100644 +--- a/guacamole/src/main/webapp/app/login/templates/login.html ++++ b/guacamole/src/main/webapp/app/login/templates/login.html +@@ -10,12 +10,8 @@ + +