Skip to content

Commit

Permalink
Merge pull request #200 from nextcloud/fix/noid/jetty-please-wait-lon…
Browse files Browse the repository at this point in the history
…ger-for-ldap

user_saml tests sometimes fail because the connection ain't ready
  • Loading branch information
blizzz authored Jan 29, 2020
2 parents e99eae3 + 5901847 commit 3a61958
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
5 changes: 3 additions & 2 deletions user_saml_shibboleth-php7.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM unicon/shibboleth-idp:3.2.0
FROM unicon/shibboleth-idp:3.2.1

# Add Shibboleth config stuff
ADD shibboleth/ /opt/shibboleth-idp/

# Install the LDAP server
RUN yum install -y https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
RUN yum install -y https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm
RUN yum install -y --enablerepo=centosplus 389-ds
RUN rm -fr /var/lock /usr/lib/systemd/system
ADD ldap/ds-setup.inf /ds-setup.inf
Expand All @@ -27,6 +27,7 @@ RUN chmod -R 777 /opt/
RUN rm -f /etc/httpd/conf.d/nss.conf
ADD apache/httpd.conf /etc/httpd/conf/httpd.conf

RUN yum -y install nc

# Add the startup file
ADD start.sh /start.sh
Expand Down
16 changes: 14 additions & 2 deletions user_saml_shibboleth-php7.2/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

export JAVA_HOME=/opt/jre-home
export PATH=$PATH:$JAVA_HOME/bin
export JETTY_BACKCHANNEL_SSL_KEYSTORE_PASSWORD=nextcloud
export JETTY_BACKCHANNEL_SSL_KEYSTORE_PASSWORD=nextcloud
export JETTY_BROWSER_SSL_KEYSTORE_PASSWORD=nextcloud

if [ -e "/opt/shibboleth-idp/ext-conf/idp-secrets.properties" ]; then
Expand All @@ -17,4 +17,16 @@ sed -i "s/^-Xmx.*$/-Xmx$JETTY_MAX_HEAP/g" /opt/shib-jetty-base/start.ini

apachectl &
/usr/sbin/ns-slapd -D /etc/dirsrv/slapd-dir &
sleep 4 && /etc/init.d/jetty run &

# wait for LDAP
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
do
nc -zw 5 localhost 389
IS_LDAP=$?
if [ ${IS_LDAP} -eq 0 ]; then
break
fi
sleep 1
done

/etc/init.d/jetty run &

0 comments on commit 3a61958

Please sign in to comment.