fix: strip debug output from API responses and JS console logs #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI - Redis lock | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'webdocs/**' | |
| - 'res/**' | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| NAME: ctfer | |
| PASSWORD: ctfer | |
| services: | |
| chall-manager: | |
| image: ctferio/chall-manager:v0.6.0@sha256:4d0a0379a3c12b2203500a7852856ef7202c7c54d58207fb88d4b8919d5f6add | |
| ports: | |
| - 8080:8080 | |
| env: | |
| OCI_INSECURE: true | |
| redis-svc: | |
| image: redis:7.0.10@sha256:92b8b307ee28ed74da17578064c73307ad41e43f422f0b7e4e91498b406c59e3 | |
| ports: | |
| - 6379:6379 | |
| registry: | |
| image: registry:2 | |
| ports: | |
| - 5000:5000 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Get GitHub Actions network name | |
| id: get_network | |
| run: | | |
| # Find the network ID (GitHub Actions creates one automatically) | |
| NETWORK_NAME=$(docker network ls --filter name=github_network_* --format "{{.Name}}") | |
| echo $NETWORK_NAME | |
| echo "network_name=$NETWORK_NAME" >> $GITHUB_OUTPUT | |
| - name: Start CTFd after checkout | |
| run: | | |
| docker run -d -p 8000:8000 \ | |
| --name ctfd \ | |
| --network ${{ steps.get_network.outputs.network_name }} \ | |
| -e LOG_LEVEL=DEBUG \ | |
| -e PLUGIN_SETTINGS_CM_API_URL=http://chall-manager:8080 \ | |
| -e PLUGIN_SETTINGS_CM_MANA_TOTAL=10 \ | |
| -e PLUGIN_SETTINGS_CM_EXPERIMENTAL_RWLOCK=true \ | |
| -e REDIS_URL=redis://redis-svc:6379 \ | |
| -e WORKERS=2 \ | |
| -e SECRET_KEY=ctfer \ | |
| -v ${{ github.workspace }}:/opt/CTFd/CTFd/plugins/ctfd_chall_manager \ | |
| ctfd/ctfd:3.8.1@sha256:0de331947204628900fb68e01478dfd6f209aadf4eac269a2be08ee92af8ef0d | |
| - name: Setup basic testing env | |
| uses: ./.github/workflows/setup-testing | |
| with: | |
| ctfd_mode: teams | |
| ctfd_user: ${{ env.NAME }} | |
| ctfd_pass: ${{ env.PASSWORD }} | |
| - name: Setup Python | |
| uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | |
| - name: Run Functional Tests in mode Teams | |
| run: |- | |
| python -m unittest test/test_api_challenges.py | |
| python -m unittest test/test_api_admin_instance.py | |
| python -m unittest test/test_api_instance.py | |
| python -m unittest test/test_api_mana.py | |
| env: | |
| CTFD_URL: http://localhost:8000 | |
| - name: Update CTFd into mode users | |
| uses: ctfer-io/ctfd-setup@c3108d5d78162e243f7aad777053c5b6bf33a65e # v1.7.3 | |
| with: | |
| url: 'http://ctfd:8000' | |
| appearance_name: CTFer.io | |
| appearance_description: CTFer.io plugin tests | |
| mode: users | |
| admin_name: ${{ env.NAME }} | |
| admin_email: ctfer-io@protonmail.com | |
| admin_password: ${{ env.PASSWORD }} | |
| accounts_incorrect_submissions_per_minute: 9999 | |
| - name: Run Functional Tests in mode Users | |
| run: |- | |
| python -m unittest test/test_api_challenges.py | |
| python -m unittest test/test_api_admin_instance.py | |
| python -m unittest test/test_api_instance.py | |
| python -m unittest test/test_api_mana.py | |
| env: | |
| CTFD_URL: http://localhost:8000 | |
| - name: Export Logs and clean CTFd | |
| if: always() | |
| run : | | |
| docker logs ctfd | |
| docker stop ctfd | |
| docker rm ctfd |