Skip to content

Commit

Permalink
ci fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Oct 24, 2023
1 parent 62cd0db commit 884d3de
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/smb-kerberos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:

if: ${{ github.repository_owner != 'nextcloud-gmbh' }}

name: smb-kerberos-sso

steps:
- name: Checkout server
uses: actions/checkout@v3
Expand All @@ -30,7 +28,7 @@ jobs:
with:
repository: nextcloud/user_saml
path: apps/user_saml
ref: stable27
ref: stable-5.2
- name: Pull images
run: |
docker pull ghcr.io/icewind1991/samba-krb-test-dc
Expand Down Expand Up @@ -62,8 +60,6 @@ jobs:

if: ${{ github.repository_owner != 'nextcloud-gmbh' }}

name: smb-kerberos-sso

steps:
- name: Checkout server
uses: actions/checkout@v3
Expand All @@ -74,7 +70,7 @@ jobs:
with:
repository: nextcloud/user_saml
path: apps/user_saml
ref: event-dispatcher
ref: stable-5.2
- name: Pull images
run: |
docker pull ghcr.io/icewind1991/samba-krb-test-dc
Expand All @@ -86,6 +82,7 @@ jobs:
- name: Setup AD-DC
run: |
DC_IP=$(apps/files_external/tests/sso-setup/start-dc.sh)
sleep 1
apps/files_external/tests/sso-setup/start-apache.sh $DC_IP $PWD -v $PWD/apps/files_external/tests/sso-setup/apache-session.conf:/etc/apache2/sites-enabled/000-default.conf
echo "DC_IP=$DC_IP" >> $GITHUB_ENV
- name: Set up Nextcloud
Expand All @@ -106,8 +103,6 @@ jobs:

if: ${{ github.repository_owner != 'nextcloud-gmbh' }}

name: smb-kerberos-sso

steps:
- name: Checkout server
uses: actions/checkout@v3
Expand All @@ -118,7 +113,7 @@ jobs:
with:
repository: nextcloud/user_saml
path: apps/user_saml
ref: event-dispatcher
ref: stable-5.2
- name: Pull images
run: |
docker pull ghcr.io/icewind1991/samba-krb-test-dc
Expand All @@ -130,6 +125,7 @@ jobs:
- name: Setup AD-DC
run: |
DC_IP=$(apps/files_external/tests/sso-setup/start-dc.sh)
sleep 1
apps/files_external/tests/sso-setup/start-apache.sh $DC_IP $PWD -v $PWD/apps/files_external/tests/sso-setup/apache-session.conf:/etc/apache2/sites-enabled/000-default.conf
echo "DC_IP=$DC_IP" >> $GITHUB_ENV
- name: Set up Nextcloud
Expand Down
12 changes: 12 additions & 0 deletions apps/files_external/tests/sso-setup/apache-session.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
require valid-user
</Location>

<Location /index.php>
AuthType Kerberos
AuthName "Kerberos authenticated intranet"
KrbAuthRealms DOMAIN.TEST
KrbServiceName HTTP/httpd.domain.test
Krb5Keytab /shared/httpd.keytab
KrbMethodNegotiate On
KrbMethodK5Passwd On
KrbSaveCredentials On
require valid-user
</Location>

ErrorLog /shared/apache-error.log
CustomLog /shared/apache-access.log combined
</VirtualHost>
8 changes: 4 additions & 4 deletions apps/files_external/tests/sso-setup/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e

SCRIPT_DIR="${0%/*}"

DC_IP=$(apps/files_external/tests/sso-setup/start-dc.sh)
apps/files_external/tests/sso-setup/start-apache.sh "$DC_IP" "$PWD" -v "$PWD/$SCRIPT_DIR"/apache-session.conf:/etc/apache2/sites-enabled/000-default.conf
apps/files_external/tests/sso-setup/setup-sso-nc.sh smb::kerberos_sso_session
DC_IP=$("$SCRIPT_DIR"/start-dc.sh)
"$SCRIPT_DIR"/start-apache.sh "$DC_IP" "$PWD" -v "$PWD/$SCRIPT_DIR"/apache-session.conf:/etc/apache2/sites-enabled/000-default.conf
"$SCRIPT_DIR"/setup-sso-nc.sh smb::kerberos_sso_session

apps/files_external/tests/sso-setup/test-sso-smb-session.sh "$DC_IP"
"$SCRIPT_DIR"/test-sso-smb-session.sh "$DC_IP"
2 changes: 2 additions & 0 deletions apps/files_external/tests/sso-setup/start-dc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ docker run -dit --name dc -v /tmp/shared:/shared --hostname krb.domain.test --ca

waitContainer dc

sleep 5

docker inspect dc --format '{{.NetworkSettings.IPAddress}}'
2 changes: 2 additions & 0 deletions apps/files_external/tests/sso-setup/test-sso-smb-session.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ else
exit 1
fi

"$SCRIPT_DIR/client-cmd.sh" "$DC_IP" curl -s -b /shared/cookie -c /shared/cookie --negotiate -u [email protected]: --delegation always http://httpd.domain.test/index.php

echo -n "Getting test with session file: "
CONTENT=$("$SCRIPT_DIR/client-cmd.sh" "$DC_IP" curl -s -b /shared/cookie 'http://httpd.domain.test/remote.php/webdav/smb/test.txt?XDEBUG_SESSION_START=1')
CONTENT=$(echo "$CONTENT" | head -n 1 | tr -d '[:space:]')
Expand Down

0 comments on commit 884d3de

Please sign in to comment.