1
0

smb-kerberos.yml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: Samba Kerberos SSO
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - stable*
  7. paths:
  8. - "apps/files_external/**"
  9. - ".github/workflows/smb-kerberos.yml"
  10. pull_request:
  11. paths:
  12. - "apps/files_external/**"
  13. - ".github/workflows/smb-kerberos.yml"
  14. jobs:
  15. smb-kerberos-tests:
  16. runs-on: ubuntu-latest
  17. if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. php-versions: ["7.4", "8.0"]
  22. name: smb-kerberos-sso
  23. steps:
  24. - name: Checkout server
  25. uses: actions/checkout@v2
  26. with:
  27. submodules: true
  28. - name: Pull images
  29. run: |
  30. docker pull icewind1991/samba-krb-test-dc
  31. docker pull icewind1991/samba-krb-test-apache
  32. docker pull icewind1991/samba-krb-test-client
  33. - name: Setup AD-DC
  34. run: |
  35. cp apps/files_external/tests/*.sh .
  36. mkdir data
  37. sudo chown -R 33 data apps config
  38. DC_IP=$(./start-dc.sh)
  39. ./start-apache.sh $DC_IP $PWD
  40. echo "DC_IP=$DC_IP" >> $GITHUB_ENV
  41. - name: Set up Nextcloud
  42. run: |
  43. docker exec --user 33 apache ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
  44. docker exec --user 33 apache ./occ config:system:set trusted_domains 1 --value 'httpd.domain.test'
  45. # setup user_saml
  46. docker exec --user 33 apache ./occ app:enable user_saml --force
  47. docker exec --user 33 apache ./occ config:app:set user_saml type --value 'environment-variable'
  48. docker exec --user 33 apache ./occ saml:config:create
  49. docker exec --user 33 apache ./occ saml:config:set 1 --general-uid_mapping=REMOTE_USER
  50. # setup external storage
  51. docker exec --user 33 apache ./occ app:enable files_external --force
  52. docker exec --user 33 apache ./occ files_external:create smb smb smb::kerberosapache
  53. docker exec --user 33 apache ./occ files_external:config 1 host krb.domain.test
  54. docker exec --user 33 apache ./occ files_external:config 1 share netlogon
  55. docker exec --user 33 apache ./occ files_external:list
  56. - name: Test SSO
  57. run: |
  58. mkdir /tmp/shared/cookies
  59. chmod 0777 /tmp/shared/cookies
  60. echo "SAML login"
  61. ./client-cmd.sh ${{ env.DC_IP }} curl -c /shared/cookies/jar -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/index.php/apps/user_saml/saml/login
  62. echo "Check we are logged in"
  63. CONTENT=$(./client-cmd.sh ${{ env.DC_IP }} curl -b /shared/cookies/jar -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/remote.php/webdav/smb/test.txt)
  64. CONTENT=$(echo $CONTENT | head -n 1 | tr -d '[:space:]')
  65. [[ $CONTENT == "testfile" ]]
  66. smb-kerberos-summary:
  67. runs-on: ubuntu-latest
  68. needs: smb-kerberos-tests
  69. if: always()
  70. steps:
  71. - name: Summary status
  72. run: if ${{ needs.smb-kerberos-tests.result != 'success' }}; then exit 1; fi