├── .github ├── auto-merge.yml ├── dependabot.yml └── workflows │ ├── auto-merge-on-demand.yml │ ├── auto-merge.yml │ ├── build-and-push.yml │ ├── container-pytest.yml │ ├── container-tests.yml │ ├── openshift-pytests.yml │ ├── openshift-tests.yml │ └── pr-metadata.yml ├── .gitignore ├── .gitmodules ├── 5.26-mod_fcgid ├── Dockerfile.rhel8 ├── README.md ├── content_sets.yml ├── root │ └── opt │ │ └── app-root │ │ ├── Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch │ │ ├── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ │ └── 50-mpm.conf.template │ │ └── httpdconf.sed │ │ └── psgiwrapper ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── fcgi │ ├── imagestreams │ ├── psgi │ ├── psgi-hot_deploy │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── run-pytest │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_container_basics.py │ ├── test_container_s2i.py │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── 5.26 ├── .exclude-fedora ├── Dockerfile.fedora ├── README.md ├── content_sets.yml ├── root │ └── opt │ │ └── app-root │ │ └── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ └── 50-mpm.conf.template │ │ ├── httpdconf-fed.sed │ │ └── httpdconf.sed ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── imagestreams │ ├── psgi │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── 5.30-mod_fcgid ├── .exclude-rhel8 ├── Dockerfile.rhel8 ├── README.md ├── root │ └── opt │ │ └── app-root │ │ ├── Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch │ │ ├── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ │ └── 50-mpm.conf.template │ │ └── httpdconf.sed │ │ └── psgiwrapper ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── fcgi │ ├── imagestreams │ ├── psgi │ ├── psgi-hot_deploy │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── run-pytest │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_container_basics.py │ ├── test_container_s2i.py │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── 5.30 ├── .exclude-fedora ├── Dockerfile.fedora ├── README.md ├── content_sets.yml ├── root │ └── opt │ │ └── app-root │ │ └── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ └── 50-mpm.conf.template │ │ ├── httpdconf-fed.sed │ │ └── httpdconf.sed ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── imagestreams │ ├── psgi │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── run-pytest │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_container_basics.py │ ├── test_container_s2i.py │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── 5.32 ├── .exclude-fedora ├── .exclude-rhel8 ├── Dockerfile.c9s ├── Dockerfile.fedora ├── Dockerfile.rhel8 ├── Dockerfile.rhel9 ├── README.md ├── root │ └── opt │ │ └── app-root │ │ ├── Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch │ │ ├── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ │ └── 50-mpm.conf.template │ │ ├── httpdconf-fed.sed │ │ └── httpdconf.sed │ │ └── psgiwrapper ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── fcgi │ ├── imagestreams │ ├── psgi │ ├── psgi-hot_deploy │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── run-pytest │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_container_basics.py │ ├── test_container_s2i.py │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── 5.34 ├── .exclude-c9s ├── .exclude-fedora ├── Dockerfile.c9s ├── Dockerfile.fedora ├── README.md ├── root │ └── opt │ │ └── app-root │ │ ├── Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch │ │ ├── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ │ └── 50-mpm.conf.template │ │ ├── httpdconf-fed.sed │ │ └── httpdconf.sed │ │ └── psgiwrapper ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── fcgi │ ├── imagestreams │ ├── psgi │ ├── psgi-hot_deploy │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── run-pytest │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_container_basics.py │ ├── test_container_s2i.py │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── 5.36 ├── .exclude-c9s ├── Dockerfile.c9s ├── Dockerfile.fedora ├── README.md ├── root │ └── opt │ │ └── app-root │ │ ├── Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch │ │ ├── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ │ └── 50-mpm.conf.template │ │ ├── httpdconf-fed.sed │ │ └── httpdconf.sed │ │ └── psgiwrapper ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── fcgi │ ├── imagestreams │ ├── psgi │ ├── psgi-hot_deploy │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── run-pytest │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_container_basics.py │ ├── test_container_s2i.py │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── 5.38 ├── .exclude-c9s ├── Dockerfile.c9s ├── Dockerfile.fedora ├── README.md ├── root │ └── opt │ │ └── app-root │ │ ├── Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch │ │ ├── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ │ └── 50-mpm.conf.template │ │ ├── httpdconf-fed.sed │ │ └── httpdconf.sed │ │ └── psgiwrapper ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── fcgi │ ├── imagestreams │ ├── psgi │ ├── psgi-hot_deploy │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── run-pytest │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_container_basics.py │ ├── test_container_s2i.py │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── 5.40 ├── .exclude-c9s ├── Dockerfile.c10s ├── Dockerfile.c9s ├── Dockerfile.fedora ├── Dockerfile.rhel10 ├── README.md ├── root │ └── opt │ │ └── app-root │ │ ├── Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch │ │ ├── etc │ │ ├── httpd.conf │ │ ├── httpd.d │ │ │ └── 50-mpm.conf.template │ │ ├── httpdconf-fed.sed │ │ └── httpdconf.sed │ │ └── psgiwrapper ├── s2i │ └── bin │ │ ├── assemble │ │ ├── run │ │ └── usage └── test │ ├── __init__.py │ ├── binpath │ ├── conftest.py │ ├── examples │ ├── fcgi │ ├── imagestreams │ ├── psgi │ ├── psgi-hot_deploy │ ├── psgi-variables │ ├── run │ ├── run-openshift-pytest │ ├── run-openshift-remote-cluster │ ├── run-pytest │ ├── sample-test-app │ ├── sample-test-app.json │ ├── test-lib-openshift.sh │ ├── test-lib-perl.sh │ ├── test-lib-remote-openshift.sh │ ├── test-lib.sh │ ├── test-openshift.yaml │ ├── test_container_basics.py │ ├── test_container_s2i.py │ ├── test_ocp_dancer_ex_standalone.py │ ├── test_ocp_dancer_ex_templates.py │ ├── test_ocp_deploy_templates.py │ ├── test_ocp_helm_dancer_app.py │ ├── test_ocp_helm_dancer_mysql_template.py │ ├── test_ocp_helm_perl_imagestreams.py │ ├── test_ocp_imagestreams_quickstart.py │ ├── test_ocp_latest_imagestreams.py │ └── warningonstderr ├── LICENSE ├── Makefile ├── README.md ├── examples ├── README.md ├── from-dockerfile │ ├── 5.26-mod_fcgid │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ ├── 5.26 │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ ├── 5.30-mod_fcgid │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ ├── 5.30 │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ ├── 5.32 │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ ├── 5.34 │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ ├── 5.36 │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ ├── 5.38 │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ ├── 5.40 │ │ ├── Dockerfile │ │ └── Dockerfile.s2i │ └── README.md ├── sample-test-app │ ├── cpanfile │ └── index.pl └── templates │ └── sample-test-app.json ├── imagestreams ├── imagestreams.yaml ├── perl-centos.json ├── perl-rhel-aarch64.json └── perl-rhel.json └── test ├── __init__.py ├── binpath ├── cpanfile └── index.pl ├── check_imagestreams.py ├── conftest.py ├── fcgi ├── another.fcgi └── index.fcgi ├── psgi-hot_deploy ├── cpanfile ├── index.psgi └── lib │ └── My │ └── Test.pm ├── psgi-variables ├── application2.psgi └── cpanfile ├── psgi ├── application.psgi └── cpanfile ├── run ├── run-modfcgid ├── run-openshift-pytest ├── run-openshift-remote-cluster ├── run-pytest ├── show_all_imagestreams.py ├── test-lib-openshift.sh ├── test-lib-perl.sh ├── test-lib-remote-openshift.sh ├── test-lib.sh ├── test-openshift.yaml ├── test_container_basics.py ├── test_container_s2i.py ├── test_ocp_dancer_ex_standalone.py ├── test_ocp_dancer_ex_templates.py ├── test_ocp_deploy_templates.py ├── test_ocp_helm_dancer_app.py ├── test_ocp_helm_dancer_mysql_template.py ├── test_ocp_helm_perl_imagestreams.py ├── test_ocp_imagestreams_quickstart.py ├── test_ocp_latest_imagestreams.py └── warningonstderr └── index.pl /.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | target-branch: [] 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: gitsubmodule 6 | directory: / 7 | schedule: 8 | interval: weekly 9 | labels: 10 | - 'ready for review' 11 | - package-ecosystem: github-actions 12 | directory: / 13 | schedule: 14 | interval: monthly 15 | labels: 16 | - 'ready for review' 17 | -------------------------------------------------------------------------------- /.github/workflows/auto-merge-on-demand.yml: -------------------------------------------------------------------------------- 1 | name: Auto Merge On Demand 2 | on: 3 | issue_comment: 4 | types: 5 | - created 6 | workflow_dispatch: 7 | inputs: 8 | pr-number: 9 | description: 'Pull Request number/s ; when not provided, the workflow will run for all open PRs' 10 | required: true 11 | default: '0' 12 | 13 | permissions: 14 | contents: read 15 | 16 | jobs: 17 | # Get all open PRs 18 | gather-pull-requests: 19 | if: | 20 | github.repository_owner == 'sclorg' 21 | || (contains(github.event.comment.body, '/auto-merge') 22 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)) 23 | runs-on: ubuntu-latest 24 | 25 | outputs: 26 | pr-numbers: ${{ steps.get-pr-numbers.outputs.result }} 27 | pr-numbers-manual: ${{ steps.parse-manual-input.outputs.result }} 28 | 29 | steps: 30 | - id: get-pr-numbers 31 | if: inputs.pr-number == '0' 32 | name: Get all open PRs 33 | uses: actions/github-script@v8 34 | with: 35 | # !FIXME: this is not working if there is more than 100 PRs opened 36 | script: | 37 | const { data: pullRequests } = await github.rest.pulls.list({ 38 | owner: context.repo.owner, 39 | repo: context.repo.repo, 40 | state: 'open', 41 | per_page: 100 42 | }); 43 | return pullRequests.map(pr => pr.number); 44 | 45 | - id: parse-manual-input 46 | if: inputs.pr-number != '0' 47 | name: Parse manual input 48 | run: | 49 | # shellcheck disable=SC2086 50 | echo "result="[ ${{ github.event.issue.number }} ]"" >> $GITHUB_OUTPUT 51 | shell: bash 52 | 53 | validate-pr: 54 | name: 'Validation of Pull Request #${{ matrix.pr-number }}' 55 | needs: [ gather-pull-requests ] 56 | runs-on: ubuntu-latest 57 | 58 | strategy: 59 | fail-fast: false 60 | matrix: 61 | pr-number: ${{ inputs.pr-number == 0 && fromJSON(needs.gather-pull-requests.outputs.pr-numbers) || fromJSON(needs.gather-pull-requests.outputs.pr-numbers-manual) }} 62 | 63 | permissions: 64 | # required for merging PRs 65 | contents: write 66 | # required for PR comments and setting labels 67 | pull-requests: write 68 | 69 | steps: 70 | - name: Auto Merge wrapper 71 | uses: sclorg/auto-merge-wrapper@v1 72 | with: 73 | pr-number: ${{ matrix.pr-number }} 74 | token: ${{ secrets.GITHUB_TOKEN }} 75 | -------------------------------------------------------------------------------- /.github/workflows/auto-merge.yml: -------------------------------------------------------------------------------- 1 | name: Auto Merge 2 | on: 3 | workflow_run: 4 | workflows: [ Gather Pull Request Metadata ] 5 | types: 6 | - completed 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | download-metadata: 13 | if: > 14 | github.event.workflow_run.event == 'pull_request' && 15 | github.event.workflow_run.conclusion == 'success' 16 | runs-on: ubuntu-latest 17 | 18 | outputs: 19 | pr-metadata: ${{ steps.Artifact.outputs.pr-metadata-json }} 20 | 21 | steps: 22 | - id: Artifact 23 | name: Download Artifact 24 | uses: redhat-plumbers-in-action/download-artifact@v1 25 | with: 26 | name: pr-metadata 27 | 28 | auto-merge: 29 | needs: [ download-metadata ] 30 | runs-on: ubuntu-latest 31 | 32 | permissions: 33 | # required for merging PRs 34 | contents: write 35 | # required for PR comments and setting labels 36 | pull-requests: write 37 | 38 | steps: 39 | - name: Auto Merge wrapper 40 | uses: sclorg/auto-merge-wrapper@v1 41 | with: 42 | pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }} 43 | token: ${{ secrets.GITHUB_TOKEN }} 44 | -------------------------------------------------------------------------------- /.github/workflows/build-and-push.yml: -------------------------------------------------------------------------------- 1 | name: Build and push images to Quay.io registry 2 | on: 3 | push: 4 | branches: 5 | - master 6 | schedule: 7 | - cron: '0 1 * * 3' 8 | 9 | jobs: 10 | build-and-push: 11 | if: github.repository_owner == 'sclorg' 12 | runs-on: ubuntu-latest 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | include: 17 | - dockerfile: "5.32/Dockerfile.c9s" 18 | docker_context: "5.32" 19 | registry_namespace: "sclorg" 20 | tag: "c9s" 21 | image_name: "perl-532-c9s" 22 | quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" 23 | quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" 24 | 25 | - dockerfile: "5.36/Dockerfile.fedora" 26 | docker_context: "5.36" 27 | registry_namespace: "fedora" 28 | tag: "5.36" 29 | image_name: "perl-536" 30 | quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME" 31 | quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN" 32 | 33 | - dockerfile: "5.38/Dockerfile.fedora" 34 | docker_context: "5.38" 35 | registry_namespace: "fedora" 36 | tag: "5.38" 37 | image_name: "perl-538" 38 | quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME" 39 | quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN" 40 | 41 | - dockerfile: "5.40/Dockerfile.fedora" 42 | docker_context: "5.40" 43 | registry_namespace: "fedora" 44 | tag: "5.40" 45 | image_name: "perl-540" 46 | quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME" 47 | quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN" 48 | 49 | - dockerfile: "5.40/Dockerfile.c10s" 50 | docker_context: "5.40" 51 | registry_namespace: "sclorg" 52 | tag: "c10s" 53 | image_name: "perl-540-c10s" 54 | quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" 55 | quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" 56 | 57 | 58 | steps: 59 | - name: Build and push to quay.io registry 60 | uses: sclorg/build-and-push-action@v4 61 | with: 62 | registry: "quay.io" 63 | registry_namespace: ${{ matrix.registry_namespace }} 64 | registry_username: ${{ secrets[matrix.quayio_username] }} 65 | registry_token: ${{ secrets[matrix.quayio_token] }} 66 | dockerfile: ${{ matrix.dockerfile }} 67 | docker_context: ${{ matrix.docker_context }} 68 | tag: ${{ matrix.tag }} 69 | image_name: ${{ matrix.image_name }} 70 | readme: "${{ matrix.docker_context }}/README.md" 71 | quay_application_token: ${{ secrets.QUAY_IMAGE_SCLORG_UPDATE_DESC }} 72 | -------------------------------------------------------------------------------- /.github/workflows/container-pytest.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issue_comment: 3 | types: 4 | - created 5 | jobs: 6 | container-tests: 7 | name: "Container PyTest: ${{ matrix.version }} - ${{ matrix.os_test }}" 8 | runs-on: ubuntu-latest 9 | concurrency: 10 | group: container-pytest-${{ github.event.issue.number }}-${{ matrix.version }}-${{ matrix.os_test }} 11 | cancel-in-progress: true 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | version: [ "5.26", "5.26-mod_fcgid", "5.30", "5.32", "5.34", "5.36", "5.38", "5.40" ] 16 | os_test: [ "fedora", "rhel8", "rhel9", "rhel10", "c9s", "c10s" ] 17 | test_case: [ "container-pytest" ] 18 | 19 | if: | 20 | github.event.issue.pull_request 21 | && (contains(github.event.comment.body, '[test-pytest]') || contains(github.event.comment.body, '[test-all]')) 22 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) 23 | steps: 24 | - uses: sclorg/tfaga-wrapper@main 25 | with: 26 | os_test: ${{ matrix.os_test }} 27 | version: ${{ matrix.version }} 28 | test_case: ${{ matrix.test_case }} 29 | public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }} 30 | private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }} 31 | -------------------------------------------------------------------------------- /.github/workflows/container-tests.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issue_comment: 3 | types: 4 | - created 5 | jobs: 6 | container-tests: 7 | name: "Container tests: ${{ matrix.version }} - ${{ matrix.os_test }}" 8 | runs-on: ubuntu-latest 9 | concurrency: 10 | group: container-${{ github.event.issue.number }}-${{ matrix.version }}-${{ matrix.os_test }} 11 | cancel-in-progress: true 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | version: [ "5.26", "5.26-mod_fcgid", "5.30", "5.32", "5.34", "5.36", "5.38", "5.40" ] 16 | os_test: [ "fedora", "rhel8", "rhel9", "rhel10", "c9s", "c10s" ] 17 | test_case: [ "container" ] 18 | 19 | if: | 20 | github.event.issue.pull_request 21 | && (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]')) 22 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) 23 | steps: 24 | - uses: sclorg/tfaga-wrapper@main 25 | with: 26 | os_test: ${{ matrix.os_test }} 27 | version: ${{ matrix.version }} 28 | test_case: ${{ matrix.test_case }} 29 | public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }} 30 | private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }} 31 | -------------------------------------------------------------------------------- /.github/workflows/openshift-pytests.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issue_comment: 3 | types: 4 | - created 5 | jobs: 6 | check-imagestreams: 7 | runs-on: ubuntu-latest 8 | permissions: 9 | contents: read 10 | statuses: write 11 | if: | 12 | github.event.issue.pull_request 13 | && (contains(github.event.comment.body, '[test-openshift-pytest]') || contains(github.event.comment.body, '[test-all]')) 14 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) 15 | steps: 16 | - uses: sclorg/ci-scripts/ocp-stream-generator@master 17 | with: 18 | ref: "refs/pull/${{ github.event.issue.number }}/head" 19 | 20 | openshift-pytests: 21 | name: "${{ matrix.test_case }} PyTests: ${{ matrix.version }} - ${{ matrix.os_test }}" 22 | runs-on: ubuntu-latest 23 | needs: check-imagestreams 24 | concurrency: 25 | group: ocp-pytest-${{ github.event.issue.number }}-${{ matrix.version }}-${{ matrix.os_test }} 26 | cancel-in-progress: true 27 | strategy: 28 | fail-fast: false 29 | matrix: 30 | version: [ "5.26", "5.26-mod_fcgid", "5.30-mod_fcgid", "5.32", "5.40" ] 31 | os_test: [ "rhel8", "rhel9", "rhel10" ] 32 | test_case: [ "openshift-pytest" ] 33 | 34 | steps: 35 | - uses: sclorg/tfaga-wrapper@main 36 | with: 37 | os_test: ${{ matrix.os_test }} 38 | version: ${{ matrix.version }} 39 | test_case: ${{ matrix.test_case }} 40 | public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }} 41 | private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }} 42 | -------------------------------------------------------------------------------- /.github/workflows/openshift-tests.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issue_comment: 3 | types: 4 | - created 5 | jobs: 6 | check-imagestreams: 7 | runs-on: ubuntu-latest 8 | permissions: 9 | contents: read 10 | statuses: write 11 | if: | 12 | github.event.issue.pull_request 13 | && (contains(github.event.comment.body, '[test-openshift]') || contains(github.event.comment.body, '[test-all]')) 14 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) 15 | steps: 16 | - uses: sclorg/ci-scripts/ocp-stream-generator@master 17 | with: 18 | ref: "refs/pull/${{ github.event.issue.number }}/head" 19 | 20 | openshift-tests: 21 | name: "${{ matrix.test_case }} tests: ${{ matrix.version }} - ${{ matrix.os_test }}" 22 | runs-on: ubuntu-latest 23 | needs: check-imagestreams 24 | concurrency: 25 | group: ocp-${{ github.event.issue.number }}-${{ matrix.version }}-${{ matrix.os_test }} 26 | cancel-in-progress: true 27 | strategy: 28 | fail-fast: false 29 | matrix: 30 | version: [ "5.26", "5.26-mod_fcgid", "5.30", "5.32", "5.34", "5.36", "5.38", "5.40" ] 31 | os_test: [ "rhel8", "rhel9", "rhel10" ] 32 | test_case: [ "openshift-4" ] 33 | 34 | steps: 35 | - uses: sclorg/tfaga-wrapper@main 36 | with: 37 | os_test: ${{ matrix.os_test }} 38 | version: ${{ matrix.version }} 39 | test_case: ${{ matrix.test_case }} 40 | public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }} 41 | private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }} 42 | -------------------------------------------------------------------------------- /.github/workflows/pr-metadata.yml: -------------------------------------------------------------------------------- 1 | name: Gather Pull Request Metadata 2 | on: 3 | pull_request: 4 | types: [ opened, reopened, synchronize ] 5 | branches: [ master ] 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | gather-metadata: 12 | if: github.repository_owner == 'sclorg' 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Repository checkout 17 | uses: actions/checkout@v5 18 | 19 | - id: Metadata 20 | name: Gather Pull Request Metadata 21 | uses: redhat-plumbers-in-action/gather-pull-request-metadata@v1 22 | 23 | - name: Upload artifact with gathered metadata 24 | uses: actions/upload-artifact@v4 25 | with: 26 | name: pr-metadata 27 | path: ${{ steps.Metadata.outputs.metadata-file }} 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # help.1 files complied by container-common-scripts from README.md files 2 | */root/help.1 3 | 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "common"] 2 | path = common 3 | url = https://github.com/sclorg/container-common-scripts.git 4 | -------------------------------------------------------------------------------- /5.26-mod_fcgid/content_sets.yml: -------------------------------------------------------------------------------- 1 | # This is a file defining which content sets are needed to update content in 2 | # this image. Data provided here helps determine which images are vulnerable to 3 | # specific CVEs. Generally you should only need to update this file when: 4 | # 1. You start depending on new product 5 | # 2. You are preparing new product release and your content sets will change 6 | --- 7 | x86_64: 8 | - rhel-8-for-x86_64-baseos-beta-rpms 9 | - rhel-8-for-x86_64-appstream-beta-rpms 10 | 11 | ppc64le: 12 | - rhel-8-for-ppc64le-baseos-beta-rpms 13 | - rhel-8-for-ppc64le-appstream-beta-rpms 14 | 15 | s390x: 16 | - rhel-8-for-s390x-baseos-beta-rpms 17 | - rhel-8-for-s390x-appstream-beta-rpms 18 | 19 | aarch64: 20 | - rhel-8-for-aarch64-baseos-beta-rpms 21 | - rhel-8-for-aarch64-appstream-beta-rpms 22 | -------------------------------------------------------------------------------- /5.26-mod_fcgid/root/opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch: -------------------------------------------------------------------------------- 1 | From d65d28410b91dfb3d9d12b6b8e49a79c7da54e1c Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= 3 | Date: Wed, 9 Jan 2019 12:33:59 +0100 4 | Subject: [PATCH] Work around mod_fcgid bogus SCRIPT_NAME/PATH_INFO 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | mod_fcgid sends wrong PATH_INFO to virtual FcgidWrapper and that 10 | prevents Plack from passing an application path to PSGI. 11 | 12 | This adds a side channel for passing application URI location to 13 | Plack's FCGI handler. 14 | 15 | https://bugzilla.redhat.com/show_bug.cgi?id=1651746 16 | 17 | 18 | 19 | 20 | Signed-off-by: Petr Písař 21 | --- 22 | lib/Plack/Handler/FCGI.pm | 11 +++++++++++ 23 | 1 file changed, 11 insertions(+) 24 | 25 | diff --git a/lib/Plack/Handler/FCGI.pm b/lib/Plack/Handler/FCGI.pm 26 | index 029051c..0c491b2 100644 27 | --- a/lib/Plack/Handler/FCGI.pm 28 | +++ b/lib/Plack/Handler/FCGI.pm 29 | @@ -124,6 +124,17 @@ sub run { 30 | delete $env->{HTTP_CONTENT_TYPE}; 31 | delete $env->{HTTP_CONTENT_LENGTH}; 32 | 33 | + # mod_fcgid provides wrong SCRIPT_NAME and PATH_INFO for virtual FCGI script handlers 34 | + # 35 | + # 36 | + # 37 | + if (exists $ENV{MODFCGID_VIRTUAL_LOCATION}) { 38 | + if ($ENV{MODFCGID_VIRTUAL_LOCATION} eq '/') { 39 | + $ENV{MODFCGID_VIRTUAL_LOCATION} = ''; 40 | + } 41 | + $env->{SCRIPT_NAME} = $ENV{MODFCGID_VIRTUAL_LOCATION}; 42 | + } 43 | + 44 | # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it 45 | my $uri = URI->new("http://localhost" . $env->{REQUEST_URI}); 46 | $env->{PATH_INFO} = uri_unescape($uri->path); 47 | -- 48 | 2.17.2 49 | 50 | -------------------------------------------------------------------------------- /5.26-mod_fcgid/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule env_module modules/mod_env.so 2 | 3 | 4 | LoadModule cgid_module modules/mod_cgid.so 5 | 6 | 7 | LoadModule cgid_module modules/mod_cgid.so 8 | 9 | 10 | LoadModule cgi_module modules/mod_cgi.so 11 | 12 | 13 | LoadModule unixd_module modules/mod_unixd.so 14 | LoadModule authn_core_module modules/mod_authn_core.so 15 | LoadModule authz_core_module modules/mod_authz_core.so 16 | LoadModule fcgid_module modules/mod_fcgid.so 17 | 18 | FcgidIPCDir /run/mod_fcgid 19 | FcgidProcessTableFile /run/mod_fcgid/fcgid_shm 20 | 21 | DirectoryIndex index.pl index.cgi index.fcg index.fcgi index.fpl 22 | 23 | 24 | SetHandler cgi-script 25 | Options +ExecCGI +SymLinksIfOwnerMatch 26 | 27 | 28 | 29 | SetHandler fcgid-script 30 | Options +ExecCGI +SymLinksIfOwnerMatch 31 | 32 | 33 | 34 | Require all granted 35 | 36 | 37 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf 38 | -------------------------------------------------------------------------------- /5.26-mod_fcgid/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | 4 | MinSpareServers ${HTTPD_START_SERVERS} 5 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 6 | 7 | # The MaxRequestWorkers directive sets the limit on the number of 8 | # simultaneous requests that will be served. 9 | # The default value, when no cgroup limits are set is 256. 10 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 11 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 12 | MaxConnectionsPerChild 4000 13 | MaxKeepAliveRequests 100 14 | -------------------------------------------------------------------------------- /5.26-mod_fcgid/root/opt/app-root/etc/httpdconf.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ /opt/app-root/etc/httpd.d/env.conf 16 | fi 17 | 18 | export_vars=$(cgroup-limits) ; export $export_vars 19 | 20 | # Validate server limit option 21 | if [[ ! "${HTTPD_MAX_REQUEST_WORKERS:-1}" =~ ^[1-9][0-9]*$ || "${HTTPD_MAX_REQUEST_WORKERS:-1}" -gt 20000 ]]; then 22 | echo "HTTPD_MAX_REQUEST_WORKERS needs be an integer between 1 and 20000" 23 | exit 1 24 | fi 25 | 26 | # If there is no server limit specified, try to guess the best value 27 | if [ -z "${HTTPD_MAX_REQUEST_WORKERS:-}" ]; then 28 | MAX_SERVER_LIMIT=$(((MEMORY_LIMIT_IN_BYTES/1024/1024 - 30) / 7)) 29 | MAX_SERVER_LIMIT=$((MAX_SERVER_LIMIT > 0 ? MAX_SERVER_LIMIT : 1)) 30 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 31 | fi 32 | 33 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 34 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 35 | 36 | envsubst < /opt/app-root/etc/httpd.d/50-mpm.conf.template > /opt/app-root/etc/httpd.d/50-mpm.conf 37 | 38 | if [ -f ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template ]; then 39 | PLACKUP_ARGS="" 40 | if [ -n "$PSGI_RELOAD" ]; then 41 | PLACKUP_ARGS="-r -R ${APP_ROOT}/src/" 42 | fi 43 | 44 | export PLACKUP_ARGS=${PLACKUP_ARGS} 45 | 46 | envsubst < ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template > ${APP_ROOT}/etc/httpd.d/40-psgi.conf 47 | fi 48 | 49 | exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 50 | -------------------------------------------------------------------------------- /5.26-mod_fcgid/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=sclorg 5 | if [[ $DISTRO =~ rhel* ]]; then 6 | NAMESPACE=rhel8 7 | DISTRO="" 8 | else 9 | DISTRO="-c8s" 10 | fi 11 | 12 | cat < -- curl 127.0.0.1:8080 24 | EOF 25 | -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/fcgi: -------------------------------------------------------------------------------- 1 | ../../test/fcgi -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/psgi-hot_deploy: -------------------------------------------------------------------------------- 1 | ../../test/psgi-hot_deploy -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run-modfcgid -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/run-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-pytest -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app/ -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_basics.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_container_s2i.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_s2i.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.26-mod_fcgid/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /5.26/.exclude-fedora: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.26/.exclude-fedora -------------------------------------------------------------------------------- /5.26/content_sets.yml: -------------------------------------------------------------------------------- 1 | # This is a file defining which content sets are needed to update content in 2 | # this image. Data provided here helps determine which images are vulnerable to 3 | # specific CVEs. Generally you should only need to update this file when: 4 | # 1. You start depending on new product 5 | # 2. You are preparing new product release and your content sets will change 6 | --- 7 | x86_64: 8 | - rhel-7-server-rpms 9 | - rhel-7-server-optional-rpms 10 | - rhel-server-rhscl-7-rpms 11 | -------------------------------------------------------------------------------- /5.26/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule perl_module modules/mod_perl.so 2 | DirectoryIndex index.pl 3 | 4 | PerlSwitches -I./extlib/lib/perl5 5 | 6 | 7 | SetHandler perl-script 8 | PerlResponseHandler ModPerl::PerlRun 9 | Options +ExecCGI +SymLinksIfOwnerMatch 10 | PerlSendHeader On 11 | 12 | 13 | 14 | Require all granted 15 | 16 | 17 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf 18 | -------------------------------------------------------------------------------- /5.26/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | MinSpareServers ${HTTPD_START_SERVERS} 4 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 5 | # The MaxRequestWorkers directive sets the limit on the number of 6 | # simultaneous requests that will be served. 7 | # The default value, when no cgroup limits are set is 256. 8 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 9 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 10 | MaxConnectionsPerChild 4000 11 | MaxKeepAliveRequests 100 12 | -------------------------------------------------------------------------------- /5.26/root/opt/app-root/etc/httpdconf-fed.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ Installing application source ..." 7 | mv /tmp/src/* ./ 8 | 9 | # Fix source directory permissions 10 | fix-permissions ./ 11 | 12 | if [ -d ./cfg ]; then 13 | echo "---> Copying configuration files..." 14 | if [ "$(ls -A ./cfg/*.conf)" ]; then 15 | cp -av ./cfg/*.conf /opt/app-root/etc/httpd.d/ 16 | fi 17 | fi 18 | 19 | # Allow for http proxy to be specified in uppercase 20 | if [[ -n "${HTTP_PROXY:-}" && -z "${http_proxy:-}" ]]; then 21 | export http_proxy=$HTTP_PROXY 22 | fi 23 | 24 | export CPAN_MIRROR=${CPAN_MIRROR:-""} 25 | 26 | MIRROR_ARGS="" 27 | 28 | if [ -n "$CPAN_MIRROR" ]; then 29 | MIRROR_ARGS="--mirror $CPAN_MIRROR" 30 | fi 31 | 32 | # Change the npm registry mirror if provided 33 | if [ -n "$NPM_MIRROR" ]; then 34 | npm config set registry $NPM_MIRROR 35 | fi 36 | 37 | # Don't test installed Perl modules by default 38 | if [ "${ENABLE_CPAN_TEST}" = true ]; then 39 | export ENABLE_CPAN_TEST="" 40 | else 41 | export ENABLE_CPAN_TEST="--notest" 42 | fi 43 | 44 | # Configure mod_perl for PSGI. 45 | # If PSGI_FILE variable is set but empty, skip it. 46 | # If PSGI_FILE is set and non-empty, use it. 47 | # If PSGI_FILE does not exist, check if exactly one ./*.psgi file exists and 48 | # use that file. 49 | # If PSGI_URI_PATH variable has a value, use it as a location. Default is "/". 50 | if [ ! -v PSGI_FILE ]; then 51 | PSGI_FILE=$(find -maxdepth 1 -name '*.psgi' -type f) 52 | fi 53 | PSGI_FILE_NUMBER=$(printf '%s' "$PSGI_FILE" | wc -l) 54 | if [ -n "$PSGI_FILE" -a "$PSGI_FILE_NUMBER" -eq 0 ]; then 55 | echo "---> PSGI application found in $PSGI_FILE" 56 | cat >> cpanfile <<"EOF" 57 | requires 'Plack::Handler::Apache2'; 58 | EOF 59 | # XXX: Escape PSGI_FILE value against httpd control characters 60 | PSGI_FILE=$(printf '%s' "$PSGI_FILE" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') 61 | cat > /opt/app-root/etc/httpd.d/40-psgi.conf < 63 | SetHandler perl-script 64 | PerlResponseHandler Plack::Handler::Apache2 65 | PerlSetVar psgi_app "$PSGI_FILE" 66 | 67 | EOF 68 | elif [ "$PSGI_FILE_NUMBER" -gt 0 ]; then 69 | echo "---> Multiple PSGI applications found:" 70 | printf '%s' "$PSGI_FILE" 71 | echo "---> Skipping PSGI autoconfiguration!" 72 | fi 73 | 74 | # Installing dependencies with cpanfile 75 | if [ -f "cpanfile" ]; then 76 | echo "---> Installing modules from cpanfile ..." 77 | cpanm $MIRROR_ARGS $ENABLE_CPAN_TEST -l extlib Module::CoreList 78 | cpanm $MIRROR_ARGS $ENABLE_CPAN_TEST -l extlib --installdeps . 79 | else 80 | echo "---> No cpanfile found, nothing to install" 81 | fi 82 | 83 | # Fix source directory permissions 84 | fix-permissions ./ 85 | -------------------------------------------------------------------------------- /5.26/s2i/bin/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Warning: Please note that this will pass all environment variables available within the 6 | # container to mod_perl by means of PerlPassEnv in the env.conf file 7 | if [ ! -f /opt/app-root/etc/httpd.d/env.conf ]; then 8 | env | awk -F'=' '{print "PerlPassEnv "$1}' > /opt/app-root/etc/httpd.d/env.conf 9 | fi 10 | 11 | # Enable automatic reloading. This can be useful for debugging an application. 12 | PERL_APACHE2_RELOAD=${PERL_APACHE2_RELOAD:-} 13 | if [[ "${PERL_APACHE2_RELOAD,,}" == "true" ]]; then 14 | cat > /opt/app-root/etc/httpd.d/50-autoreload.conf < 0 ? MAX_SERVER_LIMIT : 1)) 32 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 33 | fi 34 | 35 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 36 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 37 | 38 | envsubst < /opt/app-root/etc/httpd.d/50-mpm.conf.template > /opt/app-root/etc/httpd.d/50-mpm.conf 39 | 40 | exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 41 | -------------------------------------------------------------------------------- /5.26/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=centos 5 | [[ $DISTRO =~ rhel* ]] && NAMESPACE=rhscl 6 | 7 | cat < -- curl 127.0.0.1:8080 18 | EOF 19 | -------------------------------------------------------------------------------- /5.26/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.26/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.26/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.26/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples/ -------------------------------------------------------------------------------- /5.26/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams/ -------------------------------------------------------------------------------- /5.26/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.26/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.26/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run -------------------------------------------------------------------------------- /5.26/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.26/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.26/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app/ -------------------------------------------------------------------------------- /5.26/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.26/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.26/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.26/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.26/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.26/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.26/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.26/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.26/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.26/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.26/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.26/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.26/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.26/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.26/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /5.30-mod_fcgid/.exclude-rhel8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.30-mod_fcgid/.exclude-rhel8 -------------------------------------------------------------------------------- /5.30-mod_fcgid/README.md: -------------------------------------------------------------------------------- 1 | Perl 5.30 container image 2 | ========================= 3 | 4 | **The Perl 5.30-mod_fcgid image is deprecated.** -------------------------------------------------------------------------------- /5.30-mod_fcgid/root/opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch: -------------------------------------------------------------------------------- 1 | From d65d28410b91dfb3d9d12b6b8e49a79c7da54e1c Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= 3 | Date: Wed, 9 Jan 2019 12:33:59 +0100 4 | Subject: [PATCH] Work around mod_fcgid bogus SCRIPT_NAME/PATH_INFO 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | mod_fcgid sends wrong PATH_INFO to virtual FcgidWrapper and that 10 | prevents Plack from passing an application path to PSGI. 11 | 12 | This adds a side channel for passing application URI location to 13 | Plack's FCGI handler. 14 | 15 | https://bugzilla.redhat.com/show_bug.cgi?id=1651746 16 | 17 | 18 | 19 | 20 | Signed-off-by: Petr Písař 21 | --- 22 | lib/Plack/Handler/FCGI.pm | 11 +++++++++++ 23 | 1 file changed, 11 insertions(+) 24 | 25 | diff --git a/lib/Plack/Handler/FCGI.pm b/lib/Plack/Handler/FCGI.pm 26 | index 029051c..0c491b2 100644 27 | --- a/lib/Plack/Handler/FCGI.pm 28 | +++ b/lib/Plack/Handler/FCGI.pm 29 | @@ -124,6 +124,17 @@ sub run { 30 | delete $env->{HTTP_CONTENT_TYPE}; 31 | delete $env->{HTTP_CONTENT_LENGTH}; 32 | 33 | + # mod_fcgid provides wrong SCRIPT_NAME and PATH_INFO for virtual FCGI script handlers 34 | + # 35 | + # 36 | + # 37 | + if (exists $ENV{MODFCGID_VIRTUAL_LOCATION}) { 38 | + if ($ENV{MODFCGID_VIRTUAL_LOCATION} eq '/') { 39 | + $ENV{MODFCGID_VIRTUAL_LOCATION} = ''; 40 | + } 41 | + $env->{SCRIPT_NAME} = $ENV{MODFCGID_VIRTUAL_LOCATION}; 42 | + } 43 | + 44 | # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it 45 | my $uri = URI->new("http://localhost" . $env->{REQUEST_URI}); 46 | $env->{PATH_INFO} = uri_unescape($uri->path); 47 | -- 48 | 2.17.2 49 | 50 | -------------------------------------------------------------------------------- /5.30-mod_fcgid/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule env_module modules/mod_env.so 2 | 3 | 4 | LoadModule cgid_module modules/mod_cgid.so 5 | 6 | 7 | LoadModule cgid_module modules/mod_cgid.so 8 | 9 | 10 | LoadModule cgi_module modules/mod_cgi.so 11 | 12 | 13 | LoadModule unixd_module modules/mod_unixd.so 14 | LoadModule authn_core_module modules/mod_authn_core.so 15 | LoadModule authz_core_module modules/mod_authz_core.so 16 | LoadModule fcgid_module modules/mod_fcgid.so 17 | 18 | FcgidIPCDir /run/mod_fcgid 19 | FcgidProcessTableFile /run/mod_fcgid/fcgid_shm 20 | 21 | DirectoryIndex index.pl index.cgi index.fcg index.fcgi index.fpl 22 | 23 | 24 | SetHandler cgi-script 25 | Options +ExecCGI +SymLinksIfOwnerMatch 26 | 27 | 28 | 29 | SetHandler fcgid-script 30 | Options +ExecCGI +SymLinksIfOwnerMatch 31 | 32 | 33 | 34 | Require all granted 35 | 36 | 37 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf 38 | -------------------------------------------------------------------------------- /5.30-mod_fcgid/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | 4 | MinSpareServers ${HTTPD_START_SERVERS} 5 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 6 | 7 | # The MaxRequestWorkers directive sets the limit on the number of 8 | # simultaneous requests that will be served. 9 | # The default value, when no cgroup limits are set is 256. 10 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 11 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 12 | MaxConnectionsPerChild 4000 13 | MaxKeepAliveRequests 100 14 | -------------------------------------------------------------------------------- /5.30-mod_fcgid/root/opt/app-root/etc/httpdconf.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ /opt/app-root/etc/httpd.d/env.conf 16 | fi 17 | 18 | export_vars=$(cgroup-limits) ; export $export_vars 19 | 20 | # Validate server limit option 21 | if [[ ! "${HTTPD_MAX_REQUEST_WORKERS:-1}" =~ ^[1-9][0-9]*$ || "${HTTPD_MAX_REQUEST_WORKERS:-1}" -gt 20000 ]]; then 22 | echo "HTTPD_MAX_REQUEST_WORKERS needs be an integer between 1 and 20000" 23 | exit 1 24 | fi 25 | 26 | # If there is no server limit specified, try to guess the best value 27 | if [ -z "${HTTPD_MAX_REQUEST_WORKERS:-}" ]; then 28 | MAX_SERVER_LIMIT=$(((MEMORY_LIMIT_IN_BYTES/1024/1024 - 30) / 7)) 29 | MAX_SERVER_LIMIT=$((MAX_SERVER_LIMIT > 0 ? MAX_SERVER_LIMIT : 1)) 30 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 31 | fi 32 | 33 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 34 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 35 | 36 | envsubst < /opt/app-root/etc/httpd.d/50-mpm.conf.template > /opt/app-root/etc/httpd.d/50-mpm.conf 37 | 38 | if [ -f ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template ]; then 39 | PLACKUP_ARGS="" 40 | if [ -n "$PSGI_RELOAD" ]; then 41 | PLACKUP_ARGS="-r -R ${APP_ROOT}/src/" 42 | fi 43 | 44 | export PLACKUP_ARGS=${PLACKUP_ARGS} 45 | 46 | envsubst < ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template > ${APP_ROOT}/etc/httpd.d/40-psgi.conf 47 | fi 48 | 49 | exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 50 | -------------------------------------------------------------------------------- /5.30-mod_fcgid/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=centos 5 | SUFFIX='-centos8' 6 | if [[ $DISTRO =~ rhel* ]]; then 7 | NAMESPACE=rhel8 8 | SUFFIX='' 9 | fi 10 | 11 | cat < -- curl 127.0.0.1:8080 23 | EOF 24 | -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/fcgi: -------------------------------------------------------------------------------- 1 | ../../test/fcgi -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/psgi-hot_deploy: -------------------------------------------------------------------------------- 1 | ../../test/psgi-hot_deploy -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run-modfcgid -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/run-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-pytest -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_basics.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_container_s2i.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_s2i.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.30-mod_fcgid/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /5.30/.exclude-fedora: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.30/.exclude-fedora -------------------------------------------------------------------------------- /5.30/content_sets.yml: -------------------------------------------------------------------------------- 1 | # This is a file defining which content sets are needed to update content in 2 | # this image. Data provided here helps determine which images are vulnerable to 3 | # specific CVEs. Generally you should only need to update this file when: 4 | # 1. You start depending on new product 5 | # 2. You are preparing new product release and your content sets will change 6 | --- 7 | x86_64: 8 | - rhel-7-server-rpms 9 | - rhel-7-server-optional-rpms 10 | - rhel-server-rhscl-7-rpms 11 | -------------------------------------------------------------------------------- /5.30/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule perl_module modules/mod_perl.so 2 | DirectoryIndex index.pl 3 | 4 | PerlSwitches -I./extlib/lib/perl5 5 | 6 | 7 | SetHandler perl-script 8 | PerlResponseHandler ModPerl::PerlRun 9 | Options +ExecCGI +SymLinksIfOwnerMatch 10 | PerlSendHeader On 11 | 12 | 13 | 14 | Require all granted 15 | 16 | 17 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf 18 | -------------------------------------------------------------------------------- /5.30/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | MinSpareServers ${HTTPD_START_SERVERS} 4 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 5 | # The MaxRequestWorkers directive sets the limit on the number of 6 | # simultaneous requests that will be served. 7 | # The default value, when no cgroup limits are set is 256. 8 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 9 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 10 | MaxConnectionsPerChild 4000 11 | MaxKeepAliveRequests 100 12 | -------------------------------------------------------------------------------- /5.30/root/opt/app-root/etc/httpdconf-fed.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ Installing application source ..." 7 | mv /tmp/src/* ./ 8 | 9 | # Fix source directory permissions 10 | fix-permissions ./ 11 | 12 | if [ -d ./cfg ]; then 13 | echo "---> Copying configuration files..." 14 | if [ "$(ls -A ./cfg/*.conf)" ]; then 15 | cp -av ./cfg/*.conf /opt/app-root/etc/httpd.d/ 16 | fi 17 | fi 18 | 19 | # Allow for http proxy to be specified in uppercase 20 | if [[ -n "${HTTP_PROXY:-}" && -z "${http_proxy:-}" ]]; then 21 | export http_proxy=$HTTP_PROXY 22 | fi 23 | 24 | export CPAN_MIRROR=${CPAN_MIRROR:-""} 25 | 26 | MIRROR_ARGS="" 27 | 28 | if [ -n "$CPAN_MIRROR" ]; then 29 | MIRROR_ARGS="--mirror $CPAN_MIRROR" 30 | fi 31 | 32 | # Change the npm registry mirror if provided 33 | if [ -n "$NPM_MIRROR" ]; then 34 | npm config set registry $NPM_MIRROR 35 | fi 36 | 37 | # Don't test installed Perl modules by default 38 | if [ "${ENABLE_CPAN_TEST}" = true ]; then 39 | export ENABLE_CPAN_TEST="" 40 | else 41 | export ENABLE_CPAN_TEST="--notest" 42 | fi 43 | 44 | # Configure mod_perl for PSGI. 45 | # If PSGI_FILE variable is set but empty, skip it. 46 | # If PSGI_FILE is set and non-empty, use it. 47 | # If PSGI_FILE does not exist, check if exactly one ./*.psgi file exists and 48 | # use that file. 49 | # If PSGI_URI_PATH variable has a value, use it as a location. Default is "/". 50 | if [ ! -v PSGI_FILE ]; then 51 | PSGI_FILE=$(find -maxdepth 1 -name '*.psgi' -type f) 52 | fi 53 | PSGI_FILE_NUMBER=$(printf '%s' "$PSGI_FILE" | wc -l) 54 | if [ -n "$PSGI_FILE" -a "$PSGI_FILE_NUMBER" -eq 0 ]; then 55 | echo "---> PSGI application found in $PSGI_FILE" 56 | cat >> cpanfile <<"EOF" 57 | requires 'Plack::Handler::Apache2'; 58 | EOF 59 | # XXX: Escape PSGI_FILE value against httpd control characters 60 | PSGI_FILE=$(printf '%s' "$PSGI_FILE" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') 61 | cat > /opt/app-root/etc/httpd.d/40-psgi.conf < 63 | SetHandler perl-script 64 | PerlResponseHandler Plack::Handler::Apache2 65 | PerlSetVar psgi_app "$PSGI_FILE" 66 | 67 | EOF 68 | elif [ "$PSGI_FILE_NUMBER" -gt 0 ]; then 69 | echo "---> Multiple PSGI applications found:" 70 | printf '%s' "$PSGI_FILE" 71 | echo "---> Skipping PSGI autoconfiguration!" 72 | fi 73 | 74 | # Installing dependencies with cpanfile 75 | if [ -f "cpanfile" ]; then 76 | echo "---> Installing modules from cpanfile ..." 77 | cpanm $MIRROR_ARGS $ENABLE_CPAN_TEST -l extlib Module::CoreList 78 | cpanm $MIRROR_ARGS $ENABLE_CPAN_TEST -l extlib --installdeps . 79 | else 80 | echo "---> No cpanfile found, nothing to install" 81 | fi 82 | 83 | # Fix source directory permissions 84 | fix-permissions ./ 85 | -------------------------------------------------------------------------------- /5.30/s2i/bin/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Warning: Please note that this will pass all environment variables available within the 6 | # container to mod_perl by means of PerlPassEnv in the env.conf file 7 | if [ ! -f /opt/app-root/etc/httpd.d/env.conf ]; then 8 | env | awk -F'=' '{print "PerlPassEnv "$1}' > /opt/app-root/etc/httpd.d/env.conf 9 | fi 10 | 11 | # Enable automatic reloading. This can be useful for debugging an application. 12 | PERL_APACHE2_RELOAD=${PERL_APACHE2_RELOAD:-} 13 | if [[ "${PERL_APACHE2_RELOAD,,}" == "true" ]]; then 14 | cat > /opt/app-root/etc/httpd.d/50-autoreload.conf < 0 ? MAX_SERVER_LIMIT : 1)) 32 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 33 | fi 34 | 35 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 36 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 37 | 38 | envsubst < /opt/app-root/etc/httpd.d/50-mpm.conf.template > /opt/app-root/etc/httpd.d/50-mpm.conf 39 | 40 | exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 41 | -------------------------------------------------------------------------------- /5.30/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=sclorg 5 | if [[ $DISTRO =~ rhel* ]]; then 6 | NAMESPACE=rhel8 7 | DISTRO="" 8 | else 9 | DISTRO="-c8s" 10 | fi 11 | 12 | cat < -- curl 127.0.0.1:8080 24 | EOF 25 | -------------------------------------------------------------------------------- /5.30/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.30/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.30/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.30/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples/ -------------------------------------------------------------------------------- /5.30/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams/ -------------------------------------------------------------------------------- /5.30/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.30/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.30/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run -------------------------------------------------------------------------------- /5.30/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.30/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.30/test/run-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-pytest -------------------------------------------------------------------------------- /5.30/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app/ -------------------------------------------------------------------------------- /5.30/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.30/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.30/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.30/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.30/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.30/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.30/test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_basics.py -------------------------------------------------------------------------------- /5.30/test/test_container_s2i.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_s2i.py -------------------------------------------------------------------------------- /5.30/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.30/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.30/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.30/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.30/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.30/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.30/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.30/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.30/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /5.32/.exclude-fedora: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.32/.exclude-fedora -------------------------------------------------------------------------------- /5.32/.exclude-rhel8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.32/.exclude-rhel8 -------------------------------------------------------------------------------- /5.32/Dockerfile.c9s: -------------------------------------------------------------------------------- 1 | FROM quay.io/sclorg/s2i-base-c9s:c9s 2 | 3 | # This image provides a Perl 5.32 environment you can use to run your Perl applications. 4 | 5 | EXPOSE 8080 6 | 7 | # Image metadata 8 | ENV PERL_VERSION=5.32 \ 9 | PERL_SHORT_VER=532 \ 10 | NAME=perl 11 | 12 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 13 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 14 | building and running various Perl $PERL_VERSION applications and frameworks. \ 15 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 16 | Perl is good at handling processes and files, and is especially good at handling text. \ 17 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 18 | different things, Perl's most common applications are system administration utilities \ 19 | and web programming." 20 | 21 | LABEL summary="$SUMMARY" \ 22 | description="$DESCRIPTION" \ 23 | io.k8s.description="$DESCRIPTION" \ 24 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 25 | io.openshift.expose-services="8080:http" \ 26 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}","${NAME}-${PERL_SHORT_VER}" \ 27 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 28 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 29 | name="sclorg/${NAME}-${PERL_SHORT_VER}-c9s" \ 30 | com.redhat.component="${NAME}-${PERL_SHORT_VER}-container" \ 31 | version="1" \ 32 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ 33 | maintainer="SoftwareCollections.org " \ 34 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 35 | usage="s2i build quay.io/sclorg/${NAME}-${PERL_SHORT_VER}:latest " 36 | 37 | # Deselect a default stream 38 | RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | yum -y --allowerasing distrosync && \ 40 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 41 | rpm -V $INSTALL_PKGS && \ 42 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 43 | yum -y clean all --enablerepo='*' 44 | 45 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 46 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 47 | 48 | # Copy extra files to the image. 49 | COPY ./root/ / 50 | 51 | # In order to drop the root user, we have to make some directories world 52 | # writeable as OpenShift default security model is to run the container under 53 | # random UID. 54 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 55 | sed -i -f ${APP_ROOT}/etc/httpdconf.sed /etc/httpd/conf/httpd.conf && \ 56 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 57 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 58 | rpm-file-permissions 59 | 60 | USER 1001 61 | 62 | # Set the default CMD to print the usage of the language image 63 | CMD $STI_SCRIPTS_PATH/usage 64 | -------------------------------------------------------------------------------- /5.32/Dockerfile.fedora: -------------------------------------------------------------------------------- 1 | FROM quay.io/fedora/s2i-base:34 2 | 3 | # This image provides a Perl 5.32 environment you can use to run your Perl applications. 4 | EXPOSE 8080 5 | 6 | # Image metadata 7 | ENV PERL_VERSION=5.32 \ 8 | PERL_SHORT_VER=532 \ 9 | VERSION=0 \ 10 | NAME=perl \ 11 | PATH=/opt/app-root/src/extlib/bin:$PATH \ 12 | PERL5LIB=/opt/app-root/src/extlib/lib/perl5 13 | 14 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 15 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 16 | building and running various Perl $PERL_VERSION applications and frameworks. \ 17 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 18 | Perl is good at handling processes and files, and is especially good at handling text. \ 19 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 20 | different things, Perl's most common applications are system administration utilities \ 21 | and web programming." 22 | 23 | LABEL summary="$SUMMARY" \ 24 | description="$DESCRIPTION" \ 25 | io.k8s.description="$DESCRIPTION" \ 26 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 27 | io.openshift.expose-services="8080:http" \ 28 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}" \ 29 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 30 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 31 | name="fedora/$NAME-$PERL_SHORT_VER" \ 32 | com.redhat.component="$NAME" \ 33 | version="$VERSION" \ 34 | maintainer="SoftwareCollections.org " \ 35 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 36 | usage="s2i build quay.io/fedora/fedora/$NAME-$PERL_SHORT_VER " 37 | 38 | RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | dnf -y module enable perl:$PERL_VERSION && \ 40 | dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 41 | rpm -V $INSTALL_PKGS && \ 42 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 43 | dnf -y clean all --enablerepo='*' 44 | 45 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 46 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 47 | 48 | # Copy extra files to the image. 49 | COPY ./root/ / 50 | 51 | # In order to drop the root user, we have to make some directories world 52 | # writeable as OpenShift default security model is to run the container under 53 | # random UID. 54 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 55 | sed -i -f ${APP_ROOT}/etc/httpdconf-fed.sed /etc/httpd/conf/httpd.conf && \ 56 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 57 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 58 | rpm-file-permissions 59 | 60 | USER 1001 61 | 62 | # Set the default CMD to print the usage of the language image 63 | CMD $STI_SCRIPTS_PATH/usage 64 | -------------------------------------------------------------------------------- /5.32/Dockerfile.rhel9: -------------------------------------------------------------------------------- 1 | FROM ubi9/s2i-base:1 2 | 3 | # This image provides a Perl 5.32 environment you can use to run your Perl applications. 4 | 5 | EXPOSE 8080 6 | 7 | # Image metadata 8 | ENV PERL_VERSION=5.32 \ 9 | PERL_SHORT_VER=532 \ 10 | NAME=perl 11 | 12 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 13 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 14 | building and running various Perl $PERL_VERSION applications and frameworks. \ 15 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 16 | Perl is good at handling processes and files, and is especially good at handling text. \ 17 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 18 | different things, Perl's most common applications are system administration utilities \ 19 | and web programming." 20 | 21 | LABEL summary="$SUMMARY" \ 22 | description="$DESCRIPTION" \ 23 | io.k8s.description="$DESCRIPTION" \ 24 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 25 | io.openshift.expose-services="8080:http" \ 26 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}","${NAME}-${PERL_SHORT_VER}" \ 27 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 28 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 29 | name="ubi9/${NAME}-${PERL_SHORT_VER}" \ 30 | com.redhat.component="${NAME}-${PERL_SHORT_VER}-container" \ 31 | version="1" \ 32 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ 33 | maintainer="SoftwareCollections.org " \ 34 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 35 | usage="s2i build ubi9/${NAME}-${PERL_SHORT_VER}:latest " 36 | 37 | # Deselect a default stream 38 | RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | yum -y --allowerasing distrosync && \ 40 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 41 | rpm -V $INSTALL_PKGS && \ 42 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 43 | yum -y clean all --enablerepo='*' 44 | 45 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 46 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 47 | 48 | # Copy extra files to the image. 49 | COPY ./root/ / 50 | 51 | # In order to drop the root user, we have to make some directories world 52 | # writeable as OpenShift default security model is to run the container under 53 | # random UID. 54 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 55 | sed -i -f ${APP_ROOT}/etc/httpdconf.sed /etc/httpd/conf/httpd.conf && \ 56 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 57 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 58 | rpm-file-permissions 59 | 60 | USER 1001 61 | 62 | # Set the default CMD to print the usage of the language image 63 | CMD $STI_SCRIPTS_PATH/usage 64 | -------------------------------------------------------------------------------- /5.32/root/opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch: -------------------------------------------------------------------------------- 1 | From d65d28410b91dfb3d9d12b6b8e49a79c7da54e1c Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= 3 | Date: Wed, 9 Jan 2019 12:33:59 +0100 4 | Subject: [PATCH] Work around mod_fcgid bogus SCRIPT_NAME/PATH_INFO 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | mod_fcgid sends wrong PATH_INFO to virtual FcgidWrapper and that 10 | prevents Plack from passing an application path to PSGI. 11 | 12 | This adds a side channel for passing application URI location to 13 | Plack's FCGI handler. 14 | 15 | https://bugzilla.redhat.com/show_bug.cgi?id=1651746 16 | 17 | 18 | 19 | 20 | Signed-off-by: Petr Písař 21 | --- 22 | lib/Plack/Handler/FCGI.pm | 11 +++++++++++ 23 | 1 file changed, 11 insertions(+) 24 | 25 | diff --git a/lib/Plack/Handler/FCGI.pm b/lib/Plack/Handler/FCGI.pm 26 | index 029051c..0c491b2 100644 27 | --- a/lib/Plack/Handler/FCGI.pm 28 | +++ b/lib/Plack/Handler/FCGI.pm 29 | @@ -124,6 +124,17 @@ sub run { 30 | delete $env->{HTTP_CONTENT_TYPE}; 31 | delete $env->{HTTP_CONTENT_LENGTH}; 32 | 33 | + # mod_fcgid provides wrong SCRIPT_NAME and PATH_INFO for virtual FCGI script handlers 34 | + # 35 | + # 36 | + # 37 | + if (exists $ENV{MODFCGID_VIRTUAL_LOCATION}) { 38 | + if ($ENV{MODFCGID_VIRTUAL_LOCATION} eq '/') { 39 | + $ENV{MODFCGID_VIRTUAL_LOCATION} = ''; 40 | + } 41 | + $env->{SCRIPT_NAME} = $ENV{MODFCGID_VIRTUAL_LOCATION}; 42 | + } 43 | + 44 | # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it 45 | my $uri = URI->new("http://localhost" . $env->{REQUEST_URI}); 46 | $env->{PATH_INFO} = uri_unescape($uri->path); 47 | -- 48 | 2.17.2 49 | 50 | -------------------------------------------------------------------------------- /5.32/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule env_module modules/mod_env.so 2 | 3 | 4 | LoadModule cgid_module modules/mod_cgid.so 5 | 6 | 7 | LoadModule cgid_module modules/mod_cgid.so 8 | 9 | 10 | LoadModule cgi_module modules/mod_cgi.so 11 | 12 | 13 | LoadModule unixd_module modules/mod_unixd.so 14 | LoadModule authn_core_module modules/mod_authn_core.so 15 | LoadModule authz_core_module modules/mod_authz_core.so 16 | LoadModule fcgid_module modules/mod_fcgid.so 17 | 18 | FcgidIPCDir /run/mod_fcgid 19 | FcgidProcessTableFile /run/mod_fcgid/fcgid_shm 20 | 21 | DirectoryIndex index.pl index.cgi index.fcg index.fcgi index.fpl 22 | 23 | 24 | SetHandler cgi-script 25 | Options +ExecCGI +SymLinksIfOwnerMatch 26 | 27 | 28 | 29 | SetHandler fcgid-script 30 | Options +ExecCGI +SymLinksIfOwnerMatch 31 | 32 | 33 | 34 | Require all granted 35 | 36 | 37 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf -------------------------------------------------------------------------------- /5.32/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | 4 | MinSpareServers ${HTTPD_START_SERVERS} 5 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 6 | 7 | # The MaxRequestWorkers directive sets the limit on the number of 8 | # simultaneous requests that will be served. 9 | # The default value, when no cgroup limits are set is 256. 10 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 11 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 12 | MaxConnectionsPerChild 4000 13 | MaxKeepAliveRequests 100 -------------------------------------------------------------------------------- /5.32/root/opt/app-root/etc/httpdconf-fed.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ /opt/app-root/etc/httpd.d/env.conf 16 | fi 17 | 18 | export_vars=$(cgroup-limits) ; export $export_vars 19 | 20 | # Validate server limit option 21 | if [[ ! "${HTTPD_MAX_REQUEST_WORKERS:-1}" =~ ^[1-9][0-9]*$ || "${HTTPD_MAX_REQUEST_WORKERS:-1}" -gt 20000 ]]; then 22 | echo "HTTPD_MAX_REQUEST_WORKERS needs be an integer between 1 and 20000" 23 | exit 1 24 | fi 25 | 26 | # If there is no server limit specified, try to guess the best value 27 | if [ -z "${HTTPD_MAX_REQUEST_WORKERS:-}" ]; then 28 | MAX_SERVER_LIMIT=$(((MEMORY_LIMIT_IN_BYTES/1024/1024 - 30) / 7)) 29 | MAX_SERVER_LIMIT=$((MAX_SERVER_LIMIT > 0 ? MAX_SERVER_LIMIT : 1)) 30 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 31 | fi 32 | 33 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 34 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 35 | 36 | envsubst < /opt/app-root/etc/httpd.d/50-mpm.conf.template > /opt/app-root/etc/httpd.d/50-mpm.conf 37 | 38 | if [ -f ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template ]; then 39 | PLACKUP_ARGS="" 40 | if [ -n "$PSGI_RELOAD" ]; then 41 | PLACKUP_ARGS="-r -R ${APP_ROOT}/src/" 42 | fi 43 | 44 | export PLACKUP_ARGS=${PLACKUP_ARGS} 45 | 46 | envsubst < ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template > ${APP_ROOT}/etc/httpd.d/40-psgi.conf 47 | fi 48 | 49 | exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 50 | -------------------------------------------------------------------------------- /5.32/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=sclorg 5 | if [[ $DISTRO =~ rhel* ]]; then 6 | NAMESPACE=rhel9 7 | DISTRO="" 8 | else 9 | DISTRO="-c9s" 10 | fi 11 | 12 | cat < -- curl 127.0.0.1:8080 24 | EOF 25 | -------------------------------------------------------------------------------- /5.32/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.32/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.32/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.32/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples/ -------------------------------------------------------------------------------- /5.32/test/fcgi: -------------------------------------------------------------------------------- 1 | ../../test/fcgi -------------------------------------------------------------------------------- /5.32/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams/ -------------------------------------------------------------------------------- /5.32/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.32/test/psgi-hot_deploy: -------------------------------------------------------------------------------- 1 | ../../test/psgi-hot_deploy -------------------------------------------------------------------------------- /5.32/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.32/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run-modfcgid -------------------------------------------------------------------------------- /5.32/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.32/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.32/test/run-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-pytest -------------------------------------------------------------------------------- /5.32/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app/ -------------------------------------------------------------------------------- /5.32/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.32/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.32/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.32/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.32/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.32/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.32/test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_basics.py -------------------------------------------------------------------------------- /5.32/test/test_container_s2i.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_s2i.py -------------------------------------------------------------------------------- /5.32/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.32/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.32/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.32/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.32/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.32/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.32/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.32/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.32/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /5.34/.exclude-c9s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.34/.exclude-c9s -------------------------------------------------------------------------------- /5.34/.exclude-fedora: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.34/.exclude-fedora -------------------------------------------------------------------------------- /5.34/Dockerfile.c9s: -------------------------------------------------------------------------------- 1 | FROM quay.io/sclorg/s2i-base-c9s:c9s 2 | 3 | # This image provides a Perl 5.34 environment you can use to run your Perl applications. 4 | 5 | EXPOSE 8080 6 | 7 | # Image metadata 8 | ENV PERL_VERSION=5.34 \ 9 | PERL_SHORT_VER=534 \ 10 | NAME=perl 11 | 12 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 13 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 14 | building and running various Perl $PERL_VERSION applications and frameworks. \ 15 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 16 | Perl is good at handling processes and files, and is especially good at handling text. \ 17 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 18 | different things, Perl's most common applications are system administration utilities \ 19 | and web programming." 20 | 21 | LABEL summary="$SUMMARY" \ 22 | description="$DESCRIPTION" \ 23 | io.k8s.description="$DESCRIPTION" \ 24 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 25 | io.openshift.expose-services="8080:http" \ 26 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}","${NAME}-${PERL_SHORT_VER}" \ 27 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 28 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 29 | name="sclorg/${NAME}-${PERL_SHORT_VER}-c9s" \ 30 | com.redhat.component="${NAME}-${PERL_SHORT_VER}-container" \ 31 | version="1" \ 32 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ 33 | maintainer="SoftwareCollections.org " \ 34 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 35 | usage="s2i build quay.io/sclorg/${NAME}-${PERL_SHORT_VER}:latest " 36 | 37 | # Deselect a default stream 38 | RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | yum -y --allowerasing distrosync && \ 40 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 41 | rpm -V $INSTALL_PKGS && \ 42 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 43 | yum -y clean all --enablerepo='*' 44 | 45 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 46 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 47 | 48 | # Copy extra files to the image. 49 | COPY ./root/ / 50 | 51 | # In order to drop the root user, we have to make some directories world 52 | # writeable as OpenShift default security model is to run the container under 53 | # random UID. 54 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 55 | sed -i -f ${APP_ROOT}/etc/httpdconf.sed /etc/httpd/conf/httpd.conf && \ 56 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 57 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 58 | rpm-file-permissions 59 | 60 | USER 1001 61 | 62 | # Set the default CMD to print the usage of the language image 63 | CMD $STI_SCRIPTS_PATH/usage 64 | -------------------------------------------------------------------------------- /5.34/Dockerfile.fedora: -------------------------------------------------------------------------------- 1 | FROM quay.io/fedora/s2i-base:36 2 | 3 | # This image provides a Perl 5.34 environment you can use to run your Perl applications. 4 | EXPOSE 8080 5 | 6 | # Image metadata 7 | ENV PERL_VERSION=5.34 \ 8 | PERL_SHORT_VER=534 \ 9 | VERSION=0 \ 10 | NAME=perl \ 11 | PATH=${APP_ROOT}/src/extlib/bin:$PATH \ 12 | PERL5LIB=${APP_ROOT}/src/extlib/lib/perl5 13 | 14 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 15 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 16 | building and running various Perl $PERL_VERSION applications and frameworks. \ 17 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 18 | Perl is good at handling processes and files, and is especially good at handling text. \ 19 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 20 | different things, Perl's most common applications are system administration utilities \ 21 | and web programming." 22 | 23 | LABEL summary="$SUMMARY" \ 24 | description="$DESCRIPTION" \ 25 | io.k8s.description="$DESCRIPTION" \ 26 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 27 | io.openshift.expose-services="8080:http" \ 28 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}" \ 29 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 30 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 31 | name="fedora/$NAME-$PERL_SHORT_VER" \ 32 | com.redhat.component="$NAME" \ 33 | version="$VERSION" \ 34 | maintainer="SoftwareCollections.org " \ 35 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 36 | usage="s2i build quay.io/fedora/fedora/$NAME-$PERL_SHORT_VER " 37 | 38 | RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | dnf -y module enable perl:$PERL_VERSION && \ 40 | dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 41 | rpm -V $INSTALL_PKGS && \ 42 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 43 | dnf -y clean all --enablerepo='*' 44 | 45 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 46 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 47 | 48 | # Copy extra files to the image. 49 | COPY ./root/ / 50 | 51 | # In order to drop the root user, we have to make some directories world 52 | # writeable as OpenShift default security model is to run the container under 53 | # random UID. 54 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 55 | sed -i -f ${APP_ROOT}/etc/httpdconf-fed.sed /etc/httpd/conf/httpd.conf && \ 56 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 57 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 58 | rpm-file-permissions 59 | 60 | USER 1001 61 | 62 | # Set the default CMD to print the usage of the language image 63 | CMD $STI_SCRIPTS_PATH/usage 64 | -------------------------------------------------------------------------------- /5.34/root/opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch: -------------------------------------------------------------------------------- 1 | From d65d28410b91dfb3d9d12b6b8e49a79c7da54e1c Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= 3 | Date: Wed, 9 Jan 2019 12:33:59 +0100 4 | Subject: [PATCH] Work around mod_fcgid bogus SCRIPT_NAME/PATH_INFO 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | mod_fcgid sends wrong PATH_INFO to virtual FcgidWrapper and that 10 | prevents Plack from passing an application path to PSGI. 11 | 12 | This adds a side channel for passing application URI location to 13 | Plack's FCGI handler. 14 | 15 | https://bugzilla.redhat.com/show_bug.cgi?id=1651746 16 | 17 | 18 | 19 | 20 | Signed-off-by: Petr Písař 21 | --- 22 | lib/Plack/Handler/FCGI.pm | 11 +++++++++++ 23 | 1 file changed, 11 insertions(+) 24 | 25 | diff --git a/lib/Plack/Handler/FCGI.pm b/lib/Plack/Handler/FCGI.pm 26 | index 029051c..0c491b2 100644 27 | --- a/lib/Plack/Handler/FCGI.pm 28 | +++ b/lib/Plack/Handler/FCGI.pm 29 | @@ -124,6 +124,17 @@ sub run { 30 | delete $env->{HTTP_CONTENT_TYPE}; 31 | delete $env->{HTTP_CONTENT_LENGTH}; 32 | 33 | + # mod_fcgid provides wrong SCRIPT_NAME and PATH_INFO for virtual FCGI script handlers 34 | + # 35 | + # 36 | + # 37 | + if (exists $ENV{MODFCGID_VIRTUAL_LOCATION}) { 38 | + if ($ENV{MODFCGID_VIRTUAL_LOCATION} eq '/') { 39 | + $ENV{MODFCGID_VIRTUAL_LOCATION} = ''; 40 | + } 41 | + $env->{SCRIPT_NAME} = $ENV{MODFCGID_VIRTUAL_LOCATION}; 42 | + } 43 | + 44 | # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it 45 | my $uri = URI->new("http://localhost" . $env->{REQUEST_URI}); 46 | $env->{PATH_INFO} = uri_unescape($uri->path); 47 | -- 48 | 2.17.2 49 | 50 | -------------------------------------------------------------------------------- /5.34/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule env_module modules/mod_env.so 2 | 3 | 4 | LoadModule cgid_module modules/mod_cgid.so 5 | 6 | 7 | LoadModule cgid_module modules/mod_cgid.so 8 | 9 | 10 | LoadModule cgi_module modules/mod_cgi.so 11 | 12 | 13 | LoadModule unixd_module modules/mod_unixd.so 14 | LoadModule authn_core_module modules/mod_authn_core.so 15 | LoadModule authz_core_module modules/mod_authz_core.so 16 | LoadModule fcgid_module modules/mod_fcgid.so 17 | 18 | FcgidIPCDir /run/mod_fcgid 19 | FcgidProcessTableFile /run/mod_fcgid/fcgid_shm 20 | 21 | DirectoryIndex index.pl index.cgi index.fcg index.fcgi index.fpl 22 | 23 | 24 | SetHandler cgi-script 25 | Options +ExecCGI +SymLinksIfOwnerMatch 26 | 27 | 28 | 29 | SetHandler fcgid-script 30 | Options +ExecCGI +SymLinksIfOwnerMatch 31 | 32 | 33 | 34 | Require all granted 35 | 36 | 37 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf -------------------------------------------------------------------------------- /5.34/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | 4 | MinSpareServers ${HTTPD_START_SERVERS} 5 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 6 | 7 | # The MaxRequestWorkers directive sets the limit on the number of 8 | # simultaneous requests that will be served. 9 | # The default value, when no cgroup limits are set is 256. 10 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 11 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 12 | MaxConnectionsPerChild 4000 13 | MaxKeepAliveRequests 100 -------------------------------------------------------------------------------- /5.34/root/opt/app-root/etc/httpdconf-fed.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ ${APP_ROOT}/etc/httpd.d/env.conf 16 | fi 17 | 18 | export_vars=$(cgroup-limits) ; export $export_vars 19 | 20 | # Validate server limit option 21 | if [[ ! "${HTTPD_MAX_REQUEST_WORKERS:-1}" =~ ^[1-9][0-9]*$ || "${HTTPD_MAX_REQUEST_WORKERS:-1}" -gt 20000 ]]; then 22 | echo "HTTPD_MAX_REQUEST_WORKERS needs be an integer between 1 and 20000" 23 | exit 1 24 | fi 25 | 26 | # If there is no server limit specified, try to guess the best value 27 | if [ -z "${HTTPD_MAX_REQUEST_WORKERS:-}" ]; then 28 | MAX_SERVER_LIMIT=$(((MEMORY_LIMIT_IN_BYTES/1024/1024 - 30) / 7)) 29 | MAX_SERVER_LIMIT=$((MAX_SERVER_LIMIT > 0 ? MAX_SERVER_LIMIT : 1)) 30 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 31 | fi 32 | 33 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 34 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 35 | 36 | envsubst < ${APP_ROOT}/etc/httpd.d/50-mpm.conf.template > ${APP_ROOT}/etc/httpd.d/50-mpm.conf 37 | 38 | if [ -f ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template ]; then 39 | PLACKUP_ARGS="" 40 | if [ -n "$PSGI_RELOAD" ]; then 41 | PLACKUP_ARGS="-r -R ${APP_ROOT}/src/" 42 | fi 43 | 44 | export PLACKUP_ARGS=${PLACKUP_ARGS} 45 | 46 | envsubst < ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template > ${APP_ROOT}/etc/httpd.d/40-psgi.conf 47 | fi 48 | 49 | exec httpd -C 'Include ${APP_ROOT}/etc/httpd.conf' -D FOREGROUND 50 | -------------------------------------------------------------------------------- /5.34/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=sclorg 5 | if [[ $DISTRO =~ rhel* ]]; then 6 | NAMESPACE=rhel9 7 | DISTRO="" 8 | else 9 | DISTRO="-c9s" 10 | fi 11 | 12 | cat < -- curl 127.0.0.1:8080 24 | EOF 25 | -------------------------------------------------------------------------------- /5.34/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.34/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.34/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.34/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples/ -------------------------------------------------------------------------------- /5.34/test/fcgi: -------------------------------------------------------------------------------- 1 | ../../test/fcgi -------------------------------------------------------------------------------- /5.34/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams/ -------------------------------------------------------------------------------- /5.34/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.34/test/psgi-hot_deploy: -------------------------------------------------------------------------------- 1 | ../../test/psgi-hot_deploy -------------------------------------------------------------------------------- /5.34/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.34/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run-modfcgid -------------------------------------------------------------------------------- /5.34/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.34/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.34/test/run-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-pytest -------------------------------------------------------------------------------- /5.34/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app/ -------------------------------------------------------------------------------- /5.34/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.34/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.34/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.34/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.34/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.34/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.34/test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_basics.py -------------------------------------------------------------------------------- /5.34/test/test_container_s2i.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_s2i.py -------------------------------------------------------------------------------- /5.34/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.34/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.34/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.34/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.34/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.34/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.34/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.34/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.34/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /5.36/.exclude-c9s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.36/.exclude-c9s -------------------------------------------------------------------------------- /5.36/Dockerfile.fedora: -------------------------------------------------------------------------------- 1 | FROM quay.io/fedora/s2i-base:38 2 | 3 | # This image provides a Perl 5.36 environment you can use to run your Perl applications. 4 | EXPOSE 8080 5 | 6 | # Image metadata 7 | ENV PERL_VERSION=5.36 \ 8 | PERL_SHORT_VER=536 \ 9 | VERSION=0 \ 10 | NAME=perl \ 11 | PATH=/opt/app-root/src/extlib/bin:$PATH \ 12 | PERL5LIB=/opt/app-root/src/extlib/lib/perl5 13 | 14 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 15 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 16 | building and running various Perl $PERL_VERSION applications and frameworks. \ 17 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 18 | Perl is good at handling processes and files, and is especially good at handling text. \ 19 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 20 | different things, Perl's most common applications are system administration utilities \ 21 | and web programming." 22 | 23 | LABEL summary="$SUMMARY" \ 24 | description="$DESCRIPTION" \ 25 | io.k8s.description="$DESCRIPTION" \ 26 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 27 | io.openshift.expose-services="8080:http" \ 28 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}" \ 29 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 30 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 31 | name="fedora/$NAME-$PERL_SHORT_VER" \ 32 | com.redhat.component="$NAME" \ 33 | version="$VERSION" \ 34 | maintainer="SoftwareCollections.org " \ 35 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 36 | usage="s2i build quay.io/fedora/fedora/$NAME-$PERL_SHORT_VER " 37 | 38 | RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | dnf -y module enable perl:$PERL_VERSION && \ 40 | dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 41 | rpm -V $INSTALL_PKGS && \ 42 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 43 | dnf -y clean all --enablerepo='*' 44 | 45 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 46 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 47 | 48 | # Copy extra files to the image. 49 | COPY ./root/ / 50 | 51 | # In order to drop the root user, we have to make some directories world 52 | # writeable as OpenShift default security model is to run the container under 53 | # random UID. 54 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 55 | sed -i -f ${APP_ROOT}/etc/httpdconf-fed.sed /etc/httpd/conf/httpd.conf && \ 56 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 57 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 58 | rpm-file-permissions 59 | 60 | USER 1001 61 | 62 | # Set the default CMD to print the usage of the language image 63 | CMD $STI_SCRIPTS_PATH/usage 64 | -------------------------------------------------------------------------------- /5.36/root/opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch: -------------------------------------------------------------------------------- 1 | From d65d28410b91dfb3d9d12b6b8e49a79c7da54e1c Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= 3 | Date: Wed, 9 Jan 2019 12:33:59 +0100 4 | Subject: [PATCH] Work around mod_fcgid bogus SCRIPT_NAME/PATH_INFO 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | mod_fcgid sends wrong PATH_INFO to virtual FcgidWrapper and that 10 | prevents Plack from passing an application path to PSGI. 11 | 12 | This adds a side channel for passing application URI location to 13 | Plack's FCGI handler. 14 | 15 | https://bugzilla.redhat.com/show_bug.cgi?id=1651746 16 | 17 | 18 | 19 | 20 | Signed-off-by: Petr Písař 21 | --- 22 | lib/Plack/Handler/FCGI.pm | 11 +++++++++++ 23 | 1 file changed, 11 insertions(+) 24 | 25 | diff --git a/lib/Plack/Handler/FCGI.pm b/lib/Plack/Handler/FCGI.pm 26 | index 029051c..0c491b2 100644 27 | --- a/lib/Plack/Handler/FCGI.pm 28 | +++ b/lib/Plack/Handler/FCGI.pm 29 | @@ -124,6 +124,17 @@ sub run { 30 | delete $env->{HTTP_CONTENT_TYPE}; 31 | delete $env->{HTTP_CONTENT_LENGTH}; 32 | 33 | + # mod_fcgid provides wrong SCRIPT_NAME and PATH_INFO for virtual FCGI script handlers 34 | + # 35 | + # 36 | + # 37 | + if (exists $ENV{MODFCGID_VIRTUAL_LOCATION}) { 38 | + if ($ENV{MODFCGID_VIRTUAL_LOCATION} eq '/') { 39 | + $ENV{MODFCGID_VIRTUAL_LOCATION} = ''; 40 | + } 41 | + $env->{SCRIPT_NAME} = $ENV{MODFCGID_VIRTUAL_LOCATION}; 42 | + } 43 | + 44 | # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it 45 | my $uri = URI->new("http://localhost" . $env->{REQUEST_URI}); 46 | $env->{PATH_INFO} = uri_unescape($uri->path); 47 | -- 48 | 2.17.2 49 | 50 | -------------------------------------------------------------------------------- /5.36/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule env_module modules/mod_env.so 2 | 3 | 4 | LoadModule cgid_module modules/mod_cgid.so 5 | 6 | 7 | LoadModule cgid_module modules/mod_cgid.so 8 | 9 | 10 | LoadModule cgi_module modules/mod_cgi.so 11 | 12 | 13 | LoadModule unixd_module modules/mod_unixd.so 14 | LoadModule authn_core_module modules/mod_authn_core.so 15 | LoadModule authz_core_module modules/mod_authz_core.so 16 | LoadModule fcgid_module modules/mod_fcgid.so 17 | 18 | FcgidIPCDir /run/mod_fcgid 19 | FcgidProcessTableFile /run/mod_fcgid/fcgid_shm 20 | 21 | DirectoryIndex index.pl index.cgi index.fcg index.fcgi index.fpl 22 | 23 | 24 | SetHandler cgi-script 25 | Options +ExecCGI +SymLinksIfOwnerMatch 26 | 27 | 28 | 29 | SetHandler fcgid-script 30 | Options +ExecCGI +SymLinksIfOwnerMatch 31 | 32 | 33 | 34 | Require all granted 35 | 36 | 37 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf -------------------------------------------------------------------------------- /5.36/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | 4 | MinSpareServers ${HTTPD_START_SERVERS} 5 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 6 | 7 | # The MaxRequestWorkers directive sets the limit on the number of 8 | # simultaneous requests that will be served. 9 | # The default value, when no cgroup limits are set is 256. 10 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 11 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 12 | MaxConnectionsPerChild 4000 13 | MaxKeepAliveRequests 100 -------------------------------------------------------------------------------- /5.36/root/opt/app-root/etc/httpdconf-fed.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ /opt/app-root/etc/httpd.d/env.conf 16 | fi 17 | 18 | export_vars=$(cgroup-limits) ; export $export_vars 19 | 20 | # Validate server limit option 21 | if [[ ! "${HTTPD_MAX_REQUEST_WORKERS:-1}" =~ ^[1-9][0-9]*$ || "${HTTPD_MAX_REQUEST_WORKERS:-1}" -gt 20000 ]]; then 22 | echo "HTTPD_MAX_REQUEST_WORKERS needs be an integer between 1 and 20000" 23 | exit 1 24 | fi 25 | 26 | # If there is no server limit specified, try to guess the best value 27 | if [ -z "${HTTPD_MAX_REQUEST_WORKERS:-}" ]; then 28 | MAX_SERVER_LIMIT=$(((MEMORY_LIMIT_IN_BYTES/1024/1024 - 30) / 7)) 29 | MAX_SERVER_LIMIT=$((MAX_SERVER_LIMIT > 0 ? MAX_SERVER_LIMIT : 1)) 30 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 31 | fi 32 | 33 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 34 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 35 | 36 | envsubst < /opt/app-root/etc/httpd.d/50-mpm.conf.template > /opt/app-root/etc/httpd.d/50-mpm.conf 37 | 38 | if [ -f ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template ]; then 39 | PLACKUP_ARGS="" 40 | if [ -n "$PSGI_RELOAD" ]; then 41 | PLACKUP_ARGS="-r -R ${APP_ROOT}/src/" 42 | fi 43 | 44 | export PLACKUP_ARGS=${PLACKUP_ARGS} 45 | 46 | envsubst < ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template > ${APP_ROOT}/etc/httpd.d/40-psgi.conf 47 | fi 48 | 49 | exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 50 | -------------------------------------------------------------------------------- /5.36/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=sclorg 5 | if [[ $DISTRO =~ rhel* ]]; then 6 | NAMESPACE=rhel9 7 | DISTRO="" 8 | else 9 | DISTRO="-c9s" 10 | fi 11 | 12 | cat < -- curl 127.0.0.1:8080 24 | EOF 25 | -------------------------------------------------------------------------------- /5.36/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.36/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.36/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.36/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples/ -------------------------------------------------------------------------------- /5.36/test/fcgi: -------------------------------------------------------------------------------- 1 | ../../test/fcgi -------------------------------------------------------------------------------- /5.36/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams/ -------------------------------------------------------------------------------- /5.36/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.36/test/psgi-hot_deploy: -------------------------------------------------------------------------------- 1 | ../../test/psgi-hot_deploy -------------------------------------------------------------------------------- /5.36/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.36/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run-modfcgid -------------------------------------------------------------------------------- /5.36/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.36/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.36/test/run-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-pytest -------------------------------------------------------------------------------- /5.36/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app/ -------------------------------------------------------------------------------- /5.36/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.36/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.36/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.36/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.36/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.36/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.36/test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_basics.py -------------------------------------------------------------------------------- /5.36/test/test_container_s2i.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_s2i.py -------------------------------------------------------------------------------- /5.36/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.36/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.36/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.36/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.36/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.36/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.36/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.36/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.36/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /5.38/.exclude-c9s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.38/.exclude-c9s -------------------------------------------------------------------------------- /5.38/Dockerfile.fedora: -------------------------------------------------------------------------------- 1 | FROM quay.io/fedora/s2i-base:39 2 | 3 | # This image provides a Perl 5.38 environment you can use to run your Perl applications. 4 | EXPOSE 8080 5 | 6 | # Image metadata 7 | ENV PERL_VERSION=5.38 \ 8 | PERL_SHORT_VER=538 \ 9 | VERSION=0 \ 10 | NAME=perl \ 11 | PATH=/opt/app-root/src/extlib/bin:$PATH \ 12 | PERL5LIB=/opt/app-root/src/extlib/lib/perl5 13 | 14 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 15 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 16 | building and running various Perl $PERL_VERSION applications and frameworks. \ 17 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 18 | Perl is good at handling processes and files, and is especially good at handling text. \ 19 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 20 | different things, Perl's most common applications are system administration utilities \ 21 | and web programming." 22 | 23 | LABEL summary="$SUMMARY" \ 24 | description="$DESCRIPTION" \ 25 | io.k8s.description="$DESCRIPTION" \ 26 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 27 | io.openshift.expose-services="8080:http" \ 28 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}" \ 29 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 30 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 31 | name="fedora/$NAME-$PERL_SHORT_VER" \ 32 | com.redhat.component="$NAME" \ 33 | version="$VERSION" \ 34 | maintainer="SoftwareCollections.org " \ 35 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 36 | usage="s2i build quay.io/fedora/fedora/$NAME-$PERL_SHORT_VER " 37 | 38 | RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 40 | rpm -V $INSTALL_PKGS && \ 41 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 42 | dnf -y clean all --enablerepo='*' 43 | 44 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 45 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 46 | 47 | # Copy extra files to the image. 48 | COPY ./root/ / 49 | 50 | # In order to drop the root user, we have to make some directories world 51 | # writeable as OpenShift default security model is to run the container under 52 | # random UID. 53 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 54 | sed -i -f ${APP_ROOT}/etc/httpdconf-fed.sed /etc/httpd/conf/httpd.conf && \ 55 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 56 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 57 | rpm-file-permissions 58 | 59 | USER 1001 60 | 61 | # Set the default CMD to print the usage of the language image 62 | CMD $STI_SCRIPTS_PATH/usage 63 | -------------------------------------------------------------------------------- /5.38/root/opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch: -------------------------------------------------------------------------------- 1 | From d65d28410b91dfb3d9d12b6b8e49a79c7da54e1c Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= 3 | Date: Wed, 9 Jan 2019 12:33:59 +0100 4 | Subject: [PATCH] Work around mod_fcgid bogus SCRIPT_NAME/PATH_INFO 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | mod_fcgid sends wrong PATH_INFO to virtual FcgidWrapper and that 10 | prevents Plack from passing an application path to PSGI. 11 | 12 | This adds a side channel for passing application URI location to 13 | Plack's FCGI handler. 14 | 15 | https://bugzilla.redhat.com/show_bug.cgi?id=1651746 16 | 17 | 18 | 19 | 20 | Signed-off-by: Petr Písař 21 | --- 22 | lib/Plack/Handler/FCGI.pm | 11 +++++++++++ 23 | 1 file changed, 11 insertions(+) 24 | 25 | diff --git a/lib/Plack/Handler/FCGI.pm b/lib/Plack/Handler/FCGI.pm 26 | index 029051c..0c491b2 100644 27 | --- a/lib/Plack/Handler/FCGI.pm 28 | +++ b/lib/Plack/Handler/FCGI.pm 29 | @@ -124,6 +124,17 @@ sub run { 30 | delete $env->{HTTP_CONTENT_TYPE}; 31 | delete $env->{HTTP_CONTENT_LENGTH}; 32 | 33 | + # mod_fcgid provides wrong SCRIPT_NAME and PATH_INFO for virtual FCGI script handlers 34 | + # 35 | + # 36 | + # 37 | + if (exists $ENV{MODFCGID_VIRTUAL_LOCATION}) { 38 | + if ($ENV{MODFCGID_VIRTUAL_LOCATION} eq '/') { 39 | + $ENV{MODFCGID_VIRTUAL_LOCATION} = ''; 40 | + } 41 | + $env->{SCRIPT_NAME} = $ENV{MODFCGID_VIRTUAL_LOCATION}; 42 | + } 43 | + 44 | # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it 45 | my $uri = URI->new("http://localhost" . $env->{REQUEST_URI}); 46 | $env->{PATH_INFO} = uri_unescape($uri->path); 47 | -- 48 | 2.17.2 49 | 50 | -------------------------------------------------------------------------------- /5.38/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule env_module modules/mod_env.so 2 | 3 | 4 | LoadModule cgid_module modules/mod_cgid.so 5 | 6 | 7 | LoadModule cgid_module modules/mod_cgid.so 8 | 9 | 10 | LoadModule cgi_module modules/mod_cgi.so 11 | 12 | 13 | LoadModule unixd_module modules/mod_unixd.so 14 | LoadModule authn_core_module modules/mod_authn_core.so 15 | LoadModule authz_core_module modules/mod_authz_core.so 16 | LoadModule fcgid_module modules/mod_fcgid.so 17 | 18 | FcgidIPCDir /run/mod_fcgid 19 | FcgidProcessTableFile /run/mod_fcgid/fcgid_shm 20 | 21 | DirectoryIndex index.pl index.cgi index.fcg index.fcgi index.fpl 22 | 23 | 24 | SetHandler cgi-script 25 | Options +ExecCGI +SymLinksIfOwnerMatch 26 | 27 | 28 | 29 | SetHandler fcgid-script 30 | Options +ExecCGI +SymLinksIfOwnerMatch 31 | 32 | 33 | 34 | Require all granted 35 | 36 | 37 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf -------------------------------------------------------------------------------- /5.38/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | 4 | MinSpareServers ${HTTPD_START_SERVERS} 5 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 6 | 7 | # The MaxRequestWorkers directive sets the limit on the number of 8 | # simultaneous requests that will be served. 9 | # The default value, when no cgroup limits are set is 256. 10 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 11 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 12 | MaxConnectionsPerChild 4000 13 | MaxKeepAliveRequests 100 -------------------------------------------------------------------------------- /5.38/root/opt/app-root/etc/httpdconf-fed.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ /opt/app-root/etc/httpd.d/env.conf 16 | fi 17 | 18 | export_vars=$(cgroup-limits) ; export $export_vars 19 | 20 | # Validate server limit option 21 | if [[ ! "${HTTPD_MAX_REQUEST_WORKERS:-1}" =~ ^[1-9][0-9]*$ || "${HTTPD_MAX_REQUEST_WORKERS:-1}" -gt 20000 ]]; then 22 | echo "HTTPD_MAX_REQUEST_WORKERS needs be an integer between 1 and 20000" 23 | exit 1 24 | fi 25 | 26 | # If there is no server limit specified, try to guess the best value 27 | if [ -z "${HTTPD_MAX_REQUEST_WORKERS:-}" ]; then 28 | MAX_SERVER_LIMIT=$(((MEMORY_LIMIT_IN_BYTES/1024/1024 - 30) / 7)) 29 | MAX_SERVER_LIMIT=$((MAX_SERVER_LIMIT > 0 ? MAX_SERVER_LIMIT : 1)) 30 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 31 | fi 32 | 33 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 34 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 35 | 36 | envsubst < /opt/app-root/etc/httpd.d/50-mpm.conf.template > /opt/app-root/etc/httpd.d/50-mpm.conf 37 | 38 | if [ -f ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template ]; then 39 | PLACKUP_ARGS="" 40 | if [ -n "$PSGI_RELOAD" ]; then 41 | PLACKUP_ARGS="-r -R ${APP_ROOT}/src/" 42 | fi 43 | 44 | export PLACKUP_ARGS=${PLACKUP_ARGS} 45 | 46 | envsubst < ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template > ${APP_ROOT}/etc/httpd.d/40-psgi.conf 47 | fi 48 | 49 | exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 50 | -------------------------------------------------------------------------------- /5.38/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=sclorg 5 | if [[ $DISTRO =~ rhel* ]]; then 6 | NAMESPACE=rhel9 7 | DISTRO="" 8 | else 9 | DISTRO="-c9s" 10 | fi 11 | 12 | cat < -- curl 127.0.0.1:8080 24 | EOF 25 | -------------------------------------------------------------------------------- /5.38/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.38/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.38/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.38/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples/ -------------------------------------------------------------------------------- /5.38/test/fcgi: -------------------------------------------------------------------------------- 1 | ../../test/fcgi -------------------------------------------------------------------------------- /5.38/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams/ -------------------------------------------------------------------------------- /5.38/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.38/test/psgi-hot_deploy: -------------------------------------------------------------------------------- 1 | ../../test/psgi-hot_deploy -------------------------------------------------------------------------------- /5.38/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.38/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run-modfcgid -------------------------------------------------------------------------------- /5.38/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.38/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.38/test/run-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-pytest -------------------------------------------------------------------------------- /5.38/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app -------------------------------------------------------------------------------- /5.38/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.38/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.38/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.38/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.38/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.38/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.38/test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_basics.py -------------------------------------------------------------------------------- /5.38/test/test_container_s2i.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_s2i.py -------------------------------------------------------------------------------- /5.38/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.38/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.38/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.38/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.38/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.38/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.38/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.38/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.38/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /5.40/.exclude-c9s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/5.40/.exclude-c9s -------------------------------------------------------------------------------- /5.40/Dockerfile.fedora: -------------------------------------------------------------------------------- 1 | FROM quay.io/fedora/s2i-base:41 2 | 3 | # This image provides a Perl 5.40 environment you can use to run your Perl applications. 4 | EXPOSE 8080 5 | 6 | # Image metadata 7 | ENV PERL_VERSION=5.40 \ 8 | PERL_SHORT_VER=540 \ 9 | VERSION=0 \ 10 | NAME=perl \ 11 | PATH=/opt/app-root/src/extlib/bin:$PATH \ 12 | PERL5LIB=/opt/app-root/src/extlib/lib/perl5 13 | 14 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 15 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 16 | building and running various Perl $PERL_VERSION applications and frameworks. \ 17 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 18 | Perl is good at handling processes and files, and is especially good at handling text. \ 19 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 20 | different things, Perl's most common applications are system administration utilities \ 21 | and web programming." 22 | 23 | LABEL summary="$SUMMARY" \ 24 | description="$DESCRIPTION" \ 25 | io.k8s.description="$DESCRIPTION" \ 26 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 27 | io.openshift.expose-services="8080:http" \ 28 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}" \ 29 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 30 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 31 | name="fedora/$NAME-$PERL_SHORT_VER" \ 32 | com.redhat.component="$NAME" \ 33 | version="$VERSION" \ 34 | maintainer="SoftwareCollections.org " \ 35 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 36 | usage="s2i build quay.io/fedora/$NAME-$PERL_SHORT_VER " 37 | 38 | RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 40 | rpm -V $INSTALL_PKGS && \ 41 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 42 | dnf -y clean all --enablerepo='*' 43 | 44 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 45 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 46 | 47 | # Copy extra files to the image. 48 | COPY ./root/ / 49 | 50 | # In order to drop the root user, we have to make some directories world 51 | # writeable as OpenShift default security model is to run the container under 52 | # random UID. 53 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 54 | sed -i -f ${APP_ROOT}/etc/httpdconf-fed.sed /etc/httpd/conf/httpd.conf && \ 55 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 56 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 57 | rpm-file-permissions 58 | 59 | USER 1001 60 | 61 | # Set the default CMD to print the usage of the language image 62 | CMD $STI_SCRIPTS_PATH/usage 63 | -------------------------------------------------------------------------------- /5.40/Dockerfile.rhel10: -------------------------------------------------------------------------------- 1 | FROM ubi10/s2i-base 2 | 3 | # This image provides a Perl 5.40 environment you can use to run your Perl applications. 4 | 5 | EXPOSE 8080 6 | 7 | # Image metadata 8 | ENV PERL_VERSION=5.40 \ 9 | PERL_SHORT_VER=540 \ 10 | NAME=perl 11 | 12 | ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ 13 | DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \ 14 | building and running various Perl $PERL_VERSION applications and frameworks. \ 15 | Perl is a high-level programming language with roots in C, sed, awk and shell scripting. \ 16 | Perl is good at handling processes and files, and is especially good at handling text. \ 17 | Perl's hallmarks are practicality and efficiency. While it is used to do a lot of \ 18 | different things, Perl's most common applications are system administration utilities \ 19 | and web programming." 20 | 21 | LABEL summary="$SUMMARY" \ 22 | description="$DESCRIPTION" \ 23 | io.k8s.description="$DESCRIPTION" \ 24 | io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \ 25 | io.openshift.expose-services="8080:http" \ 26 | io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}","${NAME}-${PERL_SHORT_VER}" \ 27 | io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ 28 | io.s2i.scripts-url="image:///usr/libexec/s2i" \ 29 | name="ubi10/${NAME}-${PERL_SHORT_VER}" \ 30 | com.redhat.component="${NAME}-${PERL_SHORT_VER}-container" \ 31 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ 32 | maintainer="SoftwareCollections.org " \ 33 | help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ 34 | usage="s2i build ubi10/${NAME}-${PERL_SHORT_VER} " 35 | 36 | # Deselect a default stream 37 | RUN dnf -y --allowerasing distrosync && \ 38 | INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ 39 | dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 40 | rpm -V $INSTALL_PKGS && \ 41 | perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ 42 | dnf -y clean all --enablerepo='*' 43 | 44 | # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH 45 | COPY ./s2i/bin/ $STI_SCRIPTS_PATH 46 | 47 | # Copy extra files to the image. 48 | COPY ./root/ / 49 | 50 | # In order to drop the root user, we have to make some directories world 51 | # writeable as OpenShift default security model is to run the container under 52 | # random UID. 53 | RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \ 54 | sed -i -f ${APP_ROOT}/etc/httpdconf.sed /etc/httpd/conf/httpd.conf && \ 55 | chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \ 56 | chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ 57 | rpm-file-permissions 58 | 59 | USER 1001 60 | 61 | # Set the default CMD to print the usage of the language image 62 | CMD $STI_SCRIPTS_PATH/usage 63 | -------------------------------------------------------------------------------- /5.40/root/opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch: -------------------------------------------------------------------------------- 1 | From d65d28410b91dfb3d9d12b6b8e49a79c7da54e1c Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= 3 | Date: Wed, 9 Jan 2019 12:33:59 +0100 4 | Subject: [PATCH] Work around mod_fcgid bogus SCRIPT_NAME/PATH_INFO 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | mod_fcgid sends wrong PATH_INFO to virtual FcgidWrapper and that 10 | prevents Plack from passing an application path to PSGI. 11 | 12 | This adds a side channel for passing application URI location to 13 | Plack's FCGI handler. 14 | 15 | https://bugzilla.redhat.com/show_bug.cgi?id=1651746 16 | 17 | 18 | 19 | 20 | Signed-off-by: Petr Písař 21 | --- 22 | lib/Plack/Handler/FCGI.pm | 11 +++++++++++ 23 | 1 file changed, 11 insertions(+) 24 | 25 | diff --git a/lib/Plack/Handler/FCGI.pm b/lib/Plack/Handler/FCGI.pm 26 | index 029051c..0c491b2 100644 27 | --- a/lib/Plack/Handler/FCGI.pm 28 | +++ b/lib/Plack/Handler/FCGI.pm 29 | @@ -124,6 +124,17 @@ sub run { 30 | delete $env->{HTTP_CONTENT_TYPE}; 31 | delete $env->{HTTP_CONTENT_LENGTH}; 32 | 33 | + # mod_fcgid provides wrong SCRIPT_NAME and PATH_INFO for virtual FCGI script handlers 34 | + # 35 | + # 36 | + # 37 | + if (exists $ENV{MODFCGID_VIRTUAL_LOCATION}) { 38 | + if ($ENV{MODFCGID_VIRTUAL_LOCATION} eq '/') { 39 | + $ENV{MODFCGID_VIRTUAL_LOCATION} = ''; 40 | + } 41 | + $env->{SCRIPT_NAME} = $ENV{MODFCGID_VIRTUAL_LOCATION}; 42 | + } 43 | + 44 | # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it 45 | my $uri = URI->new("http://localhost" . $env->{REQUEST_URI}); 46 | $env->{PATH_INFO} = uri_unescape($uri->path); 47 | -- 48 | 2.17.2 49 | 50 | -------------------------------------------------------------------------------- /5.40/root/opt/app-root/etc/httpd.conf: -------------------------------------------------------------------------------- 1 | LoadModule env_module modules/mod_env.so 2 | 3 | 4 | LoadModule cgid_module modules/mod_cgid.so 5 | 6 | 7 | LoadModule cgid_module modules/mod_cgid.so 8 | 9 | 10 | LoadModule cgi_module modules/mod_cgi.so 11 | 12 | 13 | LoadModule unixd_module modules/mod_unixd.so 14 | LoadModule authn_core_module modules/mod_authn_core.so 15 | LoadModule authz_core_module modules/mod_authz_core.so 16 | LoadModule fcgid_module modules/mod_fcgid.so 17 | 18 | FcgidIPCDir /run/mod_fcgid 19 | FcgidProcessTableFile /run/mod_fcgid/fcgid_shm 20 | 21 | DirectoryIndex index.pl index.cgi index.fcg index.fcgi index.fpl 22 | 23 | 24 | SetHandler cgi-script 25 | Options +ExecCGI +SymLinksIfOwnerMatch 26 | 27 | 28 | 29 | SetHandler fcgid-script 30 | Options +ExecCGI +SymLinksIfOwnerMatch 31 | 32 | 33 | 34 | Require all granted 35 | 36 | 37 | IncludeOptional /opt/app-root/etc/httpd.d/*.conf -------------------------------------------------------------------------------- /5.40/root/opt/app-root/etc/httpd.d/50-mpm.conf.template: -------------------------------------------------------------------------------- 1 | # This value should mirror what is set in MinSpareServers. 2 | StartServers ${HTTPD_START_SERVERS} 3 | 4 | MinSpareServers ${HTTPD_START_SERVERS} 5 | MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} 6 | 7 | # The MaxRequestWorkers directive sets the limit on the number of 8 | # simultaneous requests that will be served. 9 | # The default value, when no cgroup limits are set is 256. 10 | MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} 11 | ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} 12 | MaxConnectionsPerChild 4000 13 | MaxKeepAliveRequests 100 -------------------------------------------------------------------------------- /5.40/root/opt/app-root/etc/httpdconf-fed.sed: -------------------------------------------------------------------------------- 1 | s/^Listen 80/Listen 0.0.0.0:8080/ 2 | s/^User apache/User default/ 3 | s/^Group apache/Group root/ 4 | s%^DocumentRoot "/var/www/html"%DocumentRoot "/opt/app-root/src"% 5 | s%^ /opt/app-root/etc/httpd.d/env.conf 16 | fi 17 | 18 | export_vars=$(cgroup-limits) ; export $export_vars 19 | 20 | # Validate server limit option 21 | if [[ ! "${HTTPD_MAX_REQUEST_WORKERS:-1}" =~ ^[1-9][0-9]*$ || "${HTTPD_MAX_REQUEST_WORKERS:-1}" -gt 20000 ]]; then 22 | echo "HTTPD_MAX_REQUEST_WORKERS needs be an integer between 1 and 20000" 23 | exit 1 24 | fi 25 | 26 | # If there is no server limit specified, try to guess the best value 27 | if [ -z "${HTTPD_MAX_REQUEST_WORKERS:-}" ]; then 28 | MAX_SERVER_LIMIT=$(((MEMORY_LIMIT_IN_BYTES/1024/1024 - 30) / 7)) 29 | MAX_SERVER_LIMIT=$((MAX_SERVER_LIMIT > 0 ? MAX_SERVER_LIMIT : 1)) 30 | export HTTPD_MAX_REQUEST_WORKERS=$((MAX_SERVER_LIMIT > 256 ? 256 : MAX_SERVER_LIMIT)) 31 | fi 32 | 33 | export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} 34 | export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) 35 | 36 | envsubst < /opt/app-root/etc/httpd.d/50-mpm.conf.template > /opt/app-root/etc/httpd.d/50-mpm.conf 37 | 38 | if [ -f ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template ]; then 39 | PLACKUP_ARGS="" 40 | if [ -n "$PSGI_RELOAD" ]; then 41 | PLACKUP_ARGS="-r -R ${APP_ROOT}/src/" 42 | fi 43 | 44 | export PLACKUP_ARGS=${PLACKUP_ARGS} 45 | 46 | envsubst < ${APP_ROOT}/etc/httpd.d/40-psgi.conf.template > ${APP_ROOT}/etc/httpd.d/40-psgi.conf 47 | fi 48 | 49 | exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 50 | -------------------------------------------------------------------------------- /5.40/s2i/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` 4 | NAMESPACE=sclorg 5 | if [[ $DISTRO =~ rhel* ]]; then 6 | NAMESPACE=rhel10 7 | DISTRO="" 8 | else 9 | DISTRO="-c10s" 10 | fi 11 | 12 | cat < -- curl 127.0.0.1:8080 24 | EOF 25 | -------------------------------------------------------------------------------- /5.40/test/__init__.py: -------------------------------------------------------------------------------- 1 | ../../test/__init__.py -------------------------------------------------------------------------------- /5.40/test/binpath: -------------------------------------------------------------------------------- 1 | ../../test/binpath -------------------------------------------------------------------------------- /5.40/test/conftest.py: -------------------------------------------------------------------------------- 1 | ../../test/conftest.py -------------------------------------------------------------------------------- /5.40/test/examples: -------------------------------------------------------------------------------- 1 | ../../examples/ -------------------------------------------------------------------------------- /5.40/test/fcgi: -------------------------------------------------------------------------------- 1 | ../../test/fcgi -------------------------------------------------------------------------------- /5.40/test/imagestreams: -------------------------------------------------------------------------------- 1 | ../../imagestreams/ -------------------------------------------------------------------------------- /5.40/test/psgi: -------------------------------------------------------------------------------- 1 | ../../test/psgi -------------------------------------------------------------------------------- /5.40/test/psgi-hot_deploy: -------------------------------------------------------------------------------- 1 | ../../test/psgi-hot_deploy -------------------------------------------------------------------------------- /5.40/test/psgi-variables: -------------------------------------------------------------------------------- 1 | ../../test/psgi-variables -------------------------------------------------------------------------------- /5.40/test/run: -------------------------------------------------------------------------------- 1 | ../../test/run-modfcgid -------------------------------------------------------------------------------- /5.40/test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-pytest -------------------------------------------------------------------------------- /5.40/test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | ../../test/run-openshift-remote-cluster -------------------------------------------------------------------------------- /5.40/test/run-pytest: -------------------------------------------------------------------------------- 1 | ../../test/run-pytest -------------------------------------------------------------------------------- /5.40/test/sample-test-app: -------------------------------------------------------------------------------- 1 | ../../examples/sample-test-app/ -------------------------------------------------------------------------------- /5.40/test/sample-test-app.json: -------------------------------------------------------------------------------- 1 | ../../examples/templates/sample-test-app.json -------------------------------------------------------------------------------- /5.40/test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /5.40/test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | ../../test/test-lib-perl.sh -------------------------------------------------------------------------------- /5.40/test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /5.40/test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../../common/test-lib.sh -------------------------------------------------------------------------------- /5.40/test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../../common/test-openshift.yaml -------------------------------------------------------------------------------- /5.40/test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_basics.py -------------------------------------------------------------------------------- /5.40/test/test_container_s2i.py: -------------------------------------------------------------------------------- 1 | ../../test/test_container_s2i.py -------------------------------------------------------------------------------- /5.40/test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_standalone.py -------------------------------------------------------------------------------- /5.40/test/test_ocp_dancer_ex_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_dancer_ex_templates.py -------------------------------------------------------------------------------- /5.40/test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_deploy_templates.py -------------------------------------------------------------------------------- /5.40/test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_app.py -------------------------------------------------------------------------------- /5.40/test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_dancer_mysql_template.py -------------------------------------------------------------------------------- /5.40/test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_helm_perl_imagestreams.py -------------------------------------------------------------------------------- /5.40/test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_imagestreams_quickstart.py -------------------------------------------------------------------------------- /5.40/test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../../test/test_ocp_latest_imagestreams.py -------------------------------------------------------------------------------- /5.40/test/warningonstderr: -------------------------------------------------------------------------------- 1 | ../../test/warningonstderr -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Variables are documented in common/build.sh. 2 | BASE_IMAGE_NAME = perl 3 | VERSIONS = 5.26-mod_fcgid 5.26 5.30 5.32 5.34 5.36 5.38 5.40 4 | OPENSHIFT_NAMESPACES = 5.16 5 | 6 | # HACK: Ensure that 'git pull' for old clones doesn't cause confusion. 7 | # New clones should use '--recursive'. 8 | .PHONY: $(shell test -f common/common.mk || echo >&2 'Please do "git submodule update --init" first.') 9 | 10 | include common/common.mk 11 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # S2I Sample Applications for Perl Builder Image 2 | 3 | This is a very basic sample application repository that can be built and deployed 4 | on [OpenShift](https://www.openshift.com) using the [Perl builder image](https://github.com/sclorg/s2i-perl-container). 5 | 6 | The application serves a single static html page via perl, while also installing Math::Round package from cpan. 7 | 8 | To build and run the application: 9 | 10 | ``` 11 | $ s2i build --context-dir=examples/sample-test-app https://github.com/sclorg/s2i-perl-container sclorg/perl-540-c10s myperlimage 12 | $ docker run -p 8080:8080 myperlimage 13 | $ # browse to http://localhost:8080 14 | ``` 15 | 16 | You can also build and deploy the application on OpenShift, assuming you have a 17 | working `oc` command line environment connected to your cluster already: 18 | 19 | `$ oc new-app --context-dir=examples/sample-test-app sclorg/perl-540-c10s~https://github.com/sclorg/s2i-perl-container` 20 | 21 | You can also deploy the sample template for the application: 22 | 23 | `$ oc new-app -f https://raw.githubusercontent.com/sclorg/s2i-perl-container/master/examples/templates/sample-test-app.json` 24 | 25 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.26-mod_fcgid/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubi8/perl-526 2 | 3 | # Add application sources 4 | ADD app-src . 5 | 6 | # Set the paths to local Perl modules 7 | ENV PATH=/opt/app-root/src/extlib/bin:${PATH} 8 | ENV PERL5LIB=/opt/app-root/src/extlib/lib/perl5 9 | 10 | # Install the dependencies 11 | RUN cpanm --notest -l extlib Module::CoreList && \ 12 | cpanm --notest -l extlib --installdeps . 13 | 14 | # Install Plack as an FCGI server 15 | RUN cpanm --notest -l extlib Plack::Handler::FCGI FCGI::ProcManager 16 | RUN patch --read-only=ignore -d ./extlib/lib/perl5 -p2 < /opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch 17 | RUN printf '\ 18 | FcgidInitialEnv MODFCGID_VIRTUAL_LOCATION /\n\ 19 | PassEnv HOME\n\ 20 | FcgidInitialEnv "HOME" "%s"\n\ 21 | PassEnv PATH\n\ 22 | FcgidInitialEnv "PATH" "%s"\n\ 23 | PassEnv PERL5LIB\n\ 24 | FcgidInitialEnv "PERL5LIB" "%s"\n\ 25 | \n\ 26 | SetHandler fcgid-script\n\ 27 | Options +ExecCGI\n\ 28 | FcgidWrapper "/opt/app-root/psgiwrapper /usr/bin/env plackup -s FCGI ./app.psgi" virtual\n\ 29 | \n' "$HOME" "$PATH" "$PERL5LIB"> /opt/app-root/etc/httpd.d/40-psgi.conf 30 | 31 | # Run scripts uses standard ways to run the application 32 | CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 33 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.26-mod_fcgid/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM ubi8/perl-526 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.26/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos7/perl-526-centos7 2 | 3 | # Add application sources 4 | ADD app-src \. 5 | 6 | # Install dependencies cpanfile required 7 | RUN cpanm --notest -l extlib Module::CoreList && \ 8 | cpanm --notest -l extlib --installdeps . 9 | 10 | RUN printf '\ 11 | \n\ 12 | SetHandler perl-script\n\ 13 | PerlResponseHandler Plack::Handler::Apache2\n\ 14 | PerlSetVar psgi_app app.psgi\n\ 15 | \n' > /opt/app-root/etc/httpd.d/40-psgi.conf 16 | 17 | # Run script uses standard ways to run the application 18 | CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 19 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.26/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM registry.redhat.io/rhscl/perl-526-rhel7 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.30-mod_fcgid/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubi8/perl-530 2 | 3 | # Add application sources 4 | ADD app-src . 5 | 6 | # Set the paths to local Perl modules 7 | ENV PATH=/opt/app-root/src/extlib/bin:${PATH} 8 | ENV PERL5LIB=/opt/app-root/src/extlib/lib/perl5 9 | 10 | # Install the dependencies 11 | RUN cpanm --notest -l extlib Module::CoreList && \ 12 | cpanm --notest -l extlib --installdeps . 13 | 14 | # Install Plack as an FCGI server 15 | RUN cpanm --notest -l extlib Plack::Handler::FCGI FCGI::ProcManager 16 | RUN patch --read-only=ignore -d ./extlib/lib/perl5 -p2 < /opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch 17 | RUN printf '\ 18 | FcgidInitialEnv MODFCGID_VIRTUAL_LOCATION /\n\ 19 | PassEnv HOME\n\ 20 | FcgidInitialEnv "HOME" "%s"\n\ 21 | PassEnv PATH\n\ 22 | FcgidInitialEnv "PATH" "%s"\n\ 23 | PassEnv PERL5LIB\n\ 24 | FcgidInitialEnv "PERL5LIB" "%s"\n\ 25 | \n\ 26 | SetHandler fcgid-script\n\ 27 | Options +ExecCGI\n\ 28 | FcgidWrapper "/opt/app-root/psgiwrapper /usr/bin/env plackup -s FCGI ./app.psgi" virtual\n\ 29 | \n' "$HOME" "$PATH" "$PERL5LIB"> /opt/app-root/etc/httpd.d/40-psgi.conf 30 | 31 | # Run scripts uses standard ways to run the application 32 | CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 33 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.30-mod_fcgid/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM ubi8/perl-530 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.30/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos8/perl-530-centos8 2 | 3 | # Add application sources 4 | ADD app-src \. 5 | 6 | # Install dependencies cpanfile required 7 | RUN cpanm --notest -l extlib Module::CoreList && \ 8 | cpanm --notest -l extlib --installdeps . 9 | 10 | RUN printf '\ 11 | \n\ 12 | SetHandler perl-script\n\ 13 | PerlResponseHandler Plack::Handler::Apache2\n\ 14 | PerlSetVar psgi_app app.psgi\n\ 15 | \n' > /opt/app-root/etc/httpd.d/40-psgi.conf 16 | 17 | # Run script uses standard ways to run the application 18 | CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 19 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.30/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM registry.redhat.io/rhscl/perl-530-rhel8 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.32/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-532 2 | 3 | # Add application sources 4 | ADD app-src . 5 | 6 | # Set the paths to local Perl modules 7 | ENV PATH=/opt/app-root/src/extlib/bin:${PATH} 8 | ENV PERL5LIB=/opt/app-root/src/extlib/lib/perl5 9 | 10 | # Install the dependencies 11 | RUN cpanm --notest -l extlib Module::CoreList && \ 12 | cpanm --notest -l extlib --installdeps . 13 | 14 | # Install Plack as an FCGI server 15 | RUN cpanm --notest -l extlib Plack::Handler::FCGI FCGI::ProcManager 16 | RUN patch --read-only=ignore -d ./extlib/lib/perl5 -p2 < /opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch 17 | RUN printf '\ 18 | FcgidInitialEnv MODFCGID_VIRTUAL_LOCATION /\n\ 19 | PassEnv HOME\n\ 20 | FcgidInitialEnv "HOME" "%s"\n\ 21 | PassEnv PATH\n\ 22 | FcgidInitialEnv "PATH" "%s"\n\ 23 | PassEnv PERL5LIB\n\ 24 | FcgidInitialEnv "PERL5LIB" "%s"\n\ 25 | \n\ 26 | SetHandler fcgid-script\n\ 27 | Options +ExecCGI\n\ 28 | FcgidWrapper "/opt/app-root/psgiwrapper /usr/bin/env plackup -s FCGI ./app.psgi" virtual\n\ 29 | \n' "$HOME" "$PATH" "$PERL5LIB"> /opt/app-root/etc/httpd.d/40-psgi.conf 30 | 31 | # Run scripts uses standard ways to run the application 32 | CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 33 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.32/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-532 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.34/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-534 2 | 3 | # Add application sources 4 | ADD app-src . 5 | 6 | # Set the paths to local Perl modules 7 | ENV PATH=${APP_ROOT}/src/extlib/bin:${PATH} 8 | ENV PERL5LIB=${APP_ROOT}/src/extlib/lib/perl5 9 | 10 | # Install the dependencies 11 | RUN cpanm --notest -l extlib Module::CoreList && \ 12 | cpanm --notest -l extlib --installdeps . 13 | 14 | # Install Plack as an FCGI server 15 | RUN cpanm --notest -l extlib Plack::Handler::FCGI FCGI::ProcManager 16 | RUN patch --read-only=ignore -d ./extlib/lib/perl5 -p2 < ${APP_ROOT}/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch 17 | RUN printf '\ 18 | FcgidInitialEnv MODFCGID_VIRTUAL_LOCATION /\n\ 19 | PassEnv HOME\n\ 20 | FcgidInitialEnv "HOME" "%s"\n\ 21 | PassEnv PATH\n\ 22 | FcgidInitialEnv "PATH" "%s"\n\ 23 | PassEnv PERL5LIB\n\ 24 | FcgidInitialEnv "PERL5LIB" "%s"\n\ 25 | \n\ 26 | SetHandler fcgid-script\n\ 27 | Options +ExecCGI\n\ 28 | FcgidWrapper "${APP_ROOT}/psgiwrapper /usr/bin/env plackup -s FCGI ./app.psgi" virtual\n\ 29 | \n' "$HOME" "$PATH" "$PERL5LIB"> ${APP_ROOT}/etc/httpd.d/40-psgi.conf 30 | 31 | # Run scripts uses standard ways to run the application 32 | CMD exec httpd -C 'Include ${APP_ROOT}/etc/httpd.conf' -D FOREGROUND 33 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.34/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-534 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.36/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-536 2 | 3 | # Add application sources 4 | ADD app-src . 5 | 6 | # Set the paths to local Perl modules 7 | ENV PATH=/opt/app-root/src/extlib/bin:${PATH} 8 | ENV PERL5LIB=/opt/app-root/src/extlib/lib/perl5 9 | 10 | # Install the dependencies 11 | RUN cpanm --notest -l extlib Module::CoreList && \ 12 | cpanm --notest -l extlib --installdeps . 13 | 14 | # Install Plack as an FCGI server 15 | RUN cpanm --notest -l extlib Plack::Handler::FCGI FCGI::ProcManager 16 | RUN patch --read-only=ignore -d ./extlib/lib/perl5 -p2 < /opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch 17 | RUN printf '\ 18 | FcgidInitialEnv MODFCGID_VIRTUAL_LOCATION /\n\ 19 | PassEnv HOME\n\ 20 | FcgidInitialEnv "HOME" "%s"\n\ 21 | PassEnv PATH\n\ 22 | FcgidInitialEnv "PATH" "%s"\n\ 23 | PassEnv PERL5LIB\n\ 24 | FcgidInitialEnv "PERL5LIB" "%s"\n\ 25 | \n\ 26 | SetHandler fcgid-script\n\ 27 | Options +ExecCGI\n\ 28 | FcgidWrapper "/opt/app-root/psgiwrapper /usr/bin/env plackup -s FCGI ./app.psgi" virtual\n\ 29 | \n' "$HOME" "$PATH" "$PERL5LIB"> /opt/app-root/etc/httpd.d/40-psgi.conf 30 | 31 | # Run scripts uses standard ways to run the application 32 | CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 33 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.36/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-536 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.38/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-538 2 | 3 | # Add application sources 4 | ADD app-src . 5 | 6 | # Set the paths to local Perl modules 7 | ENV PATH=/opt/app-root/src/extlib/bin:${PATH} 8 | ENV PERL5LIB=/opt/app-root/src/extlib/lib/perl5 9 | 10 | # Install the dependencies 11 | RUN cpanm --notest -l extlib Module::CoreList && \ 12 | cpanm --notest -l extlib --installdeps . 13 | 14 | # Install Plack as an FCGI server 15 | RUN cpanm --notest -l extlib Plack::Handler::FCGI FCGI::ProcManager 16 | RUN patch --read-only=ignore -d ./extlib/lib/perl5 -p2 < /opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch 17 | RUN printf '\ 18 | FcgidInitialEnv MODFCGID_VIRTUAL_LOCATION /\n\ 19 | PassEnv HOME\n\ 20 | FcgidInitialEnv "HOME" "%s"\n\ 21 | PassEnv PATH\n\ 22 | FcgidInitialEnv "PATH" "%s"\n\ 23 | PassEnv PERL5LIB\n\ 24 | FcgidInitialEnv "PERL5LIB" "%s"\n\ 25 | \n\ 26 | SetHandler fcgid-script\n\ 27 | Options +ExecCGI\n\ 28 | FcgidWrapper "/opt/app-root/psgiwrapper /usr/bin/env plackup -s FCGI ./app.psgi" virtual\n\ 29 | \n' "$HOME" "$PATH" "$PERL5LIB"> /opt/app-root/etc/httpd.d/40-psgi.conf 30 | 31 | # Run scripts uses standard ways to run the application 32 | CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 33 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.38/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-538 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.40/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-540 2 | 3 | # Add application sources 4 | ADD app-src . 5 | 6 | # Set the paths to local Perl modules 7 | ENV PATH=/opt/app-root/src/extlib/bin:${PATH} 8 | ENV PERL5LIB=/opt/app-root/src/extlib/lib/perl5 9 | 10 | # Install the dependencies 11 | RUN cpanm --notest -l extlib Module::CoreList && \ 12 | cpanm --notest -l extlib --installdeps . 13 | 14 | # Install Plack as an FCGI server 15 | RUN cpanm --notest -l extlib Plack::Handler::FCGI FCGI::ProcManager 16 | RUN patch --read-only=ignore -d ./extlib/lib/perl5 -p2 < /opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch 17 | RUN printf '\ 18 | FcgidInitialEnv MODFCGID_VIRTUAL_LOCATION /\n\ 19 | PassEnv HOME\n\ 20 | FcgidInitialEnv "HOME" "%s"\n\ 21 | PassEnv PATH\n\ 22 | FcgidInitialEnv "PATH" "%s"\n\ 23 | PassEnv PERL5LIB\n\ 24 | FcgidInitialEnv "PERL5LIB" "%s"\n\ 25 | \n\ 26 | SetHandler fcgid-script\n\ 27 | Options +ExecCGI\n\ 28 | FcgidWrapper "/opt/app-root/psgiwrapper /usr/bin/env plackup -s FCGI ./app.psgi" virtual\n\ 29 | \n' "$HOME" "$PATH" "$PERL5LIB"> /opt/app-root/etc/httpd.d/40-psgi.conf 30 | 31 | # Run scripts uses standard ways to run the application 32 | CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND 33 | -------------------------------------------------------------------------------- /examples/from-dockerfile/5.40/Dockerfile.s2i: -------------------------------------------------------------------------------- 1 | FROM ubi9/perl-540 2 | 3 | # Add application sources to a directory that the assemble script expects them 4 | # and set permissions so that the container runs without root access 5 | USER 0 6 | ADD app-src /tmp/src 7 | RUN chown -R 1001:0 /tmp/src 8 | USER 1001 9 | 10 | # Install the dependencies 11 | RUN /usr/libexec/s2i/assemble 12 | 13 | # Set the default command for the resulting image 14 | CMD /usr/libexec/s2i/run 15 | -------------------------------------------------------------------------------- /examples/from-dockerfile/README.md: -------------------------------------------------------------------------------- 1 | Dockerfile examples 2 | =================== 3 | 4 | This directory contains example Dockerfiles that demonstrate how to use the image with a Dockerfile and `docker build`. 5 | 6 | For demonstration, we use an application code available at https://github.com/sclorg/dancer-ex.git. 7 | 8 | Pull the source to the local machine first: 9 | ``` 10 | git clone https://github.com/sclorg/dancer-ex.git app-src 11 | ``` 12 | 13 | Then, build a new image from a Dockerfile in this directory: 14 | ``` 15 | docker build -f Dockerfile -t node-app . 16 | ``` 17 | 18 | And run the resulting image with the final application: 19 | ``` 20 | docker run -ti --rm node-app 21 | ``` 22 | -------------------------------------------------------------------------------- /examples/sample-test-app/cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Math::Round', '== 0.06'; -------------------------------------------------------------------------------- /examples/sample-test-app/index.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use Math::Round; 4 | 5 | round(10.2) == 10 || die "round(10.2) != 10"; 6 | 7 | print "Content-type: text/html\n\n"; 8 | print < 10 | Everything is OK 11 | 12 | Everything is fine. 13 | 14 | 15 | EOF 16 | ; -------------------------------------------------------------------------------- /imagestreams/imagestreams.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: perl 3 | pretty_name: Perl 4 | sample_repo: "https://github.com/sclorg/dancer-ex.git" 5 | category: builder 6 | description: >- 7 | Build and run Perl APP_VERSION applications on DISTRO_NAME. For more information 8 | about using this builder image, including OpenShift considerations, see 9 | https://github.com/sclorg/s2i-perl-container/blob/master/APP_VERSION/README.md. 10 | imagestream_files: 11 | - filename: perl-centos.json 12 | latest: "5.40-ubi10" 13 | distros: 14 | - name: UBI 8 15 | app_versions: ["5.26"] 16 | 17 | - name: UBI 9 18 | app_versions: ["5.32"] 19 | 20 | - name: UBI 10 21 | app_versions: ["5.40"] 22 | 23 | - filename: perl-rhel.json 24 | latest: "5.40-ubi10" 25 | distros: 26 | - name: UBI 8 27 | app_versions: ["5.26"] 28 | 29 | - name: UBI 9 30 | app_versions: ["5.32"] 31 | 32 | - name: UBI 10 33 | app_versions: ["5.40"] 34 | 35 | - filename: perl-rhel-aarch64.json 36 | latest: "5.40-ubi10" 37 | distros: 38 | - name: UBI 8 39 | app_versions: ["5.26"] 40 | 41 | - name: UBI 9 42 | app_versions: ["5.32"] 43 | 44 | - name: UBI 10 45 | app_versions: ["5.40"] 46 | ... 47 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/s2i-perl-container/9198ffff07599beb5809a718fde0479f2531dd62/test/__init__.py -------------------------------------------------------------------------------- /test/binpath/cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Net::IP'; 2 | -------------------------------------------------------------------------------- /test/binpath/index.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | print "Content-type: text/plain\n\n"; 3 | my $output = `ipcount 2>&1`; 4 | if (!defined $output) { 5 | die "No output from `ipcount' command"; 6 | } 7 | print $output; 8 | -------------------------------------------------------------------------------- /test/check_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../common/check_imagestreams.py -------------------------------------------------------------------------------- /test/conftest.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | from pathlib import Path 5 | from collections import namedtuple 6 | from pytest import skip 7 | 8 | from container_ci_suite.utils import check_variables 9 | 10 | if not check_variables(): 11 | sys.exit(1) 12 | 13 | TAGS = { 14 | "rhel8": "-ubi8", 15 | "rhel9": "-ubi9", 16 | "rhel10": "-ubi10", 17 | } 18 | 19 | MYSQL_TAGS = { 20 | "rhel8": "-el8", 21 | "rhel9": "-el9", 22 | "rhel10": "-el10", 23 | } 24 | 25 | Vars = namedtuple( 26 | "Vars", [ 27 | "OS", "TAG", "MYSQL_VERSION", "VERSION", "IMAGE_NAME", "IS_MINIMAL", 28 | "VERSION_NO_FCGID", "SHORT_VERSION", "TEST_DIR" 29 | ] 30 | ) 31 | VERSION = os.getenv("VERSION") 32 | OS = os.getenv("TARGET").lower() 33 | VARS = Vars( 34 | OS=OS, 35 | TAG=TAGS.get(OS), 36 | MYSQL_VERSION=f"8.0{MYSQL_TAGS.get(OS)}", 37 | VERSION=VERSION, 38 | IMAGE_NAME=os.getenv("IMAGE_NAME"), 39 | IS_MINIMAL="minimal" in VERSION, 40 | VERSION_NO_FCGID=VERSION.replace("-mod_fcgid", ""), 41 | SHORT_VERSION=VERSION.replace("-mod_fcgid", "").replace(".", ""), 42 | TEST_DIR=Path(__file__).parent.absolute() 43 | ) 44 | 45 | IMAGE_TAG = f"mysql:{VARS.MYSQL_VERSION}" 46 | 47 | 48 | def skip_helm_charts_tests(): 49 | if VARS.VERSION == "5.32" and VARS.OS == "rhel8": 50 | skip(f"Skipping Helm Charts tests for {VARS.VERSION} on {VARS.OS}.") 51 | -------------------------------------------------------------------------------- /test/fcgi/another.fcgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use FCGI; 3 | my $request = FCGI::Request(); 4 | while ($request->Accept() >= 0) { 5 | print "Content-Type: text/plain\r\n\r\n"; 6 | print "Another FCGI script.\n"; 7 | } 8 | -------------------------------------------------------------------------------- /test/fcgi/index.fcgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use FCGI; 3 | my $request = FCGI::Request(); 4 | while ($request->Accept() >= 0) { 5 | print "Content-Type: text/plain\r\n\r\n"; 6 | print "Index FCGI script.\n"; 7 | } 8 | -------------------------------------------------------------------------------- /test/psgi-hot_deploy/cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Cwd'; 2 | requires 'Exporter'; 3 | requires 'File::Basename'; 4 | -------------------------------------------------------------------------------- /test/psgi-hot_deploy/index.psgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env plackup 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use File::Basename qw(dirname); 7 | use Cwd qw(abs_path); 8 | 9 | use lib (dirname abs_path $0) .'/lib'; 10 | use My::Test qw(test); 11 | 12 | my $count = 0; 13 | sub { 14 | return [ 15 | 200, 16 | ['Content-Type' => 'text/plain'], 17 | [test($count++)], 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /test/psgi-hot_deploy/lib/My/Test.pm: -------------------------------------------------------------------------------- 1 | package My::Test; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Exporter qw(import); 7 | 8 | our @EXPORT_OK = qw(test); 9 | 10 | sub test { 11 | my $count = shift; 12 | 13 | return "old initial value: $count\n"; 14 | } 15 | 16 | 1; 17 | -------------------------------------------------------------------------------- /test/psgi-variables/application2.psgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env plackup 2 | use Web::Paste::Simple; 3 | Web::Paste::Simple->new->app; 4 | -------------------------------------------------------------------------------- /test/psgi-variables/cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Web::Paste::Simple'; 2 | -------------------------------------------------------------------------------- /test/psgi/application.psgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env plackup 2 | use Web::Paste::Simple; 3 | Web::Paste::Simple->new->app; 4 | -------------------------------------------------------------------------------- /test/psgi/cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Web::Paste::Simple'; 2 | -------------------------------------------------------------------------------- /test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # IMAGE_NAME specifies a name of the candidate image used for testing. 4 | # The image has to be available before this script is executed. 5 | # VERSION specifies the major version of the MariaDB in format of X.Y 6 | # OS specifies RHEL version (e.g. OS=rhel10) 7 | # 8 | 9 | THISDIR=$(dirname ${BASH_SOURCE[0]}) 10 | 11 | cd "${THISDIR}" && python3.12 -m pytest -s -rA --showlocals -vv test_ocp_*.py 12 | -------------------------------------------------------------------------------- /test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Test the Perl image in the OpenShift. 4 | # 5 | # IMAGE_NAME specifies a name of the candidate image used for testing. 6 | # VERSION specifies a version of the Perl in the candidate image. 7 | # The image has to be available before this script is executed. 8 | 9 | THISDIR=$(dirname ${BASH_SOURCE[0]}) 10 | 11 | source "${THISDIR}/test-lib.sh" 12 | source "${THISDIR}/test-lib-openshift.sh" 13 | source "${THISDIR}/test-lib-perl.sh" 14 | source "${THISDIR}/test-lib-remote-openshift.sh" 15 | 16 | 17 | TEST_LIST="\ 18 | test_perl_s2i_sample_app 19 | test_perl_s2i_dancer_app 20 | test_perl_s2i_templates 21 | test_perl_imagestream 22 | test_latest_imagestreams 23 | " 24 | 25 | trap ct_os_cleanup EXIT SIGINT 26 | 27 | ct_os_set_ocp4 || exit $OC_ERR 28 | 29 | ct_os_check_compulsory_vars || exit $OC_ERR 30 | 31 | ct_os_check_login || exit $OC_ERR 32 | 33 | ct_os_tag_image_for_cvp "perl" 34 | 35 | set -ux 36 | 37 | # For testing on OpenShift 4 we use internal registry 38 | export CT_OCP4_TEST=true 39 | 40 | test -n "${IMAGE_NAME-}" || false 'make sure $IMAGE_NAME is defined' 41 | test -n "${VERSION-}" || false 'make sure $VERSION is defined' 42 | 43 | TEST_SUMMARY='' 44 | TEST_SET=${TESTS:-$TEST_LIST} ct_run_tests_from_testset "openshift-remote-cluster" 45 | 46 | # vim: set tabstop=2:shiftwidth=2:expandtab: 47 | 48 | -------------------------------------------------------------------------------- /test/run-pytest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # IMAGE_NAME specifies a name of the candidate image used for testing. 4 | # The image has to be available before this script is executed. 5 | # SINGLE_VERSION specifies the major version of httpd 6 | # OS specifies RHEL version (e.g. OS=rhel8) 7 | # 8 | 9 | THISDIR=$(dirname ${BASH_SOURCE[0]}) 10 | 11 | PYTHON_VERSION="3.12" 12 | if [[ ! -f "/usr/bin/python$PYTHON_VERSION" ]]; then 13 | PYTHON_VERSION="3.13" 14 | fi 15 | cd "${THISDIR}" && "python${PYTHON_VERSION}" -m pytest -s -rA --showlocals -vv test_container_*.py 16 | -------------------------------------------------------------------------------- /test/show_all_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../common/show_all_imagestreams.py -------------------------------------------------------------------------------- /test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /test/test-lib-perl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Functions for tests for the Perl image in OpenShift. 4 | # 5 | # IMAGE_NAME specifies a name of the candidate image used for testing. 6 | # The image has to be available before this script is executed. 7 | # 8 | 9 | THISDIR=$(dirname ${BASH_SOURCE[0]}) 10 | 11 | source "${THISDIR}/test-lib.sh" 12 | source "${THISDIR}/test-lib-openshift.sh" 13 | 14 | # Check the imagestream 15 | function test_perl_imagestream() { 16 | 17 | # perl version in ./imagestreams/perl-rhel.json is either 5.26 or 5.30 18 | # There is not version like `{5.26,5.30}-mod_fcgid` 19 | if [ "${VERSION}" == "5.26-mod_fcgid" ]; then 20 | VERSION="5.26" 21 | fi 22 | echo "Testing perl imagestream application" 23 | ct_os_test_image_stream_quickstart "${THISDIR}/imagestreams/perl-${OS//[0-9]/}.json" \ 24 | "${THISDIR}/sample-test-app.json" \ 25 | "${IMAGE_NAME}" \ 26 | perl \ 27 | "Everything is OK" \ 28 | 8080 http 200 "-p SOURCE_REPOSITORY_REF=master -p VERSION=${VERSION} -p NAME=perl-testing" 29 | } 30 | 31 | function test_perl_s2i_sample_app() { 32 | # TODO: We should ideally use a local directory instead of ${VERSION}/test/sample-test-app, 33 | # so we can test changes in that example app that are done as part of the PR 34 | ct_os_test_s2i_app ${IMAGE_NAME} "https://github.com/sclorg/s2i-perl-container.git" "${VERSION}/test/sample-test-app" "Everything is OK" 35 | } 36 | 37 | function test_perl_s2i_dancer_app() { 38 | ct_os_test_s2i_app ${IMAGE_NAME} "https://github.com/sclorg/dancer-ex.git" . 'Welcome to your Dancer application on OpenShift' 39 | } 40 | 41 | function test_perl_s2i_templates() { 42 | # TODO: this was not working because the referenced example dir was added as part of this commit 43 | ct_os_test_template_app "${IMAGE_NAME}" \ 44 | "${THISDIR}/examples/templates/sample-test-app.json" \ 45 | perl \ 46 | "Everything is OK" \ 47 | 8080 http 200 \ 48 | "-p SOURCE_REPOSITORY_REF=master -p VERSION=${VERSION} -p NAME=perl-testing" 49 | } 50 | 51 | function test_latest_imagestreams() { 52 | info "Testing the latest version in imagestreams" 53 | # Switch to root directory of a container 54 | pushd "${THISDIR}/../.." >/dev/null 55 | ct_check_latest_imagestreams 56 | popd >/dev/null 57 | } 58 | 59 | # vim: set tabstop=2:shiftwidth=2:expandtab: 60 | 61 | -------------------------------------------------------------------------------- /test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../common/test-lib.sh -------------------------------------------------------------------------------- /test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../common/test-openshift.yaml -------------------------------------------------------------------------------- /test/test_container_basics.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from container_ci_suite.container_lib import ContainerTestLib 4 | from container_ci_suite.engines.podman_wrapper import PodmanCLIWrapper 5 | 6 | from conftest import VARS 7 | 8 | 9 | class TestPerlContainer: 10 | 11 | def setup_method(self): 12 | self.app = ContainerTestLib(image_name=VARS.IMAGE_NAME, s2i_image=True) 13 | 14 | def teardown_method(self): 15 | self.app.cleanup() 16 | 17 | def test_run_s2i_usage(self): 18 | """ 19 | Test checks if `usage` script works properly 20 | """ 21 | output = self.app.s2i_usage() 22 | assert output 23 | 24 | # # test_docker_run_usage 25 | def test_docker_run_usage(self): 26 | """ 27 | Test checks if `docker run` script works properly and do not fail 28 | """ 29 | assert PodmanCLIWrapper.call_podman_command( 30 | cmd=f"run --rm {VARS.IMAGE_NAME} &>/dev/null", 31 | return_output=False 32 | ) == 0 33 | 34 | def test_scl_usage(self): 35 | """ 36 | Test checks if command `perl --version` script works properly 37 | and returns version without -mod_fcgid 38 | """ 39 | assert f"v{VARS.VERSION_NO_FCGID}" in PodmanCLIWrapper.podman_run_command( 40 | f"--rm {VARS.IMAGE_NAME} /bin/bash -c 'perl --version'" 41 | ) 42 | 43 | @pytest.mark.parametrize( 44 | "dockerfile", 45 | [ 46 | "Dockerfile", 47 | "Dockerfile.s2i" 48 | ] 49 | ) 50 | def test_dockerfiles(self, dockerfile): 51 | """ 52 | Test checks if we are able to build a container from 53 | `examples/from-dockerfile//{Dockerfile,Dockerfile.s2i} 54 | """ 55 | assert self.app.build_test_container( 56 | dockerfile=VARS.TEST_DIR / "examples/from-dockerfile" / VARS.VERSION / dockerfile, 57 | app_url="https://github.com/sclorg/dancer-ex.git", 58 | app_dir="app-src" 59 | ) 60 | assert self.app.test_app_dockerfile() 61 | cip = self.app.get_cip() 62 | assert cip 63 | assert self.app.test_response( 64 | url=cip, expected_code=200, 65 | expected_output="Welcome to your Dancer application" 66 | ) 67 | -------------------------------------------------------------------------------- /test/test_ocp_dancer_ex_standalone.py: -------------------------------------------------------------------------------- 1 | from container_ci_suite.openshift import OpenShiftAPI 2 | 3 | from conftest import VARS 4 | 5 | 6 | class TestPerlDancerExTemplate: 7 | 8 | def setup_method(self): 9 | self.oc_api = OpenShiftAPI( 10 | pod_name_prefix=f"perl-{VARS.SHORT_VERSION}-testing", 11 | version=VARS.VERSION, 12 | shared_cluster=True 13 | ) 14 | 15 | def teardown_method(self): 16 | self.oc_api.delete_project() 17 | 18 | def test_dancer_ex_template_inside_cluster(self): 19 | """ 20 | Test checks if example GitHub application dancer-ex 21 | works properly and response is as expected 22 | """ 23 | service_name = f"perl-{VARS.SHORT_VERSION}-testing" 24 | assert self.oc_api.deploy_s2i_app( 25 | image_name=VARS.IMAGE_NAME, app="https://github.com/sclorg/dancer-ex.git", 26 | context=".", 27 | service_name=service_name 28 | ) 29 | assert self.oc_api.is_s2i_pod_running(pod_name_prefix=service_name, cycle_count=480) 30 | assert self.oc_api.check_response_inside_cluster( 31 | name_in_template=service_name, expected_output="Welcome to your Dancer application on OpenShift" 32 | ) 33 | -------------------------------------------------------------------------------- /test/test_ocp_deploy_templates.py: -------------------------------------------------------------------------------- 1 | from container_ci_suite.openshift import OpenShiftAPI 2 | 3 | from conftest import VARS 4 | 5 | 6 | class TestDeployTemplate: 7 | 8 | def setup_method(self): 9 | self.oc_api = OpenShiftAPI( 10 | pod_name_prefix=f"perl-{VARS.SHORT_VERSION}-testing", 11 | version=VARS.SHORT_VERSION, 12 | shared_cluster=True 13 | ) 14 | 15 | def teardown_method(self): 16 | self.oc_api.delete_project() 17 | 18 | def test_perl_template_inside_cluster(self): 19 | """ 20 | Test checks if local imagestream and local sample app 21 | works properly and response is as expected. 22 | The response is taken from POD `command-app` 23 | executed inside the same project. 24 | """ 25 | self.oc_api.import_is("imagestreams/perl-rhel.json", "", skip_check=True) 26 | service_name = f"perl-{VARS.SHORT_VERSION}-testing" 27 | assert self.oc_api.deploy_template_with_image( 28 | image_name=VARS.IMAGE_NAME, 29 | template="examples/templates/sample-test-app.json", 30 | name_in_template="perl", 31 | openshift_args=[ 32 | "SOURCE_REPOSITORY_REF=master", 33 | f"VERSION={VARS.SHORT_VERSION}", 34 | f"NAME={service_name}" 35 | ] 36 | ) 37 | assert self.oc_api.is_template_deployed(name_in_template=service_name, timeout=480) 38 | assert self.oc_api.check_response_inside_cluster( 39 | name_in_template=service_name, expected_output="Everything is OK" 40 | ) 41 | -------------------------------------------------------------------------------- /test/test_ocp_helm_dancer_app.py: -------------------------------------------------------------------------------- 1 | from container_ci_suite.helm import HelmChartsAPI 2 | 3 | from conftest import VARS 4 | 5 | 6 | class TestHelmPerlDancerAppTemplate: 7 | 8 | def setup_method(self): 9 | package_name = "redhat-perl-dancer-application" 10 | self.hc_api = HelmChartsAPI( 11 | path=VARS.TEST_DIR, 12 | package_name=package_name, 13 | tarball_dir=VARS.TEST_DIR, 14 | shared_cluster=True 15 | ) 16 | self.hc_api.clone_helm_chart_repo( 17 | repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", 18 | subdir="charts/redhat" 19 | ) 20 | 21 | def teardown_method(self): 22 | self.hc_api.delete_project() 23 | 24 | def test_dancer_application_helm_test(self): 25 | """ 26 | Test checks if Helm imagestream and Helm perl dancer application 27 | works properly and response is as expected. 28 | """ 29 | self.hc_api.package_name = "redhat-perl-imagestreams" 30 | assert self.hc_api.helm_package() 31 | assert self.hc_api.helm_installation() 32 | self.hc_api.package_name = "redhat-perl-dancer-application" 33 | assert self.hc_api.helm_package() 34 | assert self.hc_api.helm_installation( 35 | values={ 36 | "perl_version": f"{VARS.VERSION_NO_FCGID}{VARS.TAG}", 37 | "namespace": self.hc_api.namespace 38 | } 39 | ) 40 | assert self.hc_api.is_s2i_pod_running(pod_name_prefix="dancer-example", timeout=400) 41 | assert self.hc_api.test_helm_chart(expected_str=["Welcome to your Dancer application"]) 42 | -------------------------------------------------------------------------------- /test/test_ocp_helm_dancer_mysql_template.py: -------------------------------------------------------------------------------- 1 | from container_ci_suite.helm import HelmChartsAPI 2 | 3 | from conftest import VARS, skip_helm_charts_tests 4 | 5 | 6 | class TestHelmPerlDancerMysqlAppTemplate: 7 | 8 | def setup_method(self): 9 | package_name = "redhat-perl-dancer-application" 10 | self.hc_api = HelmChartsAPI(path=VARS.TEST_DIR, package_name=package_name, tarball_dir=VARS.TEST_DIR) 11 | self.hc_api.clone_helm_chart_repo( 12 | repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", 13 | subdir="charts/redhat" 14 | ) 15 | 16 | def teardown_method(self): 17 | self.hc_api.delete_project() 18 | 19 | def test_dancer_application_helm_test(self): 20 | """ 21 | Test checks if Helm imagestream and Helm perl dancer application 22 | works properly and response is as expected. 23 | """ 24 | skip_helm_charts_tests() 25 | self.hc_api.package_name = "redhat-perl-imagestreams" 26 | assert self.hc_api.helm_package() 27 | assert self.hc_api.helm_installation() 28 | self.hc_api.package_name = "redhat-perl-dancer-application" 29 | assert self.hc_api.helm_package() 30 | assert self.hc_api.helm_installation( 31 | values={ 32 | "perl_version": f"{VARS.VERSION_NO_FCGID}{VARS.TAG}", 33 | "namespace": self.hc_api.namespace 34 | } 35 | ) 36 | assert self.hc_api.is_s2i_pod_running(pod_name_prefix="dancer-example", timeout=480) 37 | assert self.hc_api.test_helm_chart(expected_str=["Welcome to your Dancer application"]) 38 | -------------------------------------------------------------------------------- /test/test_ocp_helm_perl_imagestreams.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from container_ci_suite.helm import HelmChartsAPI 4 | 5 | from conftest import VARS 6 | 7 | 8 | class TestHelmRHELPerlImageStreams: 9 | 10 | def setup_method(self): 11 | package_name = "redhat-perl-imagestreams" 12 | self.hc_api = HelmChartsAPI( 13 | path=VARS.TEST_DIR, 14 | package_name=package_name, 15 | tarball_dir=VARS.TEST_DIR, 16 | shared_cluster=True 17 | ) 18 | self.hc_api.clone_helm_chart_repo( 19 | repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", 20 | subdir="charts/redhat" 21 | ) 22 | 23 | def teardown_method(self): 24 | self.hc_api.delete_project() 25 | 26 | @pytest.mark.parametrize( 27 | "version,registry,expected", 28 | [ 29 | ("5.40-ubi10", "registry.redhat.io/ubi10/perl-540:latest", True), 30 | ("5.32-ubi9", "registry.redhat.io/ubi9/perl-532:latest", True), 31 | ("5.32-ubi8", "registry.redhat.io/ubi8/perl-532:latest", False), 32 | ("5.26-ubi8", "registry.redhat.io/ubi8/perl-526:latest", True), 33 | ], 34 | ) 35 | def test_package_imagestream(self, version, registry, expected): 36 | """ 37 | Test checks if Helm imagestreams are present 38 | """ 39 | assert self.hc_api.helm_package() 40 | assert self.hc_api.helm_installation() 41 | assert self.hc_api.check_imagestreams(version=version, registry=registry) == expected 42 | -------------------------------------------------------------------------------- /test/test_ocp_imagestreams_quickstart.py: -------------------------------------------------------------------------------- 1 | from container_ci_suite.openshift import OpenShiftAPI 2 | 3 | 4 | from conftest import VARS, skip_helm_charts_tests 5 | 6 | 7 | # Replacement with 'test_perl_s2i_templates' 8 | class TestImagestreamsQuickstart: 9 | 10 | def setup_method(self): 11 | self.oc_api = OpenShiftAPI( 12 | pod_name_prefix=f"perl-{VARS.SHORT_VERSION}-testing", 13 | version=VARS.SHORT_VERSION, 14 | shared_cluster=True 15 | ) 16 | 17 | def teardown_method(self): 18 | self.oc_api.delete_project() 19 | 20 | def test_perl_template_inside_cluster(self): 21 | """ 22 | Test checks if local imagestream and local sample app 23 | works properly and response is as expected. 24 | The response is taken from POD `command-app` 25 | executed inside the same project. 26 | """ 27 | skip_helm_charts_tests() 28 | service_name = f"perl-{VARS.SHORT_VERSION}-testing" 29 | assert self.oc_api.imagestream_quickstart( 30 | imagestream_file="imagestreams/perl-rhel.json", 31 | template_file="examples/templates/sample-test-app.json", 32 | image_name=VARS.IMAGE_NAME, 33 | name_in_template="perl", 34 | openshift_args=[ 35 | "SOURCE_REPOSITORY_REF=master", 36 | f"VERSION={VARS.VERSION_NO_FCGID}{VARS.TAG}", 37 | f"NAME={service_name}" 38 | ] 39 | ) 40 | assert self.oc_api.is_template_deployed(name_in_template=service_name, timeout=480) 41 | assert self.oc_api.check_response_inside_cluster( 42 | name_in_template=service_name, expected_output="Everything is OK" 43 | ) 44 | -------------------------------------------------------------------------------- /test/test_ocp_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | from container_ci_suite.imagestreams import ImageStreamChecker 2 | 3 | from conftest import VARS 4 | 5 | 6 | # Replacement with 'test_latest_imagestreams' 7 | class TestLatestImagestreams: 8 | 9 | def setup_method(self): 10 | self.isc = ImageStreamChecker(working_dir=VARS.TEST_DIR.parent.parent) 11 | 12 | def test_latest_imagestream(self): 13 | """ 14 | Test checks if local imagestream is the latest one 15 | """ 16 | self.latest_version = self.isc.get_latest_version() 17 | assert self.latest_version != "" 18 | self.isc.check_imagestreams(self.latest_version) 19 | -------------------------------------------------------------------------------- /test/warningonstderr/index.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | print "Content-type: text/plain\n\n"; 3 | warn "Warning on stderr\n"; 4 | print "Text in HTTP body\n"; 5 | --------------------------------------------------------------------------------