Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 4edadc5

Browse files
committed
install xdebug for remote debugging
1 parent 58c25a4 commit 4edadc5

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

development/run.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
# establish a signal handler to catch the SIGTERM from a 'docker stop'
6+
# reference: https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86
7+
term_handler() {
8+
apache2ctl stop
9+
exit 143; # 128 + 15 -- SIGTERM
10+
}
11+
trap 'kill ${!}; term_handler' SIGTERM
12+
13+
export XDEBUG_CONFIG="remote_enable=1 remote_host="$REMOTE_DEBUG_IP
14+
15+
apt-get update
16+
apt-get install php-xdebug
17+
18+
cd /data
19+
20+
# Send info about this image's O/S and PHP version to our logs.
21+
cat /etc/*release | grep PRETTY
22+
php -v | head -n 1
23+
24+
apache2ctl -k start -D FOREGROUND
25+
26+
# endless loop with a wait is needed for the trap to work
27+
while true
28+
do
29+
tail -f /dev/null & wait ${!}
30+
done

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
hub1:
55
image: silintl/ssp-base:develop
66
volumes:
7+
- ./development/run.sh:/data/run.sh
78
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
89
- ./development/hub1/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
910
- ./development/hub1/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/idp-remote.php
@@ -37,6 +38,7 @@ services:
3738
idp1: # used for basic testing
3839
image: silintl/ssp-base:develop
3940
volumes:
41+
- ./development/run.sh:/data/run.sh
4042
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
4143
- ./development/idp1/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
4244
- ./development/idp1/saml20-idp-hosted.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-hosted.php
@@ -59,6 +61,7 @@ services:
5961
idp2: # used for expiry testing
6062
image: silintl/ssp-base:develop
6163
volumes:
64+
- ./development/run.sh:/data/run.sh
6265
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
6366
- ./development/idp2/enable:/data/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/enable
6467
- ./development/idp2/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
@@ -89,6 +92,7 @@ services:
8992
idp4: # used for mfa testing (as well as some helpful links)
9093
image: silintl/ssp-base:develop
9194
volumes:
95+
- ./development/run.sh:/data/run.sh
9296
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
9397
- ./development/idp4/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
9498
- ./development/idp4/saml20-idp-hosted.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-hosted.php
@@ -193,6 +197,7 @@ services:
193197
hub2: # used for announcement testing
194198
image: silintl/ssp-base:develop
195199
volumes:
200+
- ./development/run.sh:/data/run.sh
196201
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
197202
- ./development/hub2/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
198203
- ./development/hub2/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php
@@ -223,6 +228,7 @@ services:
223228
idp3: # used for announcement testing
224229
image: silintl/ssp-base:develop
225230
volumes:
231+
- ./development/run.sh:/data/run.sh
226232
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
227233
- ./development/idp3/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
228234
- ./development/idp3/saml20-idp-hosted.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-hosted.php
@@ -250,6 +256,7 @@ services:
250256
sp1:
251257
image: silintl/ssp-base:develop
252258
volumes:
259+
- ./development/run.sh:/data/run.sh
253260
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
254261
- ./development/sp1/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
255262
- ./development/sp1/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php
@@ -271,6 +278,7 @@ services:
271278
sp2: # used for announcement testing
272279
image: silintl/ssp-base:develop
273280
volumes:
281+
- ./development/run.sh:/data/run.sh
274282
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
275283
- ./development/sp2/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
276284
- ./development/sp2/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php

local.env.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ MFA_U2F_appId=
1010
### Optional ENV vars ###
1111
LOGENTRIES_KEY=
1212
COMPOSER_AUTH=
13+
14+
REMOTE_DEBUG_IP=

0 commit comments

Comments
 (0)