Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reverse proxies that terminate HTTPS #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bamboo-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CMD ["/sbin/my_init"]
# Environment
ENV BAMBOO_VERSION 5.7.2
ENV BAMBOO_HOME /home/bamboo
ENV BAMBOO_SCHEME http

# Expose web and agent ports
EXPOSE 8085
Expand All @@ -22,6 +23,9 @@ ADD bamboo-server.sh /etc/service/bamboo-server/run
# Make sure we get latet packages
RUN apt-get update && apt-get upgrade -y # 28.01.2015

# Install xmlstarlet
RUN apt-get install -yq xmlstarlet

# Install Java OpenJDK 7 and VCS tools
RUN apt-get install -yq python-software-properties && add-apt-repository ppa:webupd8team/java -y && apt-get update
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
Expand Down
17 changes: 17 additions & 0 deletions bamboo-server/bamboo-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e # Exit on errors
echo "-> Starting Bamboo Agent ..."
echo " - BAMBOO_VERSION: $BAMBOO_VERSION"
echo " - BAMBOO_HOME: $BAMBOO_HOME"
echo " - BAMBOO_SCHEME: $BAMBOO_SCHEME"

mkdir -p $BAMBOO_HOME

Expand All @@ -19,6 +20,22 @@ else
echo "-> Extracting to $BAMBOO_DIR ..."
tar xzf /tmp/atlassian-bamboo.tar.gz -C /opt
rm -f /tmp/atlassian-bamboo.tar.gz
echo "-> Setting the HTTP/S settings in the server.xml"
SERVER_XML=$BAMBOO_DIR/conf/server.xml
xmlstarlet ed --pf --delete "//Connector[@port=8085]/@secure" $SERVER_XML > $SERVER_XML.tmp
xmlstarlet ed --pf --delete "//Connector[@port=8085]/@scheme" $SERVER_XML.tmp > $SERVER_XML
xmlstarlet ed --pf --delete "//Connector[@port=8085]/@proxyPort" $SERVER_XML > $SERVER_XML.tmp
xmlstarlet ed --pf --delete "//Connector[@port=8085]/@redirectPort" $SERVER_XML.tmp > $SERVER_XML
if [ $BAMBOO_SCHEME == "https" ]; then
xmlstarlet ed --pf --insert "//Connector[@port=8085]" -t attr -n secure -v true $SERVER_XML > $SERVER_XML.tmp
xmlstarlet ed --pf --insert "//Connector[@port=8085]" -t attr -n scheme -v https $SERVER_XML.tmp > $SERVER_XML
xmlstarlet ed --pf --insert "//Connector[@port=8085]" -t attr -n proxyPort -v 443 $SERVER_XML > $SERVER_XML.tmp
xmlstarlet ed --pf --insert "//Connector[@port=8085]" -t attr -n redirectPort -v 443 $SERVER_XML.tmp > $SERVER_XML
else
xmlstarlet ed --pf --insert "//Connector[@port=8085]" -t attr -n secure -v false $SERVER_XML > $SERVER_XML.tmp
xmlstarlet ed --pf --insert "//Connector[@port=8085]" -t attr -n scheme -v http $SERVER_XML.tmp > $SERVER_XML
fi
rm $SERVER_XML.tmp
echo "-> Installation completed"
fi

Expand Down