├── .github ├── ISSUE_TEMPLATE │ ├── brew-issue.md │ ├── config.yml │ ├── den-issue.md │ ├── feature_request.md │ └── image-issue.md ├── dependabot.yml └── workflows │ ├── build-documentation.yml │ ├── docker-image-dashboard.yml │ ├── docker-image-dnsmasq.yml │ ├── docker-image-elasticsearch.yml │ ├── docker-image-magepack.yml │ ├── docker-image-mailhog.yml │ ├── docker-image-mariadb.yml │ ├── docker-image-mysql.yml │ ├── docker-image-nginx.yml │ ├── docker-image-opensearch.yml │ ├── docker-image-php-fpm.yml │ ├── docker-image-rabbitmq.yml │ ├── docker-image-redis.yml │ ├── docker-image-varnish.yml │ ├── pages.yml │ ├── php-matrix │ ├── blackfire-generator.php │ ├── constants.php │ ├── full-generator.php │ ├── node-generator.php │ └── php-generator.php │ ├── push-release-to-brew.yml │ └── tag-release.yml ├── .gitignore ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bin └── den ├── commands ├── blackfire.cmd ├── blackfire.help ├── db.cmd ├── db.help ├── debug.cmd ├── debug.help ├── env-init.cmd ├── env-init.help ├── env.cmd ├── env.help ├── install.cmd ├── redis.cmd ├── redis.help ├── shell.cmd ├── shell.help ├── sign-certificate.cmd ├── sign-certificate.help ├── status.cmd ├── status.help ├── svc.cmd ├── svc.help ├── sync.cmd ├── sync.help ├── usage.cmd ├── usage.help ├── version.cmd ├── vnc.cmd └── vnc.help ├── config ├── openssl │ ├── certificate.conf │ └── rootca.conf └── traefik │ └── traefik.yml ├── docker ├── docker-compose.yml └── portainer-service.yml ├── docs ├── .gitignore ├── Makefile ├── changelog.md ├── conf.py ├── configuration.md ├── configuration │ ├── alternative-shells.md │ ├── blackfire.md │ ├── database.md │ ├── dns-resolver.md │ ├── elasticsearch.md │ ├── livereload.md │ ├── magento2-testing.md │ ├── mftf.md │ ├── multipledomains.md │ ├── reporting.md │ ├── screenshots │ │ ├── 123906068-2ed7d180-d97c-11eb-9e52-ec48f6753ee7.png │ │ ├── 123906280-8a09c400-d97c-11eb-9558-cb513f89e4c3.png │ │ ├── 66998481-a0062100-f0d4-11e9-8cc0-a5691fee59c5.png │ │ ├── 66998483-a09eb780-f0d4-11e9-9643-8fe63dd62aad.png │ │ ├── allure-reporting.png │ │ ├── livereload.png │ │ ├── mysql-workbench-connection.png │ │ ├── navicat-connection-config.png │ │ ├── navicat-ssh-tunnel-config.png │ │ ├── phpstorm-additional-xdebug-configs.png │ │ ├── remmina-ssh-tunnel.png │ │ ├── selenium-remote-desktop-viewer.png │ │ ├── sequel-pro-connection.png │ │ ├── tableplus-connection.png │ │ └── xdebug-phpstorm.png │ └── xdebug.md ├── environments.md ├── environments │ ├── customizing.md │ ├── magento2.md │ ├── shopware.md │ └── types.md ├── images.md ├── index.md ├── installing.md ├── requirements.txt ├── services.md └── usage.md ├── environments ├── drupal │ ├── db.base.yml │ ├── drupal.base.yml │ ├── drupal.darwin.yml │ ├── drupal.mutagen.yml │ ├── drupal.settings.base.yml │ ├── init.env │ └── init.env.cmd ├── includes │ ├── allure.base.yml │ ├── blackfire.base.yml │ ├── blackfire.darwin.yml │ ├── blackfire.linux.yml │ ├── db.base.yml │ ├── elastichq.base.yml │ ├── elasticsearch.base.yml │ ├── networks.base.yml │ ├── nginx.base.yml │ ├── nginx.darwin.yml │ ├── opensearch.base.yml │ ├── php-fpm.base.yml │ ├── php-fpm.darwin.yml │ ├── php-fpm.linux.yml │ ├── rabbitmq.base.yml │ ├── redis.base.yml │ ├── selenium.base.yml │ └── varnish.base.yml ├── laravel │ ├── db.base.yml │ ├── init.env │ └── laravel.base.yml ├── local │ └── local.base.yml ├── magento-cloud │ ├── init.env │ ├── init.env.cmd │ └── magento-cloud.base.yml ├── magento1 │ ├── db.base.yml │ ├── init.env │ ├── magento1.base.yml │ ├── magento1.blackfire.darwin.yml │ ├── magento1.darwin.yml │ └── magento1.mutagen.yml ├── magento2 │ ├── db.base.yml │ ├── init.env │ ├── magento2.base.yml │ ├── magento2.blackfire.darwin.yml │ ├── magento2.darwin.yml │ ├── magento2.magepack.base.yml │ ├── magento2.magepack.darwin.yml │ ├── magento2.magepack.linux.yml │ ├── magento2.mutagen.yml │ ├── magento2.splitdb.checkout.base.yml │ ├── magento2.splitdb.sales.base.yml │ └── magento2.tests.base.yml ├── shopware │ ├── db.base.yml │ ├── init.env │ ├── shopware.base.yml │ ├── shopware.darwin.yml │ └── shopware.mutagen.yml ├── symfony │ ├── db.base.yml │ ├── init.env │ └── symfony.base.yml └── wordpress │ ├── db.base.yml │ ├── init.env │ └── wordpress.base.yml ├── images ├── .trigger ├── dashboard │ ├── Dockerfile │ ├── den_entrypoint │ ├── img │ │ └── Dnsmasq_icon.svg │ └── index.html ├── dnsmasq │ ├── Dockerfile │ ├── LICENSE.md │ └── dnsmasq.conf ├── elasticsearch │ └── Dockerfile ├── magepack │ ├── Dockerfile │ └── bin │ │ ├── bundle.sh │ │ └── generate.sh ├── mailhog │ └── Dockerfile ├── mariadb │ └── Dockerfile ├── mysql │ ├── .trigger │ ├── Dockerfile │ └── etc │ │ └── mysql │ │ └── conf.d │ │ └── skip-bin-log.cnf ├── nginx │ ├── Dockerfile │ └── etc │ │ └── nginx │ │ ├── available.d │ │ ├── application.conf │ │ ├── drupal.conf │ │ ├── magento1.conf │ │ └── magento2.conf │ │ ├── conf.d │ │ └── default.conf │ │ └── fastcgi_params ├── opensearch │ └── Dockerfile ├── php-fpm │ ├── .trigger │ ├── Dockerfile │ ├── blackfire │ │ └── Dockerfile │ ├── context │ │ ├── blackfire │ │ │ └── etc │ │ │ │ └── php.d │ │ │ │ └── zz-blackfire.ini │ │ ├── docker-entrypoint │ │ ├── etc │ │ │ ├── php-cli.ini │ │ │ ├── php-fpm-fcgi.ini │ │ │ ├── php.d │ │ │ │ ├── 01-php.ini │ │ │ │ ├── 05-additions.ini.template │ │ │ │ ├── 10-opcache.ini │ │ │ │ └── 11-apc.ini │ │ │ └── profile.d │ │ │ │ ├── bind.sh │ │ │ │ ├── path.sh │ │ │ │ └── ps1.sh │ │ └── xdebug3 │ │ │ └── etc │ │ │ ├── php-cli.ini │ │ │ ├── php-fpm-fcgi.ini │ │ │ └── php.d │ │ │ ├── 15-xdebug3.2.ini.template │ │ │ └── 15-xdebug3.ini.template │ ├── magento1 │ │ ├── Dockerfile │ │ ├── blackfire │ │ │ └── Dockerfile │ │ └── xdebug3 │ │ │ └── Dockerfile │ ├── magento2 │ │ ├── Dockerfile │ │ ├── blackfire │ │ │ └── Dockerfile │ │ └── xdebug3 │ │ │ └── Dockerfile │ ├── node │ │ └── Dockerfile │ └── xdebug3 │ │ └── Dockerfile ├── rabbitmq │ └── Dockerfile ├── redis │ └── Dockerfile └── varnish │ ├── Dockerfile │ ├── Dockerfile.legacy │ ├── Dockerfile.lts │ └── default.vcl ├── utils ├── core.sh ├── env.sh └── install.sh └── version /.github/ISSUE_TEMPLATE/brew-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Installing or Upgrading through Homebrew 3 | about: Report an issue with the Den software when installing or upgrading through Homebrew 4 | title: '' 5 | labels: bug, brew update 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Version of Homebrew** 11 | Run `brew -v` and provide the output 12 | 13 | **Operating System and Installation Method** 14 | Please tell us which operating system you're running brew on. (E.g. "Mac OS 12.6") 15 | 16 | **Describe the bug** 17 | A clear and concise description of what the bug is. 18 | 19 | **To Reproduce** 20 | Steps to reproduce the behavior: 21 | 1. Go to '...' 22 | 2. Click on '....' 23 | 3. Scroll down to '....' 24 | 4. See error 25 | 26 | **Expected behavior** 27 | A clear and concise description of what you expected to happen. 28 | 29 | **Screenshots** 30 | If applicable, add screenshots to help explain your problem. 31 | 32 | **Additional context** 33 | Add any other context about the problem here. 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/den-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Den Command Issue 3 | about: Report an issue with the Den software (e.g. `den` commands or sync) 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Version of Den** 11 | Run `den version` and provide the output 12 | 13 | **Operating System and Installation Method** 14 | Please tell us how you installed Den and on what operating system. (E.g. "Mac OS 12.6 via Brew") 15 | 16 | **Describe the bug** 17 | A clear and concise description of what the bug is. 18 | 19 | **To Reproduce** 20 | Steps to reproduce the behavior: 21 | 1. Go to '...' 22 | 2. Click on '....' 23 | 3. Scroll down to '....' 24 | 4. See error 25 | 26 | **Expected behavior** 27 | A clear and concise description of what you expected to happen. 28 | 29 | **Screenshots** 30 | If applicable, add screenshots to help explain your problem. 31 | 32 | **Additional context** 33 | Add any other context about the problem here. 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/image-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Image Issue 3 | about: Report an issue with an Image or Service not working as expected 4 | title: '' 5 | labels: bug, images update 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Version of Den** 11 | Run `den version` and provide the output 12 | 13 | **Image** 14 | Please tell us which image and version you're experiencing the issue with. For example, `php-fpm-magento2:7.4-node14`. If you're unsure, you can run `den env config` and check the `image` key underneath the service you're having the issue with. If this isn't working, please provide your `.env` file. 15 | 16 | **Describe the bug** 17 | A clear and concise description of what the bug is. 18 | 19 | **To Reproduce** 20 | Steps to reproduce the behavior: 21 | 1. Go to '...' 22 | 2. Click on '....' 23 | 3. Scroll down to '....' 24 | 4. See error 25 | 26 | **Expected behavior** 27 | A clear and concise description of what you expected to happen. 28 | 29 | **Screenshots** 30 | If applicable, add screenshots to help explain your problem. 31 | 32 | **Additional context** 33 | Add any other context about the problem here. 34 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | - package-ecosystem: "pip" 13 | directory: "/docs" 14 | schedule: 15 | interval: "daily" 16 | - package-ecosystem: "docker" 17 | directory: "/images/varnish" 18 | schedule: 19 | interval: "daily" 20 | - package-ecosystem: "docker" 21 | directory: "/images/redis" 22 | schedule: 23 | interval: "daily" 24 | - package-ecosystem: "docker" 25 | directory: "/images/rabbitmq" 26 | schedule: 27 | interval: "daily" 28 | - package-ecosystem: "docker" 29 | directory: "/images/php-fpm" 30 | schedule: 31 | interval: "daily" 32 | - package-ecosystem: "docker" 33 | directory: "/images/php-fpm/xdebug3" 34 | schedule: 35 | interval: "daily" 36 | - package-ecosystem: "docker" 37 | directory: "/images/php-fpm/node" 38 | schedule: 39 | interval: "daily" 40 | - package-ecosystem: "docker" 41 | directory: "/images/php-fpm/magento2" 42 | schedule: 43 | interval: "daily" 44 | - package-ecosystem: "docker" 45 | directory: "/images/php-fpm/magento2/xdebug3" 46 | schedule: 47 | interval: "daily" 48 | - package-ecosystem: "docker" 49 | directory: "/images/php-fpm/magento2/blackfire" 50 | schedule: 51 | interval: "daily" 52 | - package-ecosystem: "docker" 53 | directory: "/images/php-fpm/magento1" 54 | schedule: 55 | interval: "daily" 56 | - package-ecosystem: "docker" 57 | directory: "/images/php-fpm/magento1/xdebug3" 58 | schedule: 59 | interval: "daily" 60 | - package-ecosystem: "docker" 61 | directory: "/images/php-fpm/magento1/blackfire" 62 | schedule: 63 | interval: "daily" 64 | - package-ecosystem: "docker" 65 | directory: "/images/php-fpm/blackfire" 66 | schedule: 67 | interval: "daily" 68 | - package-ecosystem: "docker" 69 | directory: "/images/opensearch" 70 | schedule: 71 | interval: "daily" 72 | - package-ecosystem: "docker" 73 | directory: "/images/nginx" 74 | schedule: 75 | interval: "daily" 76 | - package-ecosystem: "docker" 77 | directory: "/images/mysql" 78 | schedule: 79 | interval: "daily" 80 | - package-ecosystem: "docker" 81 | directory: "/images/mariadb" 82 | schedule: 83 | interval: "daily" 84 | - package-ecosystem: "docker" 85 | directory: "/images/mailhog" 86 | schedule: 87 | interval: "daily" 88 | - package-ecosystem: "docker" 89 | directory: "/images/magepack" 90 | schedule: 91 | interval: "daily" 92 | - package-ecosystem: "docker" 93 | directory: "/images/elasticsearch" 94 | schedule: 95 | interval: "daily" 96 | - package-ecosystem: "docker" 97 | directory: "/images/dnsmasq" 98 | schedule: 99 | interval: "daily" 100 | - package-ecosystem: "docker" 101 | directory: "/images/dashboard" 102 | schedule: 103 | interval: "daily" 104 | -------------------------------------------------------------------------------- /.github/workflows/build-documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build documentation 2 | on: 3 | push: 4 | paths: 5 | - docs/** 6 | - .github/workflows/build-documentation.yml 7 | - CHANGELOG.md 8 | 9 | jobs: 10 | build-documentation: 11 | name: Build Documentation 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v3 16 | - name: Run Sphinx documentation build 17 | uses: ammaraskar/sphinx-action@0.4 18 | with: 19 | docs-folder: "docs/" 20 | - name: Upload documentation artifact 21 | uses: actions/upload-artifact@v3 22 | with: 23 | name: documentation 24 | path: docs/_build/html/ 25 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-dashboard.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Den Dashboard 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/dashboard/** 9 | - .github/workflows/*dashboard* 10 | 11 | jobs: 12 | dashboard: 13 | name: Den Dashboard 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: docker/setup-qemu-action@v2 19 | - uses: docker/setup-buildx-action@v2 20 | 21 | - name: Login to Github Container Registry 22 | uses: docker/login-action@v2 23 | with: 24 | registry: ghcr.io 25 | username: ${{ github.repository_owner }} 26 | password: ${{ secrets.GITHUB_TOKEN }} 27 | if: ${{ !env.ACT }} 28 | 29 | - name: Login to Docker Hub 30 | uses: docker/login-action@v2 31 | with: 32 | username: ${{ secrets.DOCKER_USERNAME }} 33 | password: ${{ secrets.DOCKER_PASSWORD }} 34 | if: ${{ !env.ACT }} 35 | 36 | - uses: docker/build-push-action@v3 37 | with: 38 | context: images/dashboard 39 | platforms: linux/amd64,linux/arm64 40 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 41 | tags: ghcr.io/${{ github.repository_owner }}/den-dashboard:latest 42 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-dnsmasq.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image DNSMasq 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/dnsmasq/** 9 | - .github/workflows/*dnsmasq* 10 | 11 | jobs: 12 | dnsmasq: 13 | name: DNSMasq 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: docker/setup-qemu-action@v2 19 | - uses: docker/setup-buildx-action@v2 20 | 21 | - name: Login to Github Container Registry 22 | uses: docker/login-action@v2 23 | with: 24 | registry: ghcr.io 25 | username: ${{ github.repository_owner }} 26 | password: ${{ secrets.GITHUB_TOKEN }} 27 | if: ${{ !env.ACT }} 28 | 29 | - name: Login to Docker Hub 30 | uses: docker/login-action@v2 31 | with: 32 | username: ${{ secrets.DOCKER_USERNAME }} 33 | password: ${{ secrets.DOCKER_PASSWORD }} 34 | if: ${{ !env.ACT }} 35 | 36 | - uses: docker/build-push-action@v3 37 | with: 38 | context: images/dnsmasq 39 | platforms: linux/amd64,linux/arm64 40 | build-args: WEBPROC_VERSION=0.4.0 41 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 42 | tags: ghcr.io/${{ github.repository_owner }}/den-dnsmasq:latest 43 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-elasticsearch.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Elasticsearch 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/elasticsearch/** 9 | - .github/workflows/*elasticsearch* 10 | 11 | jobs: 12 | elasticsearch: 13 | name: Elasticsearch 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "5" 21 | - "6" 22 | - "7.6" 23 | - "7.7" 24 | - "7.9" 25 | - "7.10" 26 | - "7.12" 27 | - "7.13" 28 | - "7.14" 29 | - "7.15" 30 | - "7.16" 31 | - "7.17" 32 | - "8.0" 33 | - "8.1" 34 | - "8.2" 35 | - "8.3" 36 | - "8.4" 37 | - "8.5" 38 | - "8.6" 39 | steps: 40 | - uses: actions/checkout@v3 41 | - uses: docker/setup-qemu-action@v2 42 | - uses: docker/setup-buildx-action@v2 43 | 44 | - name: Login to Github Container Registry 45 | uses: docker/login-action@v2 46 | with: 47 | registry: ghcr.io 48 | username: ${{ github.repository_owner }} 49 | password: ${{ secrets.GITHUB_TOKEN }} 50 | if: ${{ !env.ACT }} 51 | 52 | - name: Login to Docker Hub 53 | uses: docker/login-action@v2 54 | with: 55 | username: ${{ secrets.DOCKER_USERNAME }} 56 | password: ${{ secrets.DOCKER_PASSWORD }} 57 | if: ${{ !env.ACT }} 58 | 59 | - name: Set build-args 60 | run: |- 61 | ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')" 62 | ES_VERSION=$( 63 | docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls docker.elastic.co/elasticsearch/elasticsearch \ 64 | | egrep "^${ESCAPED_VERSION}\.[0-9]+(\.[0-9]+)?\$" | sort -Vr | head -n1 65 | ) 66 | echo "ES_VERSION=${ES_VERSION}" | tee /dev/stderr >> $GITHUB_ENV 67 | 68 | - uses: docker/build-push-action@v3 69 | with: 70 | context: images/elasticsearch 71 | platforms: linux/amd64,linux/arm64 72 | build-args: ES_VERSION=${{ env.ES_VERSION }} 73 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 74 | tags: ghcr.io/${{ github.repository_owner }}/den-elasticsearch:${{ matrix.version }} 75 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-magepack.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Magepack 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/magepack/** 9 | - .github/workflows/*magepack* 10 | 11 | jobs: 12 | magepack: 13 | name: Magepack 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "2.3" 21 | - "2.4" 22 | - "2.5" 23 | - "2.6" 24 | - "2.7" 25 | - "2.8" 26 | - "2.9" 27 | - "2.10" 28 | - "2.11" 29 | 30 | steps: 31 | - uses: actions/checkout@v3 32 | - uses: docker/setup-qemu-action@v2 33 | - uses: docker/setup-buildx-action@v2 34 | 35 | - name: Login to Github Container Registry 36 | uses: docker/login-action@v2 37 | with: 38 | registry: ghcr.io 39 | username: ${{ github.repository_owner }} 40 | password: ${{ secrets.GITHUB_TOKEN }} 41 | if: ${{ !env.ACT }} 42 | 43 | - name: Login to Docker Hub 44 | uses: docker/login-action@v2 45 | with: 46 | username: ${{ secrets.DOCKER_USERNAME }} 47 | password: ${{ secrets.DOCKER_PASSWORD }} 48 | if: ${{ !env.ACT }} 49 | 50 | - uses: docker/build-push-action@v3 51 | with: 52 | context: images/magepack 53 | platforms: linux/amd64,linux/arm64 54 | build-args: MAGEPACK_VERSION=${{ matrix.version }} 55 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 56 | tags: ghcr.io/${{ github.repository_owner }}/den-magepack:${{ matrix.version }} 57 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-mailhog.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image MailHog 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/mailhog/** 9 | - .github/workflows/*mailhog* 10 | 11 | jobs: 12 | mailhog: 13 | name: MailHog 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "1.0" 21 | 22 | steps: 23 | - uses: actions/checkout@v3 24 | - uses: docker/setup-qemu-action@v2 25 | - uses: docker/setup-buildx-action@v2 26 | 27 | - name: Login to Github Container Registry 28 | uses: docker/login-action@v2 29 | with: 30 | registry: ghcr.io 31 | username: ${{ github.repository_owner }} 32 | password: ${{ secrets.GITHUB_TOKEN }} 33 | if: ${{ !env.ACT }} 34 | 35 | - name: Login to Docker Hub 36 | uses: docker/login-action@v2 37 | with: 38 | username: ${{ secrets.DOCKER_USERNAME }} 39 | password: ${{ secrets.DOCKER_PASSWORD }} 40 | if: ${{ !env.ACT }} 41 | 42 | - uses: docker/build-push-action@v3 43 | with: 44 | context: images/mailhog 45 | platforms: linux/amd64,linux/arm64 46 | build-args: MAILHOG_VERSION=${{ matrix.version }} 47 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 48 | tags: ghcr.io/${{ github.repository_owner }}/den-mailhog:${{ matrix.version }} 49 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-mariadb.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image MariaDB 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/mariadb/** 9 | - .github/workflows/*mariadb* 10 | 11 | jobs: 12 | mariadb: 13 | name: MariaDB 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "10.0" 21 | - "10.1" 22 | - "10.2" 23 | - "10.3" 24 | - "10.4" 25 | - "10.5" 26 | - "10.6" 27 | - "10.7" 28 | - "10.8" 29 | - "10.9" 30 | - "10.10" 31 | - "10.11" 32 | include: 33 | - version: "11.0" 34 | modifier: "-rc" 35 | 36 | steps: 37 | - uses: actions/checkout@v3 38 | - uses: docker/setup-qemu-action@v2 39 | - uses: docker/setup-buildx-action@v2 40 | 41 | - name: Login to Github Container Registry 42 | uses: docker/login-action@v2 43 | with: 44 | registry: ghcr.io 45 | username: ${{ github.repository_owner }} 46 | password: ${{ secrets.GITHUB_TOKEN }} 47 | if: ${{ !env.ACT }} 48 | 49 | - name: Login to Docker Hub 50 | uses: docker/login-action@v2 51 | with: 52 | username: ${{ secrets.DOCKER_USERNAME }} 53 | password: ${{ secrets.DOCKER_PASSWORD }} 54 | if: ${{ !env.ACT }} 55 | 56 | - uses: docker/build-push-action@v3 57 | with: 58 | context: images/mariadb 59 | platforms: linux/amd64,linux/arm64 60 | build-args: MARIADB_VERSION=${{ matrix.version }}${{ matrix.modifier }} 61 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 62 | tags: ghcr.io/${{ github.repository_owner }}/den-mariadb:${{ matrix.version }}${{ matrix.modifier }} 63 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-mysql.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image MySQL 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/mysql/** 9 | - .github/workflows/*mysql* 10 | 11 | jobs: 12 | mysql: 13 | name: MySQL 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "8.0.28" 21 | - "8.0" 22 | 23 | steps: 24 | - uses: actions/checkout@v3 25 | - uses: docker/setup-qemu-action@v2 26 | - uses: docker/setup-buildx-action@v2 27 | 28 | - name: Login to Github Container Registry 29 | uses: docker/login-action@v2 30 | with: 31 | registry: ghcr.io 32 | username: ${{ github.repository_owner }} 33 | password: ${{ secrets.GITHUB_TOKEN }} 34 | if: ${{ !env.ACT }} 35 | 36 | - name: Login to Docker Hub 37 | uses: docker/login-action@v2 38 | with: 39 | username: ${{ secrets.DOCKER_USERNAME }} 40 | password: ${{ secrets.DOCKER_PASSWORD }} 41 | if: ${{ !env.ACT }} 42 | 43 | - name: Set build-args 44 | run: |- 45 | ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')" 46 | MYSQL_VERSION=$( 47 | docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls mysql \ 48 | | egrep "^${ESCAPED_VERSION}(\.[0-9]+)?(\.[0-9]+)?(-oracle)?\$" | sort -Vr | head -n1 49 | ) 50 | echo "MYSQL_VERSION=${MYSQL_VERSION}" | tee /dev/stderr >> $GITHUB_ENV 51 | 52 | - uses: docker/build-push-action@v3 53 | with: 54 | context: images/mysql 55 | platforms: linux/amd64,linux/arm64 56 | build-args: MYSQL_VERSION=${{ env.MYSQL_VERSION }} 57 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 58 | tags: ghcr.io/${{ github.repository_owner }}/den-mysql:${{ matrix.version }} 59 | mysql-legacy: 60 | name: MySQL Legacy 61 | runs-on: ubuntu-latest 62 | 63 | strategy: 64 | fail-fast: false 65 | matrix: 66 | version: 67 | - "5.5" 68 | - "5.6" 69 | - "5.7" 70 | 71 | steps: 72 | - uses: actions/checkout@v3 73 | - uses: docker/setup-qemu-action@v2 74 | - uses: docker/setup-buildx-action@v2 75 | 76 | - name: Login to Github Container Registry 77 | uses: docker/login-action@v2 78 | with: 79 | registry: ghcr.io 80 | username: ${{ github.repository_owner }} 81 | password: ${{ secrets.GITHUB_TOKEN }} 82 | if: ${{ !env.ACT }} 83 | 84 | - name: Login to Docker Hub 85 | uses: docker/login-action@v2 86 | with: 87 | username: ${{ secrets.DOCKER_USERNAME }} 88 | password: ${{ secrets.DOCKER_PASSWORD }} 89 | if: ${{ !env.ACT }} 90 | 91 | - name: Set build-args 92 | run: |- 93 | ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')" 94 | MYSQL_VERSION=$( 95 | docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls mysql \ 96 | | egrep "^${ESCAPED_VERSION}(\.[0-9]+)?(\.[0-9]+)?(-oracle)?\$" | sort -Vr | head -n1 97 | ) 98 | echo "MYSQL_VERSION=${MYSQL_VERSION}" | tee /dev/stderr >> $GITHUB_ENV 99 | 100 | - uses: docker/build-push-action@v3 101 | with: 102 | context: images/mysql 103 | platforms: linux/amd64 104 | build-args: MYSQL_VERSION=${{ env.MYSQL_VERSION }} 105 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 106 | tags: ghcr.io/${{ github.repository_owner }}/den-mysql:${{ matrix.version }} -------------------------------------------------------------------------------- /.github/workflows/docker-image-nginx.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Nginx 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/nginx/** 9 | - .github/workflows/*nginx* 10 | 11 | jobs: 12 | nginx: 13 | name: Nginx 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "1.16" 21 | - "1.17" 22 | - "1.18" 23 | - "1.19" 24 | - "1.20" 25 | - "1.21" 26 | - "1.22" 27 | - "1.23" 28 | 29 | steps: 30 | - uses: actions/checkout@v3 31 | - uses: docker/setup-qemu-action@v2 32 | - uses: docker/setup-buildx-action@v2 33 | 34 | - name: Login to Github Container Registry 35 | uses: docker/login-action@v2 36 | with: 37 | registry: ghcr.io 38 | username: ${{ github.repository_owner }} 39 | password: ${{ secrets.GITHUB_TOKEN }} 40 | if: ${{ !env.ACT }} 41 | 42 | - name: Login to Docker Hub 43 | uses: docker/login-action@v2 44 | with: 45 | username: ${{ secrets.DOCKER_USERNAME }} 46 | password: ${{ secrets.DOCKER_PASSWORD }} 47 | if: ${{ !env.ACT }} 48 | 49 | - uses: docker/build-push-action@v3 50 | with: 51 | context: images/nginx 52 | platforms: linux/amd64,linux/arm64 53 | build-args: NGINX_VERSION=${{ matrix.version }} 54 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 55 | tags: ghcr.io/${{ github.repository_owner }}/den-nginx:${{ matrix.version }} 56 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-opensearch.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image OpenSearch 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/opensearch/** 9 | - .github/workflows/*opensearch* 10 | 11 | jobs: 12 | opensearch: 13 | name: OpenSearch 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "1.1" 21 | - "1.2" 22 | - "1.3" 23 | - "2.0" 24 | - "2.1" 25 | - "2.2" 26 | - "2.3" 27 | - "2.4" 28 | - "2.5" 29 | - "2.6" 30 | 31 | steps: 32 | - uses: actions/checkout@v3 33 | - uses: docker/setup-qemu-action@v2 34 | - uses: docker/setup-buildx-action@v2 35 | 36 | - name: Login to Github Container Registry 37 | uses: docker/login-action@v2 38 | with: 39 | registry: ghcr.io 40 | username: ${{ github.repository_owner }} 41 | password: ${{ secrets.GITHUB_TOKEN }} 42 | if: ${{ !env.ACT }} 43 | 44 | - name: Login to Docker Hub 45 | uses: docker/login-action@v2 46 | with: 47 | username: ${{ secrets.DOCKER_USERNAME }} 48 | password: ${{ secrets.DOCKER_PASSWORD }} 49 | if: ${{ !env.ACT }} 50 | 51 | - name: Set build-args 52 | run: |- 53 | ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')" 54 | OPENSEARCH_VERSION=$( 55 | docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls docker.io/opensearchproject/opensearch \ 56 | | egrep "^${ESCAPED_VERSION}\.[0-9]+(\.[0-9]+)?\$" | sort -Vr | head -n1 57 | ) 58 | echo "OPENSEARCH_VERSION=${OPENSEARCH_VERSION}" | tee /dev/stderr >> $GITHUB_ENV 59 | 60 | - uses: docker/build-push-action@v3 61 | with: 62 | context: images/opensearch 63 | platforms: linux/amd64,linux/arm64 64 | build-args: OPENSEARCH_VERSION=${{ env.OPENSEARCH_VERSION }} 65 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 66 | tags: ghcr.io/${{ github.repository_owner }}/den-opensearch:${{ matrix.version }} 67 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-rabbitmq.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image RabbitMQ 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/rabbitmq/** 9 | - .github/workflows/*rabbitmq* 10 | 11 | jobs: 12 | rabbitmq: 13 | name: RabbitMQ 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "3.7" 21 | - "3.8" 22 | - "3.9" 23 | - "3.10" 24 | - "3.11" 25 | 26 | steps: 27 | - uses: actions/checkout@v3 28 | - uses: docker/setup-qemu-action@v2 29 | - uses: docker/setup-buildx-action@v2 30 | 31 | - name: Login to Github Container Registry 32 | uses: docker/login-action@v2 33 | with: 34 | registry: ghcr.io 35 | username: ${{ github.repository_owner }} 36 | password: ${{ secrets.GITHUB_TOKEN }} 37 | if: ${{ !env.ACT }} 38 | 39 | - name: Login to Docker Hub 40 | uses: docker/login-action@v2 41 | with: 42 | username: ${{ secrets.DOCKER_USERNAME }} 43 | password: ${{ secrets.DOCKER_PASSWORD }} 44 | if: ${{ !env.ACT }} 45 | 46 | - uses: docker/build-push-action@v3 47 | with: 48 | context: images/rabbitmq 49 | platforms: linux/amd64,linux/arm64 50 | build-args: RABBITMQ_VERSION=${{ matrix.version }} 51 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 52 | tags: ghcr.io/${{ github.repository_owner }}/den-rabbitmq:${{ matrix.version }} 53 | -------------------------------------------------------------------------------- /.github/workflows/docker-image-redis.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Redis 2 | on: 3 | schedule: 4 | - cron: "0 6 * * *" # 6 AM Daily 5 | push: 6 | paths: 7 | - images/.trigger 8 | - images/redis/** 9 | - .github/workflows/*redis* 10 | 11 | jobs: 12 | redis: 13 | name: Redis 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | version: 20 | - "3.2" 21 | - "4.0" 22 | - "5.0" 23 | - "6.0" 24 | - "6.2" 25 | - "7.0" 26 | 27 | steps: 28 | - uses: actions/checkout@v3 29 | - uses: docker/setup-qemu-action@v2 30 | - uses: docker/setup-buildx-action@v2 31 | 32 | - name: Login to Github Container Registry 33 | uses: docker/login-action@v2 34 | with: 35 | registry: ghcr.io 36 | username: ${{ github.repository_owner }} 37 | password: ${{ secrets.GITHUB_TOKEN }} 38 | if: ${{ !env.ACT }} 39 | 40 | - name: Login to Docker Hub 41 | uses: docker/login-action@v2 42 | with: 43 | username: ${{ secrets.DOCKER_USERNAME }} 44 | password: ${{ secrets.DOCKER_PASSWORD }} 45 | if: ${{ !env.ACT }} 46 | 47 | - uses: docker/build-push-action@v3 48 | with: 49 | context: images/redis 50 | platforms: linux/amd64,linux/arm64 51 | build-args: REDIS_VERSION=${{ matrix.version }} 52 | push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} 53 | tags: ghcr.io/${{ github.repository_owner }}/den-redis:${{ matrix.version }} 54 | -------------------------------------------------------------------------------- /.github/workflows/pages.yml: -------------------------------------------------------------------------------- 1 | # Simple workflow for deploying static content to GitHub Pages 2 | name: Deploy Documentation 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: ["main"] 8 | paths: 9 | - docs/** 10 | - .github/workflows/build-documentation.yml 11 | - CHANGELOG.md 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 17 | permissions: 18 | contents: read 19 | pages: write 20 | id-token: write 21 | 22 | # Allow one concurrent deployment 23 | concurrency: 24 | group: "pages" 25 | cancel-in-progress: true 26 | 27 | jobs: 28 | # Single deploy job since we're just deploying 29 | deploy: 30 | environment: 31 | name: github-pages 32 | url: ${{ steps.deployment.outputs.page_url }} 33 | runs-on: ubuntu-latest 34 | steps: 35 | - name: Checkout 36 | uses: actions/checkout@v3 37 | - name: Setup Pages 38 | uses: actions/configure-pages@v3 39 | - name: Run Sphinx documentation build 40 | uses: ammaraskar/sphinx-action@0.4 41 | with: 42 | docs-folder: "docs/" 43 | - name: Upload artifact 44 | uses: actions/upload-pages-artifact@v1 45 | with: 46 | # Upload entire repository 47 | path: 'docs/_build/html/' 48 | - name: Deploy to GitHub Pages 49 | id: deployment 50 | uses: actions/deploy-pages@v2 51 | -------------------------------------------------------------------------------- /.github/workflows/php-matrix/blackfire-generator.php: -------------------------------------------------------------------------------- 1 | $phpVersion, 12 | 'node_version' => 'x', 13 | 'xdebug_type' => $xdebugType, 14 | 'experimental' => $experimental, 15 | 'latest' => $phpVersion === PHP_LATEST, 16 | ]; 17 | foreach (NODE_VERSIONS as $nodeVersion) { 18 | $matrix[] = [ 19 | 'php_version' => $phpVersion, 20 | 'node_version' => $nodeVersion, 21 | 'xdebug_type' => $xdebugType, 22 | 'experimental' => $experimental, 23 | 'latest' => $phpVersion === PHP_LATEST && $nodeVersion === NODE_LATEST, 24 | ]; 25 | } 26 | } 27 | 28 | echo 'matrix=' . json_encode(['include' => $matrix]); -------------------------------------------------------------------------------- /.github/workflows/php-matrix/constants.php: -------------------------------------------------------------------------------- 1 | $phpVersion, 12 | 'node_version' => 'x', 13 | 'xdebug_type' => $xdebugType, 14 | 'experimental' => $experimental, 15 | 'latest' => $phpVersion === PHP_LATEST, 16 | ]; 17 | foreach (NODE_VERSIONS as $nodeVersion) { 18 | $matrix[] = [ 19 | 'php_version' => $phpVersion, 20 | 'node_version' => $nodeVersion, 21 | 'xdebug_type' => $xdebugType, 22 | 'experimental' => $experimental, 23 | 'latest' => $phpVersion === PHP_LATEST && $nodeVersion === NODE_LATEST, 24 | ]; 25 | } 26 | } 27 | 28 | echo 'matrix=' . json_encode(['include' => $matrix]); -------------------------------------------------------------------------------- /.github/workflows/php-matrix/node-generator.php: -------------------------------------------------------------------------------- 1 | $phpVersion, 12 | 'node_version' => $nodeVersion, 13 | 'experimental' => $experimental, 14 | 'latest' => $phpVersion === PHP_LATEST && $nodeVersion === NODE_LATEST, 15 | ]; 16 | } 17 | } 18 | 19 | echo 'matrix=' . json_encode(['include' => $matrix]); -------------------------------------------------------------------------------- /.github/workflows/php-matrix/php-generator.php: -------------------------------------------------------------------------------- 1 | $phpVersion, 11 | 'experimental' => $experimental, 12 | 'latest' => $phpVersion === PHP_LATEST, 13 | ]; 14 | } 15 | 16 | echo 'matrix=' . json_encode(['include' => $matrix]); -------------------------------------------------------------------------------- /.github/workflows/push-release-to-brew.yml: -------------------------------------------------------------------------------- 1 | name: "Push Release to Brew" 2 | on: 3 | release: 4 | types: [published] 5 | jobs: 6 | update-homebrew: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | with: 11 | token: ${{ secrets.TOKEN }} 12 | repository: swiftotter/homebrew-den 13 | - name: 'Update Version' 14 | env: 15 | VERSION: ${{ github.event.release.tag_name }} 16 | run: |- 17 | sudo apt-get install -y curl libdigest-sha-perl gettext-base 18 | curl "https://codeload.github.com/swiftotter/den/tar.gz/refs/tags/${VERSION}" -o release.tar.gz 19 | export HASH=$(shasum -a256 release.tar.gz | head -n1 | awk '{print $1;}') 20 | envsubst '$HASH,$VERSION' < Formula/den.rb.template > Formula/den.rb 21 | git config user.name github-actions 22 | git config user.email github-actions@github.com 23 | git add Formula/den.rb 24 | git commit -m "Mark v${VERSION}" 25 | git push 26 | -------------------------------------------------------------------------------- /.github/workflows/tag-release.yml: -------------------------------------------------------------------------------- 1 | name: Tag Release 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | version: 6 | description: 'The version to tag' 7 | required: true 8 | type: string 9 | jobs: 10 | create-tag: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | - name: Update Files 15 | env: 16 | VERSION: ${{ inputs.version }} 17 | run: |- 18 | echo $VERSION > version 19 | - name: "Create Tag" 20 | env: 21 | VERSION: ${{ inputs.version }} 22 | run: |- 23 | git add ./* 24 | git config user.name github-actions 25 | git config user.email github-actions@github.com 26 | git commit -m "Tagged ${VERSION}" 27 | git tag ${VERSION} 28 | git push --tags 29 | - name: "Create Release" 30 | uses: ncipollo/release-action@v1 31 | with: 32 | draft: true 33 | generateReleaseNotes: true 34 | tag: ${{ inputs.version }} 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.sync 2 | /Icon? 3 | /.idea 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "docs/_build": true 4 | }, 5 | "cSpell.words": [ 6 | "appdata" 7 | ] 8 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## UNRELEASED [x.y.z](https://github.com/swiftotter/den/tree/x.y.z) (yyyy-mm-dd) 4 | [All Commits](https://github.com/swiftotter/den/compare/a829648..main) 5 | 6 | First version is based on [Warden v0.12.0](https://github.com/davidalger/warden). 7 | 8 | **Migration from Warden**: 9 | * Certificates and other service-related data will now be located in `~/.den`. You should **not** rename `~/.warden` to `~/.den`. 10 | * You should `warden svc down` and then run `den install;den svc up`. Den Install will change the path of the `tunnel.warden.test` certificate, and Warden will not know to replace it if you switch back. 11 | * When running `den install` Den will automatically regenerate SSL certificates for all existing Warden projects ([swiftotter/den#44](https://github.com/swiftotter/den/pull/44) by @ihor-sviziev) 12 | 13 | **Migration from DrPaynne**: 14 | * The UID and GID for www-data was different on the DrPaynne fork. You will need to `chown` any files on a volume mount (includes but is not limited to application files and the bash history file) 15 | 16 | **Breaking Changes**: 17 | * Den utilizes `docker compose` instead of `docker-compose`, requiring Docker Compose v2+ built into Docker 18 | 19 | **Enhancements:** 20 | 21 | * Dashboard of global services available at https://den.test/ ([swiftotter/den#58](https://github.com/swiftotter/den/pull/58) by @navarr) 22 | * All images updated to be available in amd64 and arm64 varieties (excluding ElasticsearchHQ) 23 | * Magento images come with bash autocompletion for Magerun pre-configured 24 | * Database images have a MySQL history mount, which makes history of queries run in the `mysql` command persistent 25 | * Ability to set up OpenSearch via `WARDEN_OPENSEARCH=1` and `OPENSEARCH_VERSION=` directives 26 | * Ability to switch between MariaDB and MySQL using `DB_DISTRIBUTION=(mariadb|mysql)` and `DB_DISTRIBUTION_VERSION` directives 27 | * Updated environment default Node version from 10 to 12 ([davidalger/warden#250](https://github.com/davidalger/warden/issues/250)) 28 | * Default URL for ElasticsearchHQ is now configured in the docker-compose config ([davidalger/warden#428](https://github.com/davidalger/warden/pull/428) by @ihor-sviziev) 29 | * ElasticHQ is disabled by default ([davidalger/warden#434](https://github.com/davidalger/warden/pull/434) by @drpayyne) 30 | * `.git` directories existing in subdirectories of the project root are now synced by Mutagen ([swiftotter/den#53](https://github.com/swiftotter/den/pull/53) by @ihor-sviziev) 31 | * Addition of user and project-level customizations to the Warden development environment through scoped environment config loading ([davidalger/warden#451](https://github.com/davidalger/warden/pull/451) by @tdgroot) 32 | * Portainer is now optional and disabled by default ([swiftotter/den#69](https://github.com/swiftotter/den/pull/69) by @bap14) 33 | * Added a Drupal environment type ([swiftotter/den#70](https://github.com/swiftotter/den/pull/70) by @bap14) 34 | * `den help` and `den list` will also list any custom commands in the environment it is ran in ([swiftotter/den#78](https://github.com/swiftotter/den/pull/78) by @bap14) 35 | * `den help` and `den list` will also list any custom commands on the computer (by @navarr) 36 | * A new `magento-cloud` environment type has been added that, during env-init, automatically detects and configures Den to use the same service versions as Adobe Commerce Cloud in ([swiftotter/den#93](https://github.com/swiftotter/den/pull/93) by @henriquekieckbusch) 37 | * mage2tv/magento-cache-clean has been added to all Magento 2 images. It is available on the command line the command `cache-clean.js` or simply `cache-clean` ([swiftotter/den#105](https://github.com/swiftotter/den/pull/105) by @navarr) 38 | 39 | ## Available Services 40 | 41 | |Service|Versions| 42 | |:--|:--| 43 | | Varnish | 6.0, 6.5, 6.6, 7.0, 7.1, 7.2 | 44 | | Redis | 3.2, 4.0, 5.0, 6.0, 6.2, 7.0 | 45 | | RabbitMQ | 3.7, 3.8, 3.9, 3.10, 3.11 | 46 | | PHP | 7.4, 8.0, 8.1, 8.2 | 47 | | Node JS | 10, 12, 13, 14, 15, 16, 17, 18, 19 | 48 | | Elasticsearch | 5, 6, 7.6, 7.7, 7.9, 7.10, 7.12, 7.13, 7.14, 7.15, 7.16, 7.17, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5 | 49 | | OpenSearch | 1.1, 1.2, 1.3, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | 50 | | Nginx | 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.22, 1.23 | 51 | | MySQL | 5.5, 5.6, 5.7, 8.0.28, 8.0 | 52 | | MariaDB | 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0-rc | 53 | | Magepack | 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 2.10, 2.11 | 54 | 55 | Note: PHP < 7.2 contains XDebug 2. PHP >= 7.2 contains XDebug 3. 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 David Alger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Den is no longer actively maintained 2 | 3 | [Warden](https://github.com/wardenenv) is now the preferred software for local environments. 4 | 5 | When Migrating from Den to Warden, follow these steps for best results: 6 | 7 | 1. Stop any currently running environments 8 | 2. Run `den svc down -v` to stop and remove the Den service images 9 | 3. Uninstall Den 10 | 5. If on a Mac or Linux machine update `/etc/ssh/ssh_config` and remove everything between the `WARDEN START` and `WARDEN END` headers 11 | 4. Upgrade/Install Warden 12 | 7. Run `warden install` 13 | 8. Run `warden sign-certificate` for in each environment before the first time you start it 14 | -------------------------------------------------------------------------------- /bin/den: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | trap 'error "$(printf "Command \`%s\` at $BASH_SOURCE:$LINENO failed with exit code $?" "$BASH_COMMAND")"' ERR 4 | 5 | # add compatibility with warden commands by adding WARDEN_BIN viriable and warden function 6 | export readonly WARDEN_BIN=den 7 | function warden() { 8 | den "$@" 9 | } 10 | export -f warden 11 | 12 | ## find directory where this script is located following symlinks if neccessary 13 | readonly WARDEN_DIR="$( 14 | cd "$( 15 | dirname "$( 16 | (readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}") \ 17 | | sed -e "s#^../#$(dirname "$(dirname "${BASH_SOURCE[0]}")")/#" 18 | )" 19 | )/.." >/dev/null \ 20 | && pwd 21 | )" 22 | source "${WARDEN_DIR}/utils/core.sh" 23 | source "${WARDEN_DIR}/utils/env.sh" 24 | 25 | ## verify docker is installed 26 | if ! which docker >/dev/null; then 27 | fatal "docker could not be found; please install and try again." 28 | fi 29 | 30 | ## verify docker compose meets version constraint 31 | DOCKER_COMPOSE_REQUIRE="2.2.3" 32 | DOCKER_COMPOSE_VERSION="$(docker compose version | grep -oE '[0-9\.]+' | head -n1)" 33 | if ! test $(version ${DOCKER_COMPOSE_VERSION}) -ge $(version ${DOCKER_COMPOSE_REQUIRE}); then 34 | fatal "docker compose version should be ${DOCKER_COMPOSE_REQUIRE} or higher (${DOCKER_COMPOSE_VERSION} installed)" 35 | fi 36 | 37 | ## define and export global shared directory paths 38 | export readonly WARDEN_HOME_DIR="${WARDEN_HOME_DIR:-"$HOME/.den"}" 39 | export readonly WARDEN_SSL_DIR="${WARDEN_HOME_DIR}/ssl" 40 | export readonly WARDEN_COMPOSER_DIR="${WARDEN_COMPOSER_DIR:-"$HOME/.composer"}" 41 | 42 | ## declare variables for flags and arguments 43 | declare WARDEN_HELP= 44 | declare WARDEN_PARAMS=() 45 | declare WARDEN_CMD_VERB= 46 | declare WARDEN_CMD_EXEC= 47 | declare WARDEN_CMD_HELP= 48 | declare WARDEN_CMD_ANYARGS=(svc env db redis sync shell debug) 49 | 50 | ## parse first argument as command and determine validity 51 | if (( "$#" )); then 52 | ## local project directory if running within one; don't fail if it can't be found 53 | WARDEN_ENV_PATH="$(locateEnvPath 2>/dev/null)" || true 54 | 55 | if [[ -f "${WARDEN_DIR}/commands/${1}.cmd" ]]; then 56 | WARDEN_CMD_VERB="$1" 57 | WARDEN_CMD_EXEC="${WARDEN_DIR}/commands/${1}.cmd" 58 | WARDEN_CMD_HELP="${WARDEN_DIR}/commands/${1}.help" 59 | shift 60 | elif [[ -f "${WARDEN_ENV_PATH}/.den/commands/${1}.cmd" ]]; then 61 | WARDEN_CMD_VERB="$1" 62 | WARDEN_CMD_ANYARGS+=("$1") 63 | WARDEN_CMD_EXEC="${WARDEN_ENV_PATH}/.den/commands/${1}.cmd" 64 | WARDEN_CMD_HELP="${WARDEN_ENV_PATH}/.den/commands/${1}.help" 65 | shift 66 | ## leave .warden/commands for backward-compatibility 67 | elif [[ -f "${WARDEN_ENV_PATH}/.warden/commands/${1}.cmd" ]]; then 68 | WARDEN_CMD_VERB="$1" 69 | WARDEN_CMD_ANYARGS+=("$1") 70 | WARDEN_CMD_EXEC="${WARDEN_ENV_PATH}/.warden/commands/${1}.cmd" 71 | WARDEN_CMD_HELP="${WARDEN_ENV_PATH}/.warden/commands/${1}.help" 72 | shift 73 | elif [[ -f "${WARDEN_HOME_DIR}/commands/${1}.cmd" ]]; then 74 | WARDEN_CMD_VERB="$1" 75 | WARDEN_CMD_ANYARGS+=("$1") 76 | WARDEN_CMD_EXEC="${WARDEN_HOME_DIR}/commands/${1}.cmd" 77 | WARDEN_CMD_HELP="${WARDEN_HOME_DIR}/commands/${1}.help" 78 | shift 79 | else 80 | WARDEN_HELP=1 81 | fi 82 | else 83 | WARDEN_HELP=1 84 | fi 85 | 86 | ## parse arguments 87 | while (( "$#" )); do 88 | case "$1" in 89 | -h|--help) 90 | WARDEN_HELP=1 91 | break 92 | ;; 93 | --) # end argument parsing (unless command is on 'anyargs' list and consumes anything as params) 94 | shift 95 | containsElement "${WARDEN_CMD_VERB}" "${WARDEN_CMD_ANYARGS[@]}" || break 96 | ;; 97 | -*|--*=) # unsupported flags (unless command is on 'anyargs' list and consumes anything as params) 98 | containsElement "${WARDEN_CMD_VERB}" "${WARDEN_CMD_ANYARGS[@]}" && break 99 | fatal "Unsupported flag $1" 100 | ;; 101 | *) # preserve positional arguments 102 | WARDEN_PARAMS+=("$1") 103 | shift 104 | ;; 105 | esac 106 | done 107 | 108 | ## display command specific usage info if help flag is set 109 | if [[ ${WARDEN_HELP} ]]; then 110 | source "${WARDEN_DIR}/commands/usage.cmd" 111 | fi 112 | 113 | ## execute sub-command in context of this script 114 | source "${WARDEN_CMD_EXEC}" 115 | -------------------------------------------------------------------------------- /commands/blackfire.cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? 5 | loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? 6 | 7 | ## set defaults for this command which can be overridden either using exports in the user 8 | ## profile or setting them in the .env configuration on a per-project basis 9 | WARDEN_ENV_BLACKFIRE_COMMAND=${WARDEN_ENV_BLACKFIRE_COMMAND:-blackfire} 10 | WARDEN_ENV_BLACKFIRE_CONTAINER=${WARDEN_ENV_BLACKFIRE_CONTAINER:-php-blackfire} 11 | 12 | ## allow return codes from sub-process to bubble up normally 13 | trap '' ERR 14 | 15 | "${WARDEN_DIR}/bin/den" env exec "${WARDEN_ENV_BLACKFIRE_CONTAINER}" \ 16 | "${WARDEN_ENV_BLACKFIRE_COMMAND}" "${WARDEN_PARAMS[@]}" "$@" 17 | -------------------------------------------------------------------------------- /commands/blackfire.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? 5 | loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? 6 | assertDockerRunning 7 | 8 | if [[ ${WARDEN_DB:-1} -eq 0 ]]; then 9 | fatal "Database environment is not used (WARDEN_DB=0)." 10 | fi 11 | 12 | if (( ${#WARDEN_PARAMS[@]} == 0 )) || [[ "${WARDEN_PARAMS[0]}" == "help" ]]; then 13 | den db --help || exit $? && exit $? 14 | fi 15 | 16 | ## load connection information for the mysql service 17 | DB_CONTAINER=$(den env ps -q db) 18 | if [[ ! ${DB_CONTAINER} ]]; then 19 | fatal "No container found for db service." 20 | fi 21 | 22 | eval "$( 23 | docker container inspect ${DB_CONTAINER} --format ' 24 | {{- range .Config.Env }}{{with split . "=" -}} 25 | {{- index . 0 }}='\''{{ range $i, $v := . }}{{ if $i }}{{ $v }}{{ end }}{{ end }}'\''{{println}} 26 | {{- end }}{{ end -}} 27 | ' | grep "^MYSQL_" 28 | )" 29 | 30 | ## sub-command execution 31 | case "${WARDEN_PARAMS[0]}" in 32 | connect) 33 | "${WARDEN_DIR}/bin/den" env exec db \ 34 | mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" --database="${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" 35 | ;; 36 | import) 37 | LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' \ 38 | | LC_ALL=C sed -E '/\@\@(GLOBAL\.GTID_PURGED|SESSION\.SQL_LOG_BIN)/d' \ 39 | | "${WARDEN_DIR}/bin/den" env exec -T db \ 40 | mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" --database="${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" 41 | ;; 42 | dump) 43 | "${WARDEN_DIR}/bin/den" env exec -T db \ 44 | mysqldump -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" 45 | ;; 46 | *) 47 | fatal "The command \"${WARDEN_PARAMS[0]}\" does not exist. Please use --help for usage." 48 | ;; 49 | esac 50 | -------------------------------------------------------------------------------- /commands/db.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat < 7 | 8 | \033[33mOptions:\033[0m 9 | -h, --help Display this help menu 10 | 11 | \033[33mCommands:\033[0m 12 | connect Launches an interactive mysql session within the current project environment 13 | import Reads data from stdin and loads it into the current project\047s mysql database 14 | dump Dumps database from db container via mysqldump 15 | EOF 16 | ) 17 | -------------------------------------------------------------------------------- /commands/debug.cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? 5 | loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? 6 | 7 | ## set defaults for this command which can be overridden either using exports in the user 8 | ## profile or setting them in the .env configuration on a per-project basis 9 | WARDEN_ENV_DEBUG_COMMAND=${WARDEN_ENV_DEBUG_COMMAND:-bash} 10 | WARDEN_ENV_DEBUG_CONTAINER=${WARDEN_ENV_DEBUG_CONTAINER:-php-debug} 11 | WARDEN_ENV_DEBUG_HOST=${WARDEN_ENV_DEBUG_HOST:-} 12 | 13 | if [[ ${WARDEN_ENV_DEBUG_HOST} == "" ]]; then 14 | if [[ $OSTYPE =~ ^darwin ]] || grep -sqi microsoft /proc/sys/kernel/osrelease; then 15 | WARDEN_ENV_DEBUG_HOST=host.docker.internal 16 | else 17 | WARDEN_ENV_DEBUG_HOST=$( 18 | docker container inspect $(den env ps -q php-debug) \ 19 | --format '{{range .NetworkSettings.Networks}}{{println .Gateway}}{{end}}' | head -n1 20 | ) 21 | fi 22 | fi 23 | 24 | ## allow return codes from sub-process to bubble up normally 25 | trap '' ERR 26 | 27 | "${WARDEN_DIR}/bin/den" env exec -e "XDEBUG_REMOTE_HOST=${WARDEN_ENV_DEBUG_HOST}" \ 28 | "${WARDEN_ENV_DEBUG_CONTAINER}" "${WARDEN_ENV_DEBUG_COMMAND}" "${WARDEN_PARAMS[@]}" "$@" 29 | -------------------------------------------------------------------------------- /commands/debug.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_ENV_PATH="$(pwd -P)" 5 | 6 | # Prompt user if there is an extant .env file to ensure they intend to overwrite 7 | if test -f "${WARDEN_ENV_PATH}/.env"; then 8 | while true; do 9 | read -p $'\033[32mA den env file already exists at '"${WARDEN_ENV_PATH}/.env"$'; would you like to overwrite? y/n\033[0m ' resp 10 | case $resp in 11 | [Yy]*) echo "Overwriting extant .env file"; break;; 12 | [Nn]*) exit;; 13 | *) echo "Please answer (y)es or (n)o";; 14 | esac 15 | done 16 | fi 17 | 18 | WARDEN_ENV_NAME="${WARDEN_PARAMS[0]:-}" 19 | 20 | # If den environment name was not provided, prompt user for it 21 | while [ -z "${WARDEN_ENV_NAME}" ]; do 22 | read -p $'\033[32mAn environment name was not provided; please enter one:\033[0m ' WARDEN_ENV_NAME 23 | done 24 | 25 | WARDEN_ENV_TYPE="${WARDEN_PARAMS[1]:-}" 26 | 27 | # If warden environment type was not provided, prompt user for it 28 | if [ -z "${WARDEN_ENV_TYPE}" ]; then 29 | while true; do 30 | read -p $'\033[32mAn environment type was not provided; please choose one of ['"$(fetchValidEnvTypes)"$']:\033[0m ' WARDEN_ENV_TYPE 31 | assertValidEnvType && break 32 | done 33 | fi 34 | 35 | # Verify the auto-select and/or type path resolves correctly before setting it 36 | assertValidEnvType || exit $? 37 | 38 | # Write the .env file to current working directory 39 | cat > "${WARDEN_ENV_PATH}/.env" <> "${WARDEN_ENV_PATH}/.env" 53 | fi 54 | 55 | ENV_INIT_CMD=$(fetchEnvInitCmdFile) 56 | if [[ ! -z $ENV_INIT_CMD ]]; then 57 | source "${ENV_INIT_CMD}" 58 | fi 59 | -------------------------------------------------------------------------------- /commands/env-init.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat < 7 | 8 | \033[33mOptions:\033[0m 9 | -h, --help Display this help menu 10 | 11 | \033[33mEnvironment Types:\033[0m 12 | local Declares the docker compose version and labels the project 13 | network allowing Warden to recognize it. Must be coupled with 14 | per-project configuration. See documentation for details: 15 | https://docs.warden.dev/environments/types.html#local 16 | 17 | magento2 Nginx, varnish, php-fpm, db (mariadb), elasticsearch, redis, 18 | and rabbitmq services pre configured for Magento 2; on macOS 19 | systems code files are synced into container using mutagen 20 | session with pub/media, pub/static and var dirs excluded. 21 | On Linux code is mounted natively. 22 | 23 | magento-cloud Same as magento2, but the version of the services are 24 | configured to match the versions used by your 25 | Magento Cloud project. 26 | 27 | magento1 Nginx, php-fpm, db (mariadb), and redis services 28 | pre-configured for running Magento 1 29 | 30 | laravel Nginx, php-fpm, db (mariadb), and redis services 31 | pre-configured for running Laravel 32 | 33 | symfony Nginx, php-fpm, db (mariadb), and redis services 34 | pre-configured for running Symfony 4+ 35 | Due to the fact that Symfony uses '.env' file too, 36 | WEBROOT value of '/web/' is used by default 37 | 38 | wordpress Nginx, php-fpm, db 39 | pre-configured for running Wordpress 40 | EOF 41 | ) 42 | -------------------------------------------------------------------------------- /commands/env.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | COMPOSE_USAGE=$(docker compose "${WARDEN_PARAMS[@]}" "$@" \ 5 | | grep -vE '(--file|--project-name|--project-directory|default: docker-compose.yml|default: directory name)' \ 6 | | sed '1d;2d;s/docker-compose/env/' \ 7 | | sed -E "s/^(Usage|Options|Commands):/$(echo -e "\033[33m\\1:\033[0m")/g" 8 | ) 9 | 10 | WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? 5 | loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? 6 | assertDockerRunning 7 | 8 | if [[ ${WARDEN_REDIS:-1} -eq 0 ]]; then 9 | fatal "Redis environment is not used (WARDEN_REDIS=0)." 10 | fi 11 | 12 | if [[ "${WARDEN_PARAMS[0]}" == "help" ]]; then 13 | den redis --help || exit $? && exit $? 14 | fi 15 | 16 | ## load connection information for the redis service 17 | REDIS_CONTAINER=$(den env ps -q redis) 18 | if [[ ! ${REDIS_CONTAINER} ]]; then 19 | fatal "No container found for redis service." 20 | fi 21 | 22 | "${WARDEN_DIR}/bin/den" env exec redis redis-cli "${WARDEN_PARAMS[@]}" "$@" 23 | -------------------------------------------------------------------------------- /commands/redis.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | # Load in the user-specific shell command 5 | if [[ -f "${WARDEN_HOME_DIR}/.env" ]]; then 6 | eval "$(cat "${WARDEN_HOME_DIR}/.env" | sed 's/\r$//g' | grep "^WARDEN_ENV_SHELL_COMMAND")" 7 | fi 8 | 9 | WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? 10 | loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? 11 | 12 | ## set defaults for this command which can be overridden either using exports in the user 13 | ## profile or setting them in the .env configuration on a per-project basis 14 | WARDEN_ENV_SHELL_COMMAND=${USE_SHELL:-${WARDEN_ENV_SHELL_COMMAND:-bash}} 15 | WARDEN_ENV_SHELL_CONTAINER=${WARDEN_ENV_SHELL_CONTAINER:-php-fpm} 16 | 17 | ## allow return codes from sub-process to bubble up normally 18 | trap '' ERR 19 | 20 | "${WARDEN_DIR}/bin/den" env exec "${WARDEN_ENV_SHELL_CONTAINER}" \ 21 | "${WARDEN_ENV_SHELL_COMMAND}" "${WARDEN_PARAMS[@]}" "$@" 22 | -------------------------------------------------------------------------------- /commands/shell.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | mkdir -p "${WARDEN_SSL_DIR}/certs" 5 | 6 | if [[ ! -f "${WARDEN_SSL_DIR}/rootca/certs/ca.cert.pem" ]]; then 7 | fatal "Missing the root CA file. Please run 'warden install' and try again." 8 | fi 9 | 10 | if (( ${#WARDEN_PARAMS[@]} == 0 )); then 11 | echo -e "\033[33mCommand '${WARDEN_CMD_VERB}' requires a hostname as an argument, please use --help for details." 12 | exit -1 13 | fi 14 | 15 | CERTIFICATE_SAN_LIST= 16 | for (( i = 0; i < ${#WARDEN_PARAMS[@]} * 2; i+=2 )); do 17 | [[ ${CERTIFICATE_SAN_LIST} ]] && CERTIFICATE_SAN_LIST+="," 18 | CERTIFICATE_SAN_LIST+="DNS.$(expr $i + 1):${WARDEN_PARAMS[i/2]}" 19 | CERTIFICATE_SAN_LIST+=",DNS.$(expr $i + 2):*.${WARDEN_PARAMS[i/2]}" 20 | done 21 | 22 | CERTIFICATE_NAME="${WARDEN_PARAMS[0]}" 23 | 24 | if [[ -f "${WARDEN_SSL_DIR}/certs/${CERTIFICATE_NAME}.key.pem" ]]; then 25 | >&2 echo -e "\033[33mWarning: Certificate for ${CERTIFICATE_NAME} already exists! Overwriting...\033[0m\n" 26 | fi 27 | 28 | echo "==> Generating private key ${CERTIFICATE_NAME}.key.pem" 29 | openssl genrsa -out "${WARDEN_SSL_DIR}/certs/${CERTIFICATE_NAME}.key.pem" 2048 30 | 31 | echo "==> Generating signing req ${CERTIFICATE_NAME}.crt.pem" 32 | openssl req -new -sha256 -config <(cat \ 33 | "${WARDEN_DIR}/config/openssl/certificate.conf" \ 34 | <(printf "extendedKeyUsage = serverAuth,clientAuth \n \ 35 | subjectAltName = %s" "${CERTIFICATE_SAN_LIST}") \ 36 | ) \ 37 | -key "${WARDEN_SSL_DIR}/certs/${CERTIFICATE_NAME}.key.pem" \ 38 | -out "${WARDEN_SSL_DIR}/certs/${CERTIFICATE_NAME}.csr.pem" \ 39 | -subj "/C=US/O=Den.SwiftOtter.com/CN=${CERTIFICATE_NAME}" 40 | 41 | echo "==> Generating certificate ${CERTIFICATE_NAME}.crt.pem" 42 | openssl x509 -req -days 365 -sha256 -extensions v3_req \ 43 | -extfile <(cat \ 44 | "${WARDEN_DIR}/config/openssl/certificate.conf" \ 45 | <(printf "extendedKeyUsage = serverAuth,clientAuth \n \ 46 | subjectAltName = %s" "${CERTIFICATE_SAN_LIST}") \ 47 | ) \ 48 | -CA "${WARDEN_SSL_DIR}/rootca/certs/ca.cert.pem" \ 49 | -CAkey "${WARDEN_SSL_DIR}/rootca/private/ca.key.pem" \ 50 | -CAserial "${WARDEN_SSL_DIR}/rootca/serial" \ 51 | -in "${WARDEN_SSL_DIR}/certs/${CERTIFICATE_NAME}.csr.pem" \ 52 | -out "${WARDEN_SSL_DIR}/certs/${CERTIFICATE_NAME}.crt.pem" 53 | 54 | if [[ "$(den svc ps -q traefik)" ]] 55 | then 56 | echo "==> Updating traefik" 57 | "${WARDEN_DIR}/bin/den" svc up traefik 58 | "${WARDEN_DIR}/bin/den" svc restart traefik 59 | fi 60 | -------------------------------------------------------------------------------- /commands/sign-certificate.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat < [hostname2] [hostname3] ... 7 | 8 | \033[33mOptions:\033[0m 9 | -h, --help Display this help menu 10 | EOF 11 | ) 12 | -------------------------------------------------------------------------------- /commands/status.cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | assertDockerRunning 5 | 6 | denNetworkName=$(cat ${WARDEN_DIR}/docker/docker-compose.yml | grep -A3 'networks:' | tail -n1 | sed -e 's/[[:blank:]]*name:[[:blank:]]*//g') 7 | denNetworkId=$(docker network ls -q --filter name="${denNetworkName}") 8 | 9 | if [[ -z "${denNetworkId}" ]]; then 10 | echo -e "🛑 \033[31mDen is not currently running.\033[0m Run \033[36mden svc up\033[0m to start Den core services." 11 | exit 0 12 | fi 13 | 14 | denTraefikId=$(docker container ls --filter network="${denNetworkId}" --filter status=running --filter name=traefik -q) 15 | projectNetworks=$(docker container inspect --format '{{ range $k,$v := .NetworkSettings.Networks }}{{ if ne $k "${denNetworkName}" }}{{println $k }}{{ end }}{{end}}' "${denTraefikId}") 16 | OLDIFS="$IFS"; 17 | IFS=$'\n' 18 | projectNetworkList=($projectNetworks) 19 | IFS="$OLDIFS" 20 | 21 | messageList=() 22 | for projectNetwork in "${projectNetworkList[@]}"; do 23 | [[ -z "${projectNetwork}" || "${projectNetwork}" == "${denNetworkName}" ]] && continue # Skip empty project network names (if any) 24 | 25 | prefix="${projectNetwork%_default}" 26 | prefixLen="${#prefix}" 27 | ((prefixLen+=1)) 28 | projectContainers=$(docker network inspect --format '{{ range $k,$v := .Containers }}{{ $nameLen := len $v.Name }}{{ if gt $nameLen '"${prefixLen}"' }}{{ $prefix := slice $v.Name 0 '"${prefixLen}"' }}{{ if eq $prefix "'"${prefix}-"'" }}{{ println $v.Name }}{{end}}{{end}}{{end}}' "${projectNetwork}") 29 | container=$(echo "$projectContainers" | head -n1) 30 | 31 | [[ -z "${container}" ]] && continue # Project is not running, skip it 32 | 33 | projectDir=$(docker container inspect --format '{{ index .Config.Labels "com.docker.compose.project.working_dir"}}' "$container") 34 | projectName=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_NAME=' | sed -e 's/WARDEN_ENV_NAME=[[:space:]]*//g' | tr -d -) 35 | projectType=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_TYPE=' | sed -e 's/WARDEN_ENV_TYPE=[[:space:]]*//g' | tr -d -) 36 | traefikDomain=$(cat "${projectDir}/.env" | grep '^TRAEFIK_DOMAIN=' | sed -e 's/TRAEFIK_DOMAIN=[[:space:]]*//g' | tr -d -) 37 | 38 | messageList+=(" \033[1;35m${projectName}\033[0m a \033[36m${projectType}\033[0m project") 39 | messageList+=(" Project Directory: \033[33m${projectDir}\033[0m") 40 | messageList+=(" Project URL: \033[94mhttps://${traefikDomain}\033[0m") 41 | 42 | [[ "$projectNetwork" != "${projectNetworkList[@]: -1:1}" ]] && messageList+=() 43 | done 44 | 45 | if [[ "${#messageList[@]}" > 0 ]]; then 46 | echo -e "Found the following \033[32mrunning\033[0m environments:" 47 | for line in "${messageList[@]}"; do 48 | echo -e "$line" 49 | done 50 | else 51 | echo "No running environments found." 52 | fi -------------------------------------------------------------------------------- /commands/status.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE="Provides listing of projects that are currently running and Den's Traefik is connected to" -------------------------------------------------------------------------------- /commands/svc.cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | source "${WARDEN_DIR}/utils/install.sh" 5 | assertWardenInstall 6 | assertDockerRunning 7 | 8 | if (( ${#WARDEN_PARAMS[@]} == 0 )) || [[ "${WARDEN_PARAMS[0]}" == "help" ]]; then 9 | den svc --help || exit $? && exit $? 10 | fi 11 | 12 | ## allow return codes from sub-process to bubble up normally 13 | trap '' ERR 14 | 15 | ## configure docker compose files 16 | DOCKER_COMPOSE_ARGS=() 17 | 18 | DOCKER_COMPOSE_ARGS+=("-f") 19 | DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/docker/docker-compose.yml") 20 | 21 | # Load optional service flags 22 | if [[ -f "${WARDEN_HOME_DIR}/.env" ]]; then 23 | # Portainer service 24 | eval "$(grep "^DEN_SERVICE_PORTAINER" "${WARDEN_HOME_DIR}/.env")" 25 | fi 26 | 27 | DEN_SERVICE_PORTAINER="${DEN_SERVICE_PORTAINER:-0}" 28 | if [[ "${DEN_SERVICE_PORTAINER}" == 1 ]]; then 29 | DOCKER_COMPOSE_ARGS+=("-f") 30 | DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/docker/portainer-service.yml") 31 | fi 32 | 33 | ## special handling when 'svc up' is run 34 | if [[ "${WARDEN_PARAMS[0]}" == "up" ]]; then 35 | 36 | ## sign certificate used by global services (by default warden.test) 37 | if [[ -f "${WARDEN_HOME_DIR}/.env" ]]; then 38 | eval "$(grep "^WARDEN_SERVICE_DOMAIN" "${WARDEN_HOME_DIR}/.env")" 39 | fi 40 | 41 | WARDEN_SERVICE_DOMAIN="${WARDEN_SERVICE_DOMAIN:-den.test}" 42 | if [[ ! -f "${WARDEN_SSL_DIR}/certs/${WARDEN_SERVICE_DOMAIN}.crt.pem" ]]; then 43 | "${WARDEN_DIR}/bin/den" sign-certificate "${WARDEN_SERVICE_DOMAIN}" 44 | fi 45 | if [[ ! -f "${WARDEN_SSL_DIR}/certs/warden.test.crt.pem" ]]; then 46 | "${WARDEN_DIR}/bin/den" sign-certificate "warden.test" 47 | fi 48 | 49 | ## copy configuration files into location where they'll be mounted into containers from 50 | mkdir -p "${WARDEN_HOME_DIR}/etc/traefik" 51 | cp "${WARDEN_DIR}/config/traefik/traefik.yml" "${WARDEN_HOME_DIR}/etc/traefik/traefik.yml" 52 | 53 | ## generate dynamic traefik ssl termination configuration 54 | cat > "${WARDEN_HOME_DIR}/etc/traefik/dynamic.yml" <<-EOT 55 | tls: 56 | stores: 57 | default: 58 | defaultCertificate: 59 | certFile: /etc/ssl/certs/${WARDEN_SERVICE_DOMAIN}.crt.pem 60 | keyFile: /etc/ssl/certs/${WARDEN_SERVICE_DOMAIN}.key.pem 61 | certificates: 62 | EOT 63 | 64 | for cert in $(find "${WARDEN_SSL_DIR}/certs" -type f -name "*.crt.pem" | sed -E 's#^.*/ssl/certs/(.*)\.crt\.pem$#\1#'); do 65 | cat >> "${WARDEN_HOME_DIR}/etc/traefik/dynamic.yml" <<-EOF 66 | - certFile: /etc/ssl/certs/${cert}.crt.pem 67 | keyFile: /etc/ssl/certs/${cert}.key.pem 68 | EOF 69 | done 70 | 71 | ## always execute svc up using --detach mode 72 | if ! (containsElement "-d" "$@" || containsElement "--detach" "$@"); then 73 | WARDEN_PARAMS=("${WARDEN_PARAMS[@]:1}") 74 | WARDEN_PARAMS=(up -d "${WARDEN_PARAMS[@]}") 75 | fi 76 | fi 77 | 78 | DEN_VERSION=$(cat ${WARDEN_DIR}/version) 79 | 80 | ## pass ochestration through to docker compose 81 | WARDEN_SERVICE_DIR=${WARDEN_DIR} DEN_VERSION=${DEN_VERSION:-"in-dev"} docker compose \ 82 | --project-directory "${WARDEN_HOME_DIR}" -p den \ 83 | "${DOCKER_COMPOSE_ARGS[@]}" "${WARDEN_PARAMS[@]}" "$@" 84 | 85 | ## connect peered service containers to environment networks when 'svc up' is run 86 | if [[ "${WARDEN_PARAMS[0]}" == "up" ]]; then 87 | for network in $(docker network ls -f label=dev.warden.environment.name --format {{.Name}}); do 88 | connectPeeredServices "${network}" 89 | done 90 | fi 91 | -------------------------------------------------------------------------------- /commands/svc.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | COMPOSE_USAGE=$(docker compose "${WARDEN_PARAMS[@]}" "$@" \ 5 | | grep -vE '(--file|--project-name|--project-directory|default: docker-compose.yml|default: directory name)' \ 6 | | sed '1d;2d;s/docker-compose/svc/' \ 7 | | sed -E "s/^(Usage|Options|Commands):/$(echo -e "\033[33m\\1:\033[0m")/g" 8 | ) 9 | 10 | WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? 5 | loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? 6 | 7 | if (( ${#WARDEN_PARAMS[@]} == 0 )); then 8 | fatal "This command has required params; use --help for details." 9 | fi 10 | 11 | ## disable sync command on non-darwin environments where it should not be used 12 | if [[ ${WARDEN_ENV_SUBT} != "darwin" ]]; then 13 | fatal "Mutagen sync sessions are not used on \"${WARDEN_ENV_SUBT}\" host environments." 14 | fi 15 | 16 | ## attempt to install mutagen if not already present 17 | if ! which mutagen >/dev/null; then 18 | echo -e "\033[33mMutagen could not be found; attempting install via brew.\033[0m" 19 | brew install havoc-io/mutagen/mutagen 20 | fi 21 | 22 | ## verify mutagen version constraint 23 | MUTAGEN_VERSION=$(mutagen version 2>/dev/null) || true 24 | MUTAGEN_REQUIRE=0.11.8 25 | if [[ $OSTYPE =~ ^darwin ]] && ! test $(version ${MUTAGEN_VERSION}) -ge $(version ${MUTAGEN_REQUIRE}); then 26 | error "Mutagen version ${MUTAGEN_REQUIRE} or greater is required (version ${MUTAGEN_VERSION} is installed)." 27 | >&2 printf "\nPlease update Mutagen:\n\n brew upgrade havoc-io/mutagen/mutagen\n\n" 28 | exit 1 29 | fi 30 | 31 | if [[ $OSTYPE =~ ^darwin && -z "${MUTAGEN_SYNC_FILE}" ]]; then 32 | export MUTAGEN_SYNC_FILE="${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" 33 | 34 | if [[ -f "${WARDEN_HOME_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" ]]; then 35 | export MUTAGEN_SYNC_FILE="${WARDEN_HOME_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" 36 | fi 37 | 38 | if [[ -f "${WARDEN_ENV_PATH}/.warden/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" ]]; then 39 | export MUTAGEN_SYNC_FILE="${WARDEN_ENV_PATH}/.warden/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" 40 | fi 41 | 42 | if [[ -f "${WARDEN_ENV_PATH}/.warden/mutagen.yml" ]]; then 43 | export MUTAGEN_SYNC_FILE="${WARDEN_ENV_PATH}/.warden/mutagen.yml" 44 | fi 45 | fi 46 | 47 | ## if no mutagen configuration file exists for the environment type, exit with error 48 | if [[ ! -f "${MUTAGEN_SYNC_FILE}" ]]; then 49 | fatal "Mutagen configuration does not exist for environment type \"${WARDEN_ENV_TYPE}\"" 50 | fi 51 | 52 | ## sub-command execution 53 | case "${WARDEN_PARAMS[0]}" in 54 | start) 55 | ## terminate any existing sessions with matching env label 56 | mutagen sync terminate --label-selector "warden-sync=${WARDEN_ENV_NAME}" 57 | 58 | ## create sync session based on environment type configuration 59 | mutagen sync create -c "${MUTAGEN_SYNC_FILE}" \ 60 | --label "warden-sync=${WARDEN_ENV_NAME}" --ignore "${WARDEN_SYNC_IGNORE:-}" \ 61 | "${WARDEN_ENV_PATH}${WARDEN_WEB_ROOT:-}" "docker://$(den env ps -q php-fpm)/var/www/html" 62 | 63 | ## wait for sync session to complete initial sync before exiting 64 | echo "Waiting for initial synchronization to complete" 65 | while ! mutagen sync list --label-selector "warden-sync=${WARDEN_ENV_NAME}" \ 66 | | grep -i 'watching for changes'>/dev/null; 67 | do 68 | if mutagen sync list --label-selector "warden-sync=${WARDEN_ENV_NAME}" \ 69 | | grep -i 'Last error' > /dev/null; then 70 | MUTAGEN_ERROR=$(mutagen sync list --label-selector "warden-sync=${WARDEN_ENV_NAME}" \ 71 | | sed -n 's/Last error: \(.*\)/\1/p') 72 | fatal "Mutagen encountered an error during sync: ${MUTAGEN_ERROR}" 73 | fi 74 | printf .; sleep 1; done; echo 75 | ;; 76 | stop) 77 | mutagen sync terminate --label-selector "warden-sync=${WARDEN_ENV_NAME}" 78 | ;; 79 | list|flush|monitor|pause|reset|resume) 80 | mutagen sync "${WARDEN_PARAMS[@]}" "${@}" --label-selector "warden-sync=${WARDEN_ENV_NAME}" 81 | ;; 82 | *) 83 | fatal "The command \"${WARDEN_PARAMS[0]}\" does not exist. Please use --help for usage." 84 | ;; 85 | esac 86 | -------------------------------------------------------------------------------- /commands/sync.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat < 7 | 8 | \033[33mOptions:\033[0m 9 | -h, --help Display this help menu 10 | 11 | \033[33mCommands:\033[0m 12 | start Starts mutagen sync for the current project environment 13 | stop Stops the mutagen sync for the current project environment 14 | list Lists mutagen session status for current project environment 15 | and optionally (with -l) the full configuration 16 | 17 | monitor Continously lists mutagen session status for current project 18 | flush Force a synchronization cycle on sync session for current project 19 | pause Pauses the mutagen sync for the current project environment 20 | resume Resumes the mutagen sync for the current project environment 21 | reset Reset synchronization session history for current project environment 22 | EOF 23 | ) 24 | -------------------------------------------------------------------------------- /commands/usage.cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | function sourceCustomCommands { 5 | SOURCE_PATH="${2}" 6 | SOURCE_NAME="${1}" 7 | 8 | echo "Sourcing ${SOURCE_PATH}" 9 | 10 | if [[ -n "${WARDEN_ENV_PATH}" && -d "${SOURCE_PATH}" ]]; then 11 | CUSTOM_COMMAND_LIST=$(ls "${SOURCE_PATH}/"*.cmd) 12 | 13 | if [[ -n "${CUSTOM_COMMAND_LIST}" ]]; then 14 | TRIM_PREFIX="${SOURCE_PATH}/" 15 | TRIM_SUFFIX=".cmd" 16 | CUSTOM_COMMANDS="" 17 | for COMMAND in $CUSTOM_COMMAND_LIST; do 18 | COMMAND=${COMMAND#"$TRIM_PREFIX"} 19 | COMMAND=${COMMAND%"$TRIM_SUFFIX"} 20 | [[ ! -e "${TRIM_PREFIX}${COMMAND}.help" ]] && continue; 21 | CUSTOM_COMMANDS="${CUSTOM_COMMANDS} ${COMMAND}"$'\n' 22 | done 23 | 24 | if [[ -n "${CUSTOM_COMMANDS}" ]]; then 25 | CUSTOM_ENV_COMMANDS=$'\n\n'"\033[33mCustom Commands For ${SOURCE_NAME}\033[33m:\033[0m" 26 | CUSTOM_ENV_COMMANDS="$CUSTOM_ENV_COMMANDS"$'\n'"$CUSTOM_COMMANDS" 27 | WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_HEADER=' 5 | ____ 6 | / __ \___ ____ 7 | / / / / _ \/ __ \ 8 | / /_/ / __/ / / / 9 | /_____/\___/_/ /_/ 10 | Fork of Warden 11 | ' 12 | 13 | WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | cat "${WARDEN_DIR}/version" 5 | -------------------------------------------------------------------------------- /commands/vnc.cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? 5 | loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? 6 | 7 | if [[ ${WARDEN_SELENIUM} -ne 1 ]] || [[ ${WARDEN_SELENIUM_DEBUG} -ne 1 ]]; then 8 | fatal "The project environment must have WARDEN_SELENIUM and WARDEN_SELENIUM_DEBUG enabled to use this command" 9 | fi 10 | 11 | WARDEN_SELENIUM_INDEX=${WARDEN_PARAMS[0]:-1} 12 | WARDEN_SELENIUM_VNC=${WARDEN_ENV_NAME}_${WARDEN_PARAMS[1]:-selenium}_${WARDEN_SELENIUM_INDEX} 13 | 14 | if ! which remmina >/dev/null; then 15 | EXPOSE_PORT=$((5900 + WARDEN_SELENIUM_INDEX)) 16 | 17 | echo "Connect with your VNC client to 127.0.0.1:${EXPOSE_PORT}" 18 | echo " Password: secret" 19 | echo "You can also use URL: vnc://127.0.0.1:${EXPOSE_PORT}/?VncPassword=secret" 20 | ssh -N -L localhost:${EXPOSE_PORT}:${WARDEN_SELENIUM_VNC}:5900 tunnel.den.test 21 | else 22 | 23 | cat > "${WARDEN_ENV_PATH}/.remmina" <<-EOF 24 | [remmina] 25 | name=${WARDEN_SELENIUM_VNC} Debug 26 | proxy= 27 | ssh_enabled=1 28 | colordepth=8 29 | server=${WARDEN_SELENIUM_VNC} 30 | ssh_auth=3 31 | quality=9 32 | scale=1 33 | ssh_username=user 34 | password=. 35 | disablepasswordstoring=0 36 | viewmode=1 37 | window_width=1200 38 | window_height=780 39 | ssh_server=tunnel.den.test:2222 40 | protocol=VNC 41 | EOF 42 | 43 | echo -e "Launching VNC session via Remmina. Password is \"\033[1msecret\"\033[0m" 44 | remmina -c "${WARDEN_ENV_PATH}/.remmina" 45 | fi 46 | -------------------------------------------------------------------------------- /commands/vnc.help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | WARDEN_USAGE=$(cat <. 63 | countryName = Country Name (2 letter code) 64 | stateOrProvinceName = State or Province Name 65 | localityName = Locality Name 66 | 0.organizationName = Organization Name 67 | organizationalUnitName = Organizational Unit Name 68 | commonName = Common Name 69 | emailAddress = Email Address 70 | 71 | # Optionally, specify some defaults. 72 | countryName_default = US 73 | stateOrProvinceName_default = 74 | localityName_default = 75 | 0.organizationName_default = 76 | organizationalUnitName_default = 77 | emailAddress_default = 78 | 79 | [ v3_ca ] 80 | # Extensions for a typical CA (`man x509v3_config`). 81 | subjectKeyIdentifier = hash 82 | authorityKeyIdentifier = keyid:always,issuer 83 | basicConstraints = critical, CA:true 84 | keyUsage = critical, digitalSignature, cRLSign, keyCertSign 85 | 86 | [ v3_intermediate_ca ] 87 | # Extensions for a typical intermediate CA (`man x509v3_config`). 88 | subjectKeyIdentifier = hash 89 | authorityKeyIdentifier = keyid:always,issuer 90 | basicConstraints = critical, CA:true, pathlen:0 91 | keyUsage = critical, digitalSignature, cRLSign, keyCertSign 92 | 93 | [ usr_cert ] 94 | # Extensions for client certificates (`man x509v3_config`). 95 | basicConstraints = CA:FALSE 96 | nsCertType = client, email 97 | nsComment = "OpenSSL Generated Client Certificate" 98 | subjectKeyIdentifier = hash 99 | authorityKeyIdentifier = keyid,issuer 100 | keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment 101 | extendedKeyUsage = clientAuth, emailProtection 102 | 103 | [ server_cert ] 104 | # Extensions for server certificates (`man x509v3_config`). 105 | basicConstraints = CA:FALSE 106 | nsCertType = server 107 | nsComment = "OpenSSL Generated Server Certificate" 108 | subjectKeyIdentifier = hash 109 | authorityKeyIdentifier = keyid,issuer:always 110 | keyUsage = critical, digitalSignature, keyEncipherment 111 | extendedKeyUsage = serverAuth 112 | 113 | [ crl_ext ] 114 | # Extension for CRLs (`man x509v3_config`). 115 | authorityKeyIdentifier=keyid:always 116 | 117 | [ ocsp ] 118 | # Extension for OCSP signing certificates (`man ocsp`). 119 | basicConstraints = CA:FALSE 120 | subjectKeyIdentifier = hash 121 | authorityKeyIdentifier = keyid,issuer 122 | keyUsage = critical, digitalSignature 123 | extendedKeyUsage = critical, OCSPSigning 124 | -------------------------------------------------------------------------------- /config/traefik/traefik.yml: -------------------------------------------------------------------------------- 1 | --- 2 | api: 3 | dashboard: true 4 | providers: 5 | file: 6 | filename: /etc/traefik/dynamic.yml 7 | docker: 8 | network: warden 9 | defaultRule: "Host(`{{ .Name }}.warden.test`)" 10 | exposedByDefault: false 11 | entryPoints: 12 | http: 13 | address: ":80" 14 | http: 15 | redirections: 16 | entryPoint: 17 | to: https 18 | scheme: https 19 | https: 20 | address: ":443" 21 | log: 22 | level: info 23 | global: 24 | checkNewVersion: false 25 | sendAnonymousUsage: false 26 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | dashboard: 4 | container_name: dashboard 5 | image: ${WARDEN_IMAGE_REPOSITORY:-ghcr.io/swiftotter}/den-dashboard 6 | labels: 7 | - traefik.enable=true 8 | - traefik.http.routers.dashboard.tls=true 9 | - traefik.http.routers.dashboard.rule=Host(`${WARDEN_SERVICE_DOMAIN:-den.test}`)||Host(`www.${WARDEN_SERVICE_DOMAIN:-den.test}`) 10 | - traefik.http.services.dashboard.loadbalancer.server.port=80 11 | restart: ${WARDEN_RESTART_POLICY:-always} 12 | environment: 13 | - DEN_VERSION=${DEN_VERSION:-"in-dev"} 14 | traefik: 15 | container_name: traefik 16 | image: traefik:${TRAEFIK_VERSION:-2.2} 17 | ports: 18 | - "${TRAEFIK_LISTEN:-127.0.0.1}:80:80" # The HTTP port 19 | - "${TRAEFIK_LISTEN:-127.0.0.1}:443:443" # The HTTPS port 20 | volumes: 21 | - ${WARDEN_HOME_DIR}/etc/traefik/traefik.yml:/etc/traefik/traefik.yml 22 | - ${WARDEN_HOME_DIR}/etc/traefik/dynamic.yml:/etc/traefik/dynamic.yml 23 | - ${WARDEN_HOME_DIR}/ssl/certs:/etc/ssl/certs 24 | - /var/run/docker.sock:/var/run/docker.sock 25 | labels: 26 | - traefik.enable=true 27 | - traefik.http.routers.traefik.tls=true 28 | - traefik.http.routers.traefik.rule=Host(`traefik.${WARDEN_SERVICE_DOMAIN:-den.test}`)||Host(`traefik.warden.test`) 29 | - traefik.http.routers.traefik.service=api@internal 30 | restart: ${WARDEN_RESTART_POLICY:-always} 31 | 32 | dnsmasq: 33 | container_name: dnsmasq 34 | image: ${WARDEN_IMAGE_REPOSITORY:-ghcr.io/swiftotter}/den-dnsmasq 35 | ports: 36 | - "127.0.0.1:53:53/udp" 37 | environment: 38 | WARDEN_DNSMASQ_CONF: |- 39 | #dnsmasq config, for a complete example, see: 40 | # http://oss.segetech.com/intra/srv/dnsmasq.conf 41 | 42 | #log all dns queries (enable as-needed for debugging purposes) 43 | # log-queries 44 | 45 | #dont use hosts nameservers 46 | no-resolv 47 | 48 | #use cloudflare as default nameservers, prefer 1^4 49 | server=${WARDEN_DNSMASQ_NS1:-1.0.0.1} 50 | server=${WARDEN_DNSMASQ_NS2:-1.1.1.1} 51 | strict-order 52 | 53 | #explicitly define host-ip mappings 54 | address=/.test/127.0.0.1 55 | ${WARDEN_DNSMASQ_CONF_ADDITIONAL:-} 56 | 57 | entrypoint: ["/bin/sh", "-c", " 58 | echo \"$$WARDEN_DNSMASQ_CONF\" > /etc/dnsmasq.conf; 59 | webproc --configuration-file /etc/dnsmasq.conf -- dnsmasq --no-daemon; 60 | "] 61 | labels: 62 | - traefik.enable=true 63 | - traefik.http.routers.dnsmasq.tls=true 64 | - traefik.http.routers.dnsmasq.rule=Host(`dnsmasq.${WARDEN_SERVICE_DOMAIN:-den.test}`)||Host(`dnsmasq.warden.test`) 65 | - traefik.http.services.dnsmasq.loadbalancer.server.port=8080 66 | restart: ${WARDEN_RESTART_POLICY:-always} 67 | 68 | mailhog: 69 | container_name: mailhog 70 | image: ${WARDEN_IMAGE_REPOSITORY:-ghcr.io/swiftotter}/den-mailhog:1.0 71 | labels: 72 | - traefik.enable=true 73 | - traefik.http.routers.mailhog.tls=true 74 | - traefik.http.routers.mailhog.rule=Host(`mailhog.${WARDEN_SERVICE_DOMAIN:-den.test}`)||Host(`mailhog.warden.test`) 75 | - traefik.http.services.mailhog.loadbalancer.server.port=8025 76 | restart: ${WARDEN_RESTART_POLICY:-always} 77 | 78 | tunnel: 79 | container_name: tunnel 80 | image: panubo/sshd:latest 81 | ports: 82 | - "127.0.0.1:2222:22" 83 | volumes: 84 | - ${WARDEN_HOME_DIR}/tunnel/ssh_key.pub:/etc/authorized_keys/user 85 | - sshd_keys:/etc/ssh/keys 86 | environment: 87 | - | 88 | MOTD=Welcome to the Warden SSH tunnel container! 89 | 90 | This tunnel container is used only for forwarding TCP 91 | connections, generally to port 3306 of db containers 92 | and is not typically used with an interactive shell. 93 | 94 | - SSH_USERS=user:2000:2000 95 | - TCP_FORWARDING=true 96 | restart: ${WARDEN_RESTART_POLICY:-always} 97 | 98 | volumes: 99 | portainer: 100 | sshd_keys: 101 | 102 | networks: 103 | default: 104 | name: warden 105 | -------------------------------------------------------------------------------- /docker/portainer-service.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | portainer: 4 | container_name: portainer 5 | image: portainer/portainer-ce 6 | volumes: 7 | - /var/run/docker.sock:/var/run/docker.sock 8 | - portainer:/data 9 | labels: 10 | - traefik.enable=true 11 | - traefik.http.routers.portainer.tls=true 12 | - traefik.http.routers.portainer.rule=Host(`portainer.${WARDEN_SERVICE_DOMAIN:-den.test}`)||Host(`portainer.warden.test`) 13 | - traefik.http.services.portainer.loadbalancer.server.port=9000 14 | restart: ${WARDEN_RESTART_POLICY:-always} -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | /_build 2 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SOURCEDIR = . 8 | BUILDDIR = _build 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/changelog.md: -------------------------------------------------------------------------------- 1 | ../CHANGELOG.md -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | import sys, os 2 | import sphinx_rtd_theme 3 | 4 | #import recommonmark 5 | import myst_parser 6 | #from recommonmark.transform import AutoStructify 7 | 8 | from sphinx.highlighting import lexers 9 | from pygments.lexers.web import PhpLexer 10 | from pygments.lexers.web import HtmlLexer 11 | from pygments.lexers.web import JsonLexer 12 | 13 | from datetime import datetime 14 | 15 | lexers['php'] = PhpLexer(startinline=True) 16 | lexers['php-annotations'] = PhpLexer(startinline=True) 17 | lexers['html'] = HtmlLexer(startinline=True) 18 | lexers['json'] = JsonLexer(startinline=True) 19 | 20 | extensions = [ 21 | #'recommonmark', 22 | 'myst_parser', 23 | 'sphinx_rtd_theme', 24 | 'sphinx_copybutton', 25 | 'sphinx_markdown_tables', 26 | ] 27 | 28 | source_suffix = ['.rst', '.md'] 29 | master_doc = 'index' 30 | 31 | project = 'Den' 32 | copyright = '2022 by Swift Otter.' 33 | author = '' 34 | version = '' 35 | release = '' 36 | 37 | exclude_patterns = ['_build'] 38 | 39 | html_theme = "sphinx_rtd_theme" 40 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 41 | html_show_sourcelink = False 42 | 43 | html_static_path = ['_static'] 44 | templates_path = ['_templates'] 45 | html_extra_path = ['_redirects'] 46 | 47 | myst_enable_extensions = [ 48 | "html_admonition", 49 | "strikethrough", 50 | "colon_fence", 51 | ] 52 | 53 | #def setup(app): 54 | #app.add_config_value('myst_parser_config', { 55 | # 56 | #}, True) 57 | #app.add_config_value('recommonmark_config', { 58 | # 'auto_toc_tree_section': ['Table of Contents'], 59 | # 'enable_math': False, 60 | # 'enable_inline_math': False, 61 | # 'enable_eval_rst': True, 62 | #}, True) 63 | #app.add_transform(AutoStructify) 64 | -------------------------------------------------------------------------------- /docs/configuration.md: -------------------------------------------------------------------------------- 1 | # Den Configuration 2 | 3 | ```{toctree} 4 | --- 5 | maxdepth: 2 6 | caption: Table of Contents 7 | glob: 8 | --- 9 | 10 | configuration/* 11 | ``` 12 | -------------------------------------------------------------------------------- /docs/configuration/alternative-shells.md: -------------------------------------------------------------------------------- 1 | # Alternative Shells 2 | 3 | :::{warning} 4 | Currently the only images that support the alternative shells described here 5 | are those based off of the php-fpm image. This includes: 6 | 7 | - den-php-fpm 8 | - den-php-fpm-magento2 9 | - den-php-debug 10 | ::: 11 | 12 | Some Den containers now come with some alternative shells to BaSH. By default 13 | BaSH is the shell used when running `den shell`, and if no shell is specified 14 | Den will default to using BaSH. 15 | 16 | ## Specifying an alternative shell 17 | 18 | You can specify the shell to use when running `den shell` in three different 19 | ways. As Den parses your command it will evaluate which shell to use based on 20 | the following order of preference: 21 | 22 | 1. One-Time Specification 23 | 2. Project Specific 24 | 3. User Specific 25 | 26 | ### User Specific 27 | 28 | Edit your `~/.den/.env` file to specify the setting of 29 | `WARDEN_ENV_SHELL_COMMAND` with your choice of shell from below: 30 | 31 | ``` 32 | WARDEN_ENV_SHELL_COMMAND=fish 33 | ``` 34 | 35 | ### Project Specific 36 | 37 | Within your project environment, edit the `.env` file and specify the 38 | `WARDEN_ENV_SHELL_COMMAND` variable with your choise of shell from below: 39 | 40 | ``` 41 | WARDEN_ENV_SHELL_COMMAND=fish 42 | ``` 43 | 44 | ### One-Time Specification 45 | 46 | Using an environment variable you can specify the shell to use on a 47 | per-execution basis (or for an single session) using the variable: `USE_SHELL`. 48 | 49 | ```bash 50 | USE_SHELL=fish den shell 51 | ``` 52 | 53 | ## Available Shells 54 | 55 | The following shells are currently available for use: 56 | 57 | - ash 58 | - bash 59 | - fish 60 | - zsh (including oh my zsh) -------------------------------------------------------------------------------- /docs/configuration/blackfire.md: -------------------------------------------------------------------------------- 1 | # Blackfire Profiling 2 | 3 | For information on what Blackfire is, please see the [introduction to Blackfire](https://blackfire.io/docs/introduction) in Blackfire documentation. 4 | 5 | Blackfire may be enabled on both `magento1` and `magento2` env types by adding the following to the project's `.env` file (or exporting them to environment variables prior to starting the environment): 6 | 7 | ``` 8 | WARDEN_BLACKFIRE=1 9 | 10 | BLACKFIRE_CLIENT_ID= 11 | BLACKFIRE_CLIENT_TOKEN= 12 | BLACKFIRE_SERVER_ID= 13 | BLACKFIRE_SERVER_TOKEN= 14 | ``` 15 | 16 | Note: You can obtain the IDs and Tokens used in the above from within your Blackfire account under Account Settings -> Credentials or from the credentials are of the environment you're pushing profile information into. 17 | 18 | ## CLI Tool 19 | 20 | To use the Blackfire CLI Tool, you can run `den blackfire [arguments]`. 21 | 22 | For more information on the CLI tool, please see [Profiling CLI Commands](https://blackfire.io/docs/cookbooks/profiling-cli) in Blackfire's documentation. 23 | -------------------------------------------------------------------------------- /docs/configuration/database.md: -------------------------------------------------------------------------------- 1 | # Database Connections 2 | 3 | ## Common Settings 4 | 5 | | Name | Value/Description | 6 | | ------------------------------ |------------------------------------------------------------------| 7 | | MySQL Host | Name of your Docker Container, can be found with `warden env ps` | 8 | | MySQL Port | `3306` | 9 | | MySQL User | `magento` | 10 | | MySQL Password | `magento` | 11 | | MySQL Database | `magento` | 12 | | SSH Host, Proxy Host, Server | `tunnel.den.test` | 13 | | SSH Host Port | `2222` | 14 | | SSH User | `user` | 15 | | SSH private key file | `~/.den/tunnel/ssh_key` | 16 | 17 | ## TablePlus 18 | ![TablePlus Connection Info](screenshots/tableplus-connection.png) 19 | 20 | ## Sequel Pro / Sequel Ace 21 | ![Sequel Pro Connection Info](screenshots/sequel-pro-connection.png) 22 | 23 | ## PhpStorm 24 | ![PHPStorm Connection Config](screenshots/66998481-a0062100-f0d4-11e9-8cc0-a5691fee59c5.png) 25 | ![PHPStorm Tunnel Config](screenshots/66998483-a09eb780-f0d4-11e9-9643-8fe63dd62aad.png) 26 | ![PHPStorm Tunnel Config - Windows WSL2](screenshots/123906068-2ed7d180-d97c-11eb-9e52-ec48f6753ee7.png) 27 | 28 | ## Navicat for MySQL 29 | ![Navicat Connection Config](screenshots/navicat-connection-config.png) 30 | ![Navicat Tunnel Config](screenshots/navicat-ssh-tunnel-config.png) 31 | 32 | ## MySQL Workbench 33 | ![MySQL Workbench](screenshots/mysql-workbench-connection.png) -------------------------------------------------------------------------------- /docs/configuration/dns-resolver.md: -------------------------------------------------------------------------------- 1 | # Automatic DNS Resolution 2 | 3 | In order to allow automatic DNS resolution using the provided dnsmasq service we will need to make sure DNS request are routed through our local network. 4 | This requires some configuration. 5 | 6 | ## Configuration per network 7 | 8 | ### Mac 9 | 10 | On Mac OS, DNS resolution is configured automatically for `*.test` domains using a feature Mac OS inherits from BSD. When `den install` is run (or `den svc up` for the first time) the following contents are placed in the `/etc/resolver/test` file. This has the effect of having zero impact on DNS queries except for those under the `.test` TLD. 11 | 12 | ``` 13 | nameserver 127.0.0.1 14 | ``` 15 | 16 | If you desire to have more than this route through the `dnsmasq` container, you could place another similar file in the `/etc/resolver/` directory on a per-TLD basis, or alternatively configure all DNS lookups to pass through the `dnsmasq` container. To do this, open up Advanced connection settings for the WiFi/LAN settings in System Preferences, and go to the DNS tab. In here press the "+" button to add a new DNS record with the following IP address: `127.0.0.1` followed by fallback records: 17 | 18 | ```text 19 | 127.0.0.1 20 | 1.1.1.1 21 | 1.0.0.1 22 | ``` 23 | 24 | ### systemd-resolved 25 | 26 | This approach works on most modern (systemd based) operating systems. 27 | 28 | `systemd-resolved` can be configured to forward the requests of `.test` TLD to another DNS server. The configuration file is typically located at `/etc/systemd/resolved.conf` and `/etc/systemd/resolved.conf.d/*.conf`. Run the following commands to configure systemd-resolved: 29 | 30 | sudo mkdir -p /etc/systemd/resolved.conf.d 31 | echo -e "[Resolve]\nDNS=127.0.0.1\nDomains=~test\n" \ 32 | | sudo tee /etc/systemd/resolved.conf.d/den.conf > /dev/null 33 | sudo systemctl restart systemd-resolved 34 | 35 | ### Ubuntu resolvconf 36 | 37 | Use the `resolvconf` service to add a permanent entry in your `/etc/resolv.conf` file. 38 | 39 | Install resolvconf 40 | 41 | ```bash 42 | sudo apt update && sudo apt install resolvconf 43 | ``` 44 | 45 | Edit the `/etc/resolvconf/resolv.conf.d/base` file as follows: 46 | 47 | ```text 48 | search home net 49 | nameserver 127.0.0.1 50 | nameserver 1.1.1.1 51 | nameserver 1.0.0.1 52 | ``` 53 | 54 | Restart network-manager 55 | 56 | ```bash 57 | sudo service network-manager restart 58 | ``` 59 | 60 | :::{note} 61 | In the above examples you can replace ``1.1.1.1`` and ``1.0.0.1`` (CloudFlare) with the IP of your own preferred DNS resolution service such as ``8.8.8.8`` and ``8.8.4.4`` (Google) or ``9.9.9.9`` and ``149.112.112.112`` (Quad9) 62 | ::: 63 | 64 | ### Windows 65 | 66 | Add the local dnsmasq resolver as the first DNS server: 67 | 68 | ![Windows DNS Configuration](screenshots/123906280-8a09c400-d97c-11eb-9558-cb513f89e4c3.png) 69 | -------------------------------------------------------------------------------- /docs/configuration/elasticsearch.md: -------------------------------------------------------------------------------- 1 | # Elasticsearch 2 | 3 | Den supports use of Elasticsearch. It is enabled by default on some environments such as `magento2` where it is a baseline requirement for the application, but it can be enabled and used on other environments types such as `shopware` and `symfony` as an optional service. Please refer to specific installation guides for configuration specific to a given application. 4 | 5 | [Elasticsearch](https://www.elastic.co/) is a leading free and open search and analytics solution built on Apache Lucene. 6 | [Elastic HQ](https://www.elastichq.org/) gives you complete control over your ElasticSearch clusters, nodes, indexes, and mappings. 7 | 8 | ## Configuration 9 | 10 | To enable Elasticsearch in your project environment, add to your `.env` file: 11 | 12 | ``` 13 | WARDEN_ELASTICSEARCH=1 14 | ``` 15 | 16 | Make sure you're using the correct version: 17 | 18 | ``` 19 | ELASTICSEARCH_VERSION=... 20 | ``` 21 | 22 | ## Web Interface 23 | 24 | Elasticsearch and also ElasticHQ web interfaces associated with the project can be found at `elasticsearch` and `elastichq` subdomains (eg. `https://elasticsearch.exampleproject.test/` and `https://elastichq.exampleproject.test/`). 25 | -------------------------------------------------------------------------------- /docs/configuration/livereload.md: -------------------------------------------------------------------------------- 1 | # Grunt and LiveReload Setup 2 | 3 | LiveReload routing is currently supported only on the `magento2` environment type. Other environment types may utilize LiveReload via per-project compose configurations to setup the routing for LiveReload JS and WebSocket endpoints. 4 | 5 | ## Configuration for Magento 2 6 | 7 | Magento 2 bundles an example grunt based server-side compilation workflow which includes LiveReload and it works within the Den shell environment. In order to use this: 8 | 9 | 1. Rename or copy `Gruntfile.js.sample` file to `Gruntfile.js` in your project root. 10 | 11 | 2. Rename or copy `package.json.sample` file to `package.json` in your project root. 12 | 13 | :::{note} 14 | If you are running your dev environment on a Mac with Apple Silicon, you may encounter a compatibility issue in the next 15 | step. Before moving on to `npm install`, find the line for the package `grunt-contrib-jasmine` in `package.json` and 16 | remove it. 17 | ::: 18 | 19 | 3. Run `npm install` to install the required NodeJS packages as defined in `package.json`. 20 | 21 | 4. Merge the following into your project's `app/etc/env.php` configuration file: 22 | 23 | ```php 24 | [ 27 | 'default' => [ 28 | 'design' => [ 29 | 'footer' => [ 30 | 'absolute_footer' => '' 31 | ] 32 | ] 33 | ] 34 | ] 35 | ]; 36 | ``` 37 | 38 | :::{note} 39 | This can be accomplished via alternative means, the important part is the browser requesting ``/livereload.js?port=443`` when running the site on your local development environment. 40 | ::: 41 | 42 | 5. Run `bin/magento app:config:import` to load merged configuration into the application. 43 | 44 | **With the above configuration in place**, you'll first enter the FPM container via `den shell` and then setup as follows: 45 | 46 | 1. Clean and build the project theme using grunt: 47 | 48 | ```shell 49 | grunt clean 50 | grunt exec:blank 51 | grunt less:blank 52 | ``` 53 | 54 | 2. Thereafter, only a single command should be needed for daily development: 55 | 56 | ```shell 57 | grunt watch 58 | ``` 59 | 60 | :::{note} 61 | Grunt should be used within the php-fpm container entered via ``den shell`` 62 | ::: 63 | 64 | This setup will also be used to persist changes to your compiled CSS. When you run `grunt watch`, a LiveReload server will be started on ports 35729 within the php-fpm container and Traefik will take care of proxying the JavaScript tag and WebSocket requests to this listener. 65 | 66 | On a working setup with `grunt watch` running within `den shell` you should see something like the following in the network inspector after reloading the project in a web browser. 67 | 68 | ![LiveReload Network Requests](screenshots/livereload.png) 69 | -------------------------------------------------------------------------------- /docs/configuration/mftf.md: -------------------------------------------------------------------------------- 1 | # Magento Functional Testing Framework 2 | 3 | For information what **Magento Functional Testing Framework** is - please follow to [MFTF DevDocs](https://devdocs.magento.com/mftf/docs/introduction.html). 4 | 5 | MFTF is part of Magento 2. To run tests you need [Selenium](https://selenium.dev/) instance with [Chrome Webdriver](https://sites.google.com/a/chromium.org/chromedriver/). Den provides Docker setup that contains Selenium Standalone with Chrome. You can enable it by adding the following to the project's `.env` file (or exporting them to environment variables prior to starting the environment): 6 | 7 | ``` 8 | WARDEN_SELENIUM=1 9 | ``` 10 | 11 | After generating MFTF configuration files (`dev/tests/acceptance/.env` generated by `vendor/bin/mftf setup:env` command), you need to provide selenium hostname: 12 | 13 | ``` 14 | SELENIUM_HOST=selenium 15 | BROWSER=chrome 16 | ``` 17 | 18 | ## Running Tests 19 | 20 | We provide complex instruction on {ref}`How to run MFTF Tests ` in Den environment. 21 | 22 | ## Debugging MFTF Tests 23 | 24 | By default Den uses headless Chrome browser. If you want to preview the tests - you need to extend `.env` file and update environment containers (`den env up`) 25 | 26 | ``` 27 | WARDEN_SELENIUM_DEBUG=1 28 | ``` 29 | 30 | **Default password for VNC session is `secret`** 31 | 32 | To preview the process of testing, you need any **VLC** client that provides **SSH Tunnel** support (eg. [Remmina](https://remmina.org/how-to-install-remmina/)). To preview the process of testing, you need to use `tunnel.den.test:2222` (login: `user`): 33 | 34 | ## Remote Desktop Viewer 35 | 36 | ![Remote Desktop Viewer](screenshots/selenium-remote-desktop-viewer.png) 37 | 38 | ## Remmina 39 | 40 | ![Remmina Configuration](screenshots/remmina-ssh-tunnel.png) 41 | 42 | ## Mac OS X 43 | 44 | To preview the process in Mac OS X, you must first create an SSH tunnel to the docker instance hosting the VNC server. That would look something like: 45 | 46 | ssh -N -L localhost:5901:magento2_selenium_1:5900 tunnel.den.test 47 | 48 | Where `5901` is the port on your local computer you want to use to access the VNC server. Then, using Finder you can "Go > Connect to Server" `vnc://localhost:5901`. 49 | 50 | When you are prompted for the password it is `secret`. 51 | -------------------------------------------------------------------------------- /docs/configuration/reporting.md: -------------------------------------------------------------------------------- 1 | # Allure Reporting 2 | 3 | [Allure](http://allure.qatools.ru/) is a powerful **test reporting framework**. It is fully compatible with [PHPUnit](https://phpunit.de/) and [Codeception](https://codeception.com/). This means that each type of test available in **Magento 2** can be visualized. 4 | 5 | ## Configuration 6 | 7 | To enable Allure in your project environment, add to your `.env` file: 8 | 9 | ``` 10 | WARDEN_ALLURE=1 11 | ``` 12 | 13 | As a result both `php-fpm` and `php-debug` containers get additional mount `/var/allure-results` where the Test results should be saved. 14 | 15 | ### PHPUnit Reports 16 | 17 | To visualize your PHPUnit Tests results *(Unit, Integration, API functional, Static)* in Allure, you need to edit `phpunit.xml` file and find `` section. If you have `` node, just change the path where logs are saved: `/var/allure-results` (please notice leading `/`). 18 | 19 | ```xml 20 | 21 | 22 | 23 | 24 | /var/allure-results 25 | ... 26 | ``` 27 | 28 | ### Codeception Reports 29 | 30 | Adjusting Codeception reports path is a little bit more complicated. Please find the `dev/tests/acceptance/codeception.yml` file, under `Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter` you'll find `outputDirectory`. Change it's value to `/var/allure-results`. 31 | 32 | ```yaml 33 | extensions: 34 | config: 35 | Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter: 36 | deletePreviousResults: false 37 | outputDirectory: /var/allure-results 38 | ``` 39 | 40 | ## Web Interface 41 | 42 | Allure reports are available with your Web Browser on `allure` subdomain (eg. `https://allure.magento2.test/`). Reports are generated with 5 seconds interval. 43 | 44 | ![Example Report generated with Allure](screenshots/allure-reporting.png) 45 | -------------------------------------------------------------------------------- /docs/configuration/screenshots/123906068-2ed7d180-d97c-11eb-9e52-ec48f6753ee7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/123906068-2ed7d180-d97c-11eb-9e52-ec48f6753ee7.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/123906280-8a09c400-d97c-11eb-9558-cb513f89e4c3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/123906280-8a09c400-d97c-11eb-9558-cb513f89e4c3.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/66998481-a0062100-f0d4-11e9-8cc0-a5691fee59c5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/66998481-a0062100-f0d4-11e9-8cc0-a5691fee59c5.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/66998483-a09eb780-f0d4-11e9-9643-8fe63dd62aad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/66998483-a09eb780-f0d4-11e9-9643-8fe63dd62aad.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/allure-reporting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/allure-reporting.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/livereload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/livereload.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/mysql-workbench-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/mysql-workbench-connection.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/navicat-connection-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/navicat-connection-config.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/navicat-ssh-tunnel-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/navicat-ssh-tunnel-config.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/phpstorm-additional-xdebug-configs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/phpstorm-additional-xdebug-configs.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/remmina-ssh-tunnel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/remmina-ssh-tunnel.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/selenium-remote-desktop-viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/selenium-remote-desktop-viewer.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/sequel-pro-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/sequel-pro-connection.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/tableplus-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/tableplus-connection.png -------------------------------------------------------------------------------- /docs/configuration/screenshots/xdebug-phpstorm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swiftotter/den/1d73cb4d367985e5562c5142e0a1710e63ff3d0c/docs/configuration/screenshots/xdebug-phpstorm.png -------------------------------------------------------------------------------- /docs/configuration/xdebug.md: -------------------------------------------------------------------------------- 1 | # Xdebug Support 2 | 3 | There are two docker containers running FPM, `php-fpm`, `php-debug`. The `php-debug` container has the **Xdebug** extension pre-installed. Nginx will automatically route requests to the `php-debug` container when the `XDEBUG_SESSION` cookie has been set to `PHPSTORM` via the Xdebug Helper browser extension. 4 | 5 | Xdebug will automatically connect back to the host machine on port `9000` for `xdebug2` and `9003` for `xdebug3` for each request routed to the `php-debug` container (i.e. when the `XDEBUG_SESSION` cookie is set). When configuring Xdebug Helper in your browser, make sure it is setting this cookie with the value `PHPSTORM`. 6 | 7 | If you use a firewall, allow connection to port `9000` for `xdebug2` and `9003` for `xdebug3`. 8 | 9 | In similar fashion to the `den shell` command there is also a debug command to launch into an xdebug enabled container shell for debugging CLI workflows: 10 | 11 | ``` 12 | den debug 13 | ``` 14 | 15 | ## VSCode 16 | 17 | To configure a project in VSCode for debugging, add the following to `.vscode/launch.json` in the project directory: 18 | 19 | ```json 20 | { 21 | "version": "0.2.0", 22 | "configurations": [ 23 | { 24 | "name": "Listen for XDebug", 25 | "type": "php", 26 | "request": "launch", 27 | "port": 9003, 28 | "pathMappings": { 29 | "/var/www/html": "${workspaceRoot}" 30 | } 31 | } 32 | ] 33 | } 34 | ``` 35 | 36 | :::{note} 37 | If your project has (for example) ``WARDEN_WEB_ROOT=/webroot`` in it's ``.env`` file, to mount ``webroot/`` to ``/var/www/html`` rather than the top-level project directory, you may need to set the ``pathMapping`` above to ``${workspaceRoot}/webroot`` for the mapping to function correctly. 38 | ::: 39 | 40 | Once this configuration is in place, make sure you have the [PHP Debug extension by Felix Becker](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) installed. This is required for Xdebug support to function in VSCode. Additional information on launch settings specific to Xdebug use in VSCode [may be found here](https://github.com/felixfbecker/vscode-php-debug#vs-code-configuration). 41 | 42 | To learn more about debugging in VSCode, [please go here](https://code.visualstudio.com/docs/editor/debugging). 43 | 44 | ## PhpStorm 45 | 46 | When it receives the first request, PHP Storm should prompt you if the "Server" configuration is missing. The below image demonstrates how this is setup; the important settings are these: 47 | 48 | * Name: `clnt-docker` (this is the value of the `WARDEN_ENV_NAME` variable in the `.env` file appended with a `-docker` suffix) 49 | * Host: `127.0.0.1` 50 | * Port: `80` 51 | * Debugger: Xdebug 52 | * Use path mappings must be enabled, with a mapping to map the project root on the host to `/var/www/html` within the container. 53 | 54 | ![clnt-docker-xdebug-config](screenshots/xdebug-phpstorm.png) 55 | 56 | Additional configurations may be required, such as configuring ``DBGp Proxy`` port. 57 | 58 | ![clnt-docker-xdebug-additional-config](screenshots/phpstorm-additional-xdebug-configs.png) 59 | -------------------------------------------------------------------------------- /docs/environments.md: -------------------------------------------------------------------------------- 1 | # Environments 2 | 3 | ```{toctree} 4 | --- 5 | maxdepth: 2 6 | caption: Table of Contents 7 | glob: 8 | --- 9 | 10 | environments/types 11 | environments/magento2 12 | environments/shopware 13 | environments/* 14 | ``` 15 | -------------------------------------------------------------------------------- /docs/environments/shopware.md: -------------------------------------------------------------------------------- 1 | # Installing Shopware 6 2 | 3 | The below example demonstrates the from-scratch setup of the Shopware 6 application for local development. A similar process can easily be used to configure an environment of any other type. This assumes that Den has been previously started via `den svc up` as part of the installation procedure. 4 | 5 | 1. Create a new directory on your host machine at the location of your choice and then jump into the new directory to get started: 6 | 7 | mkdir -p ~/Sites/exampleproject 8 | cd ~/Sites/exampleproject 9 | 10 | 2. From the root of your new project directory, run `env-init` to create the `.env` file with configuration needed for Den and Docker to work with the project. 11 | 12 | den env-init exampleproject shopware 13 | 14 | The result of this command is a `.env` file in the project root (tip: commit this to your VCS to share the configuration with other team members) having the following contents: 15 | 16 | WARDEN_ENV_NAME=exampleproject 17 | WARDEN_ENV_TYPE=shopware 18 | WARDEN_WEB_ROOT=/ 19 | 20 | TRAEFIK_DOMAIN=exampleproject.test 21 | TRAEFIK_SUBDOMAIN=app 22 | 23 | WARDEN_DB=1 24 | WARDEN_REDIS=1 25 | WARDEN_RABBITMQ=0 26 | WARDEN_ELASTICSEARCH=0 27 | WARDEN_VARNISH=0 28 | 29 | DB_DISTRIBUTION=mariadb 30 | DB_DISTRIBUTION_VERSION=10.4 31 | NODE_VERSION=12 32 | COMPOSER_VERSION=2 33 | PHP_VERSION=7.4 34 | PHP_XDEBUG_3=1 35 | RABBITMQ_VERSION=3.8 36 | REDIS_VERSION=5.0 37 | VARNISH_VERSION=6.0 38 | 39 | 3. Sign an SSL certificate for use with the project (the input here should match the value of `TRAEFIK_DOMAIN` in the above `.env` example file): 40 | 41 | den sign-certificate exampleproject.test 42 | 43 | 4. Configure the project to use `./webroot` so the Shopware installer won't overwrite Den's `.env` file 44 | 45 | perl -pi -e 's#^WARDEN_WEB_ROOT.*#WARDEN_WEB_ROOT=/webroot#' .env 46 | 47 | 5. Clone the Shopware development template 48 | 49 | git clone git@github.com:shopware/development.git ./webroot 50 | 51 | 6. Next you'll want to start the project environment: 52 | 53 | den env up 54 | 55 | :::{warning} 56 | If you encounter an error about ``Mounts denied``, follow the instructions in the error message and run ``den env up`` again. 57 | ::: 58 | 59 | 7. Drop into a shell within the project environment. Commands following this step in the setup procedure will be run from within the `php-fpm` docker container this launches you into: 60 | 61 | den shell 62 | 63 | 8. Configure the `APP_URL` Shopware will use during installation: 64 | 65 | echo $'const:\n APP_URL: "https://app.exampleproject.test"\n' > .psh.yaml.override 66 | 67 | 9. Install the Shopware application complete with sample data: 68 | 69 | ./psh.phar install 70 | 71 | 10. Launch the application in your browser: 72 | 73 | - [https://app.exampleproject.test/](https://app.exampleproject.test/) 74 | - [https://app.exampleproject.test/admin/](https://app.exampleproject.test/admin/) 75 | 76 | :::{note} 77 | The default username for Shopware 6 is ``admin`` with password ``shopware``. 78 | ::: 79 | 80 | :::{note} 81 | To completely destroy the ``exampleproject`` environment we just created, run ``den env down -v`` to tear down the project's Docker containers, volumes, etc. 82 | ::: 83 | -------------------------------------------------------------------------------- /docs/images.md: -------------------------------------------------------------------------------- 1 | # Docker Images 2 | 3 | Each of the docker images used by Den environments are published on GitHub Container Registry (GHCR): [https://ghcr.io/swiftotter/den](https://ghcr.io/swiftotter/den). Source files used to build these images may be found in the `images` directory of the main project repository. Github Actions are used to automatically build and push new images to GHCR when image sources are modified. Please refer to the repositories on GHCR for a list of available image versions and tags. 4 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Welcome to Den's documentation! 2 | ================================== 3 | 4 | ```{include} ../README.md 5 | --- 6 | start-line: 1 7 | end-before: 8 | --- 9 | ``` 10 | 11 | Under the hood `docker-compose` is used to control everything which Den runs (shared services as well as per-project containers) via the Docker Engine. 12 | 13 | ## Features 14 | 15 | * Traefik for SSL termination and routing/proxying requests into the correct containers. 16 | * Dnsmasq to serve DNS responses for `.test` domains eliminating manual editing of `/etc/hosts` 17 | * An SSH tunnel for connecting from Sequel Pro or TablePlus into any one of multiple running database containers. 18 | * Den issued wildcard SSL certificates for running https on all local development domains. 19 | * Full support for Magento 1, Magento 2, Laravel, Symfony 4, Shopware 6 on both macOS (Intel and Arm) and Linux. 20 | * Ability to override, extend, or setup completely custom environment definitions on a per-project basis. 21 | * (Optional) Portainer for quick visibility into what's running inside the local Docker host. 22 | 23 | ```{toctree} 24 | --- 25 | maxdepth: 2 26 | caption: Getting Started 27 | --- 28 | 29 | installing 30 | services 31 | usage 32 | environments 33 | configuration 34 | ``` 35 | 36 | ```{toctree} 37 | --- 38 | maxdepth: 1 39 | caption: About Den 40 | --- 41 | 42 | changelog 43 | images 44 | Github Project 45 | ``` 46 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx>=5.0.0,<7.0.0 2 | sphinx_rtd_theme>=1.0.0,<2.0 3 | myst-parser>=0.18.0,<2.0 4 | sphinx-copybutton>=0.2.11,<1.0 5 | sphinx-markdown-tables>=0.0.15,<1.0 6 | jinja2>=3.0 7 | -------------------------------------------------------------------------------- /docs/services.md: -------------------------------------------------------------------------------- 1 | # Global Services 2 | 3 | After running `den svc up` for the first time following installation, the following URLs can be used to interact with the UIs for services Warden runs globally: 4 | 5 | * [https://traefik.den.test/](https://traefik.den.test/) 6 | * [https://portainer.den.test/](https://portainer.den.test/) (Only when Portainer is enabled) 7 | * [https://dnsmasq.den.test/](https://dnsmasq.den.test/) 8 | * [https://mailhog.den.test/](https://mailhog.den.test/) 9 | 10 | ## Customizable Settings 11 | 12 | When spinning up global services via `docker-compose` Den uses `~/.den` as the project directory allowing a `.env` placed at `~/.den/.env` to function for overriding variables in the `docker-compose` configuration used to deploy these services. 13 | 14 | The following options are available (with default values indicated): 15 | 16 | * `TRAEFIK_LISTEN=127.0.0.1` may be set to `0.0.0.0` for example to have Traefik accept connections from other devices on the local network. 17 | * `WARDEN_RESTART_POLICY=always` may be set to `no` to prevent Docker from restarting these service containers or any other valid [restart policy](https://docs.docker.com/config/containers/start-containers-automatically/#use-a-restart-policy) value. 18 | * `WARDEN_SERVICE_DOMAIN=den.test` may be set to a domain of your choosing if so desired. Please note that this will not currently change network settings or alter `dnsmasq` configuration. Any TLD other than `test` will require DNS resolution be manually configured. 19 | * `DEN_SERVICE_PORTAINER=0` may be set to `1` to also run Portainer when running `den svc up` 20 | 21 | :::{warning} 22 | Setting ``TRAEFIK_LISTEN=0.0.0.0`` can be quite useful in some cases, but be aware that causing Traefik to listen for requests publicly poses a security risk when on public WiFi or networks otherwise outside of your control. 23 | ::: 24 | 25 | After changing settings in `~/.den/.env`, please run `den svc up` to apply. 26 | -------------------------------------------------------------------------------- /docs/usage.md: -------------------------------------------------------------------------------- 1 | # Den Usage 2 | 3 | ## Common Commands 4 | 5 | Launch a shell session within the project environment's `php-fpm` container: 6 | 7 | den shell 8 | 9 | For use with alternative shells, see the 10 | [Alternative Shells](configuration/alternative-shells.md) page 11 | 12 | Stopping a running environment: 13 | 14 | den env stop 15 | 16 | Starting a stopped environment: 17 | 18 | den env start 19 | 20 | Import a database (if you don't have `pv` installed, use `cat` instead): 21 | 22 | pv /path/to/dump.sql.gz | gunzip -c | den db import 23 | 24 | Monitor database processlist: 25 | 26 | watch -n 3 "den db connect -A -e 'show processlist'" 27 | 28 | Tail environment nginx and php logs: 29 | 30 | den env logs --tail 0 -f nginx php-fpm php-debug 31 | 32 | Tail the varnish activity log: 33 | 34 | den env exec -T varnish varnishlog 35 | 36 | Flush varnish: 37 | 38 | den env exec -T varnish varnishadm 'ban req.url ~ .' 39 | 40 | Connect to redis: 41 | 42 | den redis 43 | 44 | Flush redis completely: 45 | 46 | den redis flushall 47 | 48 | Run redis continous stat mode 49 | 50 | den redis --stat 51 | 52 | Remove volumes completely: 53 | 54 | den env down -v 55 | 56 | ## Further Information 57 | 58 | Run `den help` and `den env -h` for more details and useful command information. 59 | -------------------------------------------------------------------------------- /environments/drupal/db.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | db: 4 | environment: 5 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-drupal} 6 | - MYSQL_DATABASE=${MYSQL_DATABASE:-drupal} 7 | - MYSQL_USER=${MYSQL_USER:-drupal} 8 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-drupal} 9 | command: 10 | - mysqld 11 | - --max_allowed_packet=1024M 12 | - --explicit_defaults_for_timestamp=on 13 | - --transaction-isolation=READ-COMMITTED -------------------------------------------------------------------------------- /environments/drupal/drupal.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | environment: 5 | - NGINX_PUBLIC=/web 6 | - NGINX_TEMPLATE=/drupal.conf -------------------------------------------------------------------------------- /environments/drupal/drupal.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - .${WARDEN_WEB_ROOT:-}/web/sites/default/files:/var/www/html/web/sites/default/files:cached 5 | - .${WARDEN_WEB_ROOT:-}/web/sites/default/private:/var/www/html/web/sites/default/private:cached 6 | - appdata:/var/www/html 7 | 8 | x-environment: &environment 9 | - CHOWN_DIR_LIST=web/sites/default/files web/sites/default/private ${CHOWN_DIR_LIST:-} 10 | 11 | services: 12 | nginx: { volumes: *volumes } 13 | php-fpm: { volumes: *volumes, environment: *environment } 14 | php-debug: { volumes: *volumes, environment: *environment } 15 | 16 | volumes: 17 | appdata: 18 | -------------------------------------------------------------------------------- /environments/drupal/drupal.mutagen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | sync: 3 | defaults: 4 | mode: two-way-resolved 5 | watch: 6 | pollingInterval: 10 7 | ignore: 8 | vcs: true 9 | paths: 10 | # Root .git folder 11 | - "/.git/" 12 | 13 | # System files 14 | - ".DS_Store" 15 | - "._*" 16 | 17 | # Vim files 18 | - "*~" 19 | - "*.sw[a-p]" 20 | 21 | # Drupal files 22 | - "web/sites/default/files/**" 23 | - "web/sites/default/private/**" 24 | 25 | 26 | permissions: 27 | defaultFileMode: "0644" 28 | defaultDirectoryMode: "0755" 29 | -------------------------------------------------------------------------------- /environments/drupal/drupal.settings.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &settings 4 | - .${WARDEN_WEB_ROOT:-}/web/sites/default/settings.php:/var/www/html/web/sites/default/settings.php 5 | 6 | services: 7 | php-fpm: { volumes: *settings } 8 | php-debug: { volumes: *settings } -------------------------------------------------------------------------------- /environments/drupal/init.env: -------------------------------------------------------------------------------- 1 | DB_DISTRIBUTION=mariadb 2 | DB_DISTRIBUTION_VERSION=10.4 3 | NODE_VERSION=18 4 | COMPOSER_VERSION=2 5 | PHP_VERSION=8.1 6 | PHP_XDEBUG_3=1 7 | 8 | WARDEN_DB=1 9 | WARDEN_RABBITMQ=0 10 | WARDEN_REDIS=0 11 | 12 | RABBITMQ_VERSION=3.8 13 | 14 | WARDEN_SYNC_IGNORE= 15 | 16 | WARDEN_ALLURE=0 17 | WARDEN_SELENIUM=0 18 | WARDEN_SELENIUM_DEBUG=0 19 | WARDEN_BLACKFIRE=0 20 | 21 | BLACKFIRE_CLIENT_ID= 22 | BLACKFIRE_CLIENT_TOKEN= 23 | BLACKFIRE_SERVER_ID= 24 | BLACKFIRE_SERVER_TOKEN= 25 | -------------------------------------------------------------------------------- /environments/drupal/init.env.cmd: -------------------------------------------------------------------------------- 1 | # If Drupal directories exist, make sure the minimum user-content upload directories exist 2 | if [[ -d "${WARDEN_ENV_PATH}/web/sites/default" ]] && [[ ! -d "${WARDEN_ENV_PATH}/web/sites/default/files" ]] 3 | then 4 | echo -e "\033[1;33m[!] \033[0mCreating missing user-content directory: \"\033[36m${WARDEN_ENV_PATH}/web/sites/default/files\033[0m\"." 5 | mkdir -p "${WARDEN_ENV_PATH}/web/sites/default/files" 6 | fi 7 | 8 | if [[ ! -d "${WARDEN_ENV_PATH}/web/sites/default/private" ]]; then 9 | echo -e "\033[1;33m[!] \033[0mCreating missing private user-content directory: \"\033[36m${WARDEN_ENV_PATH}/web/sites/default/private\033[0m\"." 10 | mkdir -p "${WARDEN_ENV_PATH}/web/sites/default/private" 11 | cat > "${WARDEN_ENV_PATH}/web/sites/default/private/.htaccess" <<-EOT 12 | # Drupal SA-CORE-2013-003 13 | # This file attempts to provide defense in depth to Apache servers. See 14 | # https://www.drupal.org/forum/newsletters/security-advisories-for-drupal-core/2013-11-20/sa-core-2013-003-drupal-core 15 | 16 | # Turn off all options we don't need. 17 | Options None 18 | Options +FollowSymLinks 19 | 20 | # Set the catch-all handler to prevent scripts from being executed. 21 | SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 22 | 23 | # Override the handler again if we're run later in the evaluation list. 24 | SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 25 | 26 | 27 | # If we know how to do it safely, disable the PHP engine entirely. 28 | 29 | php_flag engine off 30 | 31 | 32 | Deny from all 33 | EOT 34 | fi 35 | -------------------------------------------------------------------------------- /environments/includes/allure.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | allure: 4 | hostname: "${WARDEN_ENV_NAME}-allure" 5 | image: frankescobar/allure-docker-service:latest 6 | labels: 7 | - traefik.enable=true 8 | - traefik.http.routers.${WARDEN_ENV_NAME}-allure.tls=true 9 | - traefik.http.routers.${WARDEN_ENV_NAME}-allure.rule=Host(`allure.${TRAEFIK_DOMAIN}`) 10 | - traefik.http.services.${WARDEN_ENV_NAME}-allure.loadbalancer.server.port=4040 11 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 12 | # TODO; configure the Allure API; these rules result in allure sub-domain no longer routing 13 | # - traefik.http.routers.${WARDEN_ENV_NAME}-allure-api.tls=true 14 | # - traefik.http.routers.${WARDEN_ENV_NAME}-allure-api.rule=Host(`allure-api.${TRAEFIK_DOMAIN}`) 15 | # - traefik.http.services.${WARDEN_ENV_NAME}-allure-api.loadbalancer.server.port=5050 16 | volumes: 17 | - allure-results:/app/allure-results 18 | environment: 19 | CHECK_RESULTS_EVERY_SECONDS: 5 20 | KEEP_HISTORY: "TRUE" 21 | 22 | php-fpm: 23 | volumes: 24 | - allure-results:/var/allure-results 25 | 26 | php-debug: 27 | volumes: 28 | - allure-results:/var/allure-results 29 | 30 | volumes: 31 | allure-results: 32 | -------------------------------------------------------------------------------- /environments/includes/blackfire.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - ${WARDEN_SSL_DIR}/rootca/certs:/etc/ssl/warden-rootca-cert:ro 5 | - ${WARDEN_COMPOSER_DIR}:/home/www-data/.composer:cached 6 | - .${WARDEN_WEB_ROOT:-}/:/var/www/html:cached 7 | 8 | x-extra_hosts: &extra_hosts 9 | - ${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0} 10 | - ${TRAEFIK_SUBDOMAIN:-app}.${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0} 11 | 12 | services: 13 | php-blackfire: 14 | hostname: "${WARDEN_ENV_NAME}-php-blackfire" 15 | image: ${WARDEN_IMAGE_REPOSITORY}/den-php-fpm${WARDEN_SVC_PHP_VARIANT}-blackfire:${PHP_VERSION:-7.4}${WARDEN_SVC_PHP_NODE:-} 16 | environment: 17 | - TRAEFIK_DOMAIN 18 | - TRAEFIK_SUBDOMAIN 19 | - SSH_AUTH_SOCK=${SSH_AUTH_SOCK_PATH_ENV:-/tmp/ssh-auth.sock} 20 | - NODE_VERSION=${NODE_VERSION:-12} 21 | - COMPOSER_VERSION=${COMPOSER_VERSION:-1} 22 | - COMPOSER_MEMORY_LIMIT=-1 23 | - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID} 24 | - BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN} 25 | volumes: *volumes 26 | extra_hosts: *extra_hosts 27 | depends_on: 28 | - php-fpm 29 | 30 | blackfire-agent: 31 | hostname: "${WARDEN_ENV_NAME}-blackfire-agent" 32 | image: blackfire/blackfire:latest 33 | environment: 34 | - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID} 35 | - BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN} 36 | - BLACKFIRE_SERVER_ID=${BLACKFIRE_SERVER_ID} 37 | - BLACKFIRE_SERVER_TOKEN=${BLACKFIRE_SERVER_TOKEN} 38 | extra_hosts: *extra_hosts 39 | -------------------------------------------------------------------------------- /environments/includes/blackfire.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | php-blackfire: 4 | volumes: 5 | - /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock 6 | 7 | -------------------------------------------------------------------------------- /environments/includes/blackfire.linux.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | php-blackfire: 4 | volumes: 5 | - ${SSH_AUTH_SOCK:-/dev/null}:/run/host-services/ssh-auth.sock 6 | -------------------------------------------------------------------------------- /environments/includes/db.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | php-fpm: 4 | depends_on: 5 | - db 6 | 7 | db: 8 | hostname: "${WARDEN_ENV_NAME}-db" 9 | image: ${WARDEN_IMAGE_REPOSITORY}/den-${DB_DISTRIBUTION:-mariadb}:${DB_DISTRIBUTION_VERSION:-10.4} 10 | environment: 11 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-app} 12 | - MYSQL_DATABASE=${MYSQL_DATABASE:-app} 13 | - MYSQL_USER=${MYSQL_USER:-app} 14 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-app} 15 | - MYSQL_HISTFILE=/sql_history/.sql_history 16 | volumes: 17 | - dbdata:/var/lib/mysql 18 | - sqlhistory:/sql_history 19 | 20 | volumes: 21 | dbdata: 22 | sqlhistory: 23 | -------------------------------------------------------------------------------- /environments/includes/elastichq.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | elasticsearch-hq: 4 | hostname: "${WARDEN_ENV_NAME}-elasticsearch-hq" 5 | image: elastichq/elasticsearch-hq:latest 6 | labels: 7 | - traefik.enable=true 8 | - traefik.http.routers.${WARDEN_ENV_NAME}-elasticsearch-hq.tls=true 9 | - traefik.http.routers.${WARDEN_ENV_NAME}-elasticsearch-hq.rule=Host(`elastichq.${TRAEFIK_DOMAIN}`) 10 | - traefik.http.services.${WARDEN_ENV_NAME}-elasticsearch-hq.loadbalancer.server.port=5000 11 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 12 | environment: 13 | - HQ_DEFAULT_URL=http://elasticsearch:9200 14 | 15 | volumes: 16 | esdata: 17 | -------------------------------------------------------------------------------- /environments/includes/elasticsearch.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | elasticsearch: 4 | hostname: "${WARDEN_ENV_NAME}-elasticsearch" 5 | image: ${WARDEN_IMAGE_REPOSITORY}/den-elasticsearch:${ELASTICSEARCH_VERSION:-7.8} 6 | labels: 7 | - traefik.enable=true 8 | - traefik.http.routers.${WARDEN_ENV_NAME}-elasticsearch.tls=true 9 | - traefik.http.routers.${WARDEN_ENV_NAME}-elasticsearch.rule=Host(`elasticsearch.${TRAEFIK_DOMAIN}`) 10 | - traefik.http.services.${WARDEN_ENV_NAME}-elasticsearch.loadbalancer.server.port=9200 11 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 12 | environment: 13 | - discovery.type=single-node 14 | - xpack.security.enabled=false 15 | - "ES_JAVA_OPTS=-Xms64m -Xmx512m" 16 | volumes: 17 | - esdata:/usr/share/elasticsearch/data 18 | 19 | volumes: 20 | esdata: 21 | -------------------------------------------------------------------------------- /environments/includes/networks.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | networks: 3 | default: 4 | labels: 5 | - dev.warden.environment.name=${WARDEN_ENV_NAME} 6 | - dev.warden.environment.type=${WARDEN_ENV_TYPE} 7 | -------------------------------------------------------------------------------- /environments/includes/nginx.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | hostname: "${WARDEN_ENV_NAME}-nginx" 5 | image: ${WARDEN_IMAGE_REPOSITORY}/den-nginx:${NGINX_VERSION:-1.16} 6 | labels: 7 | - traefik.enable=true 8 | - traefik.http.routers.${WARDEN_ENV_NAME}-nginx.tls=true 9 | - traefik.http.routers.${WARDEN_ENV_NAME}-nginx.priority=2 10 | - traefik.http.routers.${WARDEN_ENV_NAME}-nginx.rule= 11 | HostRegexp(`{subdomain:.+}.${TRAEFIK_DOMAIN}`) || Host(`${TRAEFIK_DOMAIN}`) 12 | - traefik.http.services.${WARDEN_ENV_NAME}-nginx.loadbalancer.server.port=80 13 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 14 | volumes: 15 | - .${WARDEN_WEB_ROOT:-}/:/var/www/html:cached 16 | environment: 17 | - XDEBUG_CONNECT_BACK_HOST=${XDEBUG_CONNECT_BACK_HOST:-''} 18 | -------------------------------------------------------------------------------- /environments/includes/nginx.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | environment: 5 | - XDEBUG_CONNECT_BACK_HOST=${XDEBUG_CONNECT_BACK_HOST:-host.docker.internal} 6 | -------------------------------------------------------------------------------- /environments/includes/opensearch.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | opensearch: 4 | hostname: "${WARDEN_ENV_NAME}-opensearch" 5 | image: ${WARDEN_IMAGE_REPOSITORY}/den-opensearch:${OPENSEARCH_VERSION:-1.2} 6 | labels: 7 | - traefik.enable=true 8 | - traefik.http.routers.${WARDEN_ENV_NAME}-opensearch.tls=true 9 | - traefik.http.routers.${WARDEN_ENV_NAME}-opensearch.rule=Host(`opensearch.${TRAEFIK_DOMAIN}`) 10 | - traefik.http.services.${WARDEN_ENV_NAME}-opensearch.loadbalancer.server.port=9200 11 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 12 | environment: 13 | - DISABLE_SECURITY_PLUGIN=true 14 | - discovery.type=single-node 15 | - "ES_JAVA_OPTS=-Xms64m -Xmx512m" 16 | volumes: 17 | - osdata:/usr/share/opensearch/data 18 | 19 | volumes: 20 | osdata: 21 | -------------------------------------------------------------------------------- /environments/includes/php-fpm.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - ${WARDEN_SSL_DIR}/rootca/certs:/etc/ssl/warden-rootca-cert:ro 5 | - ${WARDEN_COMPOSER_DIR}:/home/www-data/.composer:cached 6 | - .${WARDEN_WEB_ROOT:-}/:/var/www/html:cached 7 | - bashhistory:/bash_history 8 | - sshdirectory:/home/www-data/.ssh 9 | 10 | x-extra_hosts: &extra_hosts 11 | - ${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0} 12 | - ${TRAEFIK_SUBDOMAIN:-app}.${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0} 13 | 14 | services: 15 | nginx: 16 | depends_on: 17 | - php-fpm 18 | 19 | php-fpm: 20 | hostname: "${WARDEN_ENV_NAME}-php-fpm" 21 | image: ${WARDEN_IMAGE_REPOSITORY}/den-php-fpm${WARDEN_SVC_PHP_VARIANT:-}:${PHP_VERSION:-7.4}${WARDEN_SVC_PHP_NODE:-} 22 | environment: 23 | - TRAEFIK_DOMAIN 24 | - TRAEFIK_SUBDOMAIN 25 | - SSH_AUTH_SOCK=${SSH_AUTH_SOCK_PATH_ENV:-/tmp/ssh-auth.sock} 26 | - NODE_VERSION=${NODE_VERSION:-12} 27 | - COMPOSER_VERSION=${COMPOSER_VERSION:-1} 28 | - COMPOSER_MEMORY_LIMIT=-1 29 | - HISTFILE=/bash_history/.bash_history 30 | - CHOWN_DIR_LIST=${CHOWN_DIR_LIST:-} 31 | volumes: *volumes 32 | extra_hosts: *extra_hosts 33 | 34 | php-debug: 35 | hostname: "${WARDEN_ENV_NAME}-php-debug" 36 | image: ${WARDEN_IMAGE_REPOSITORY}/den-php-fpm${WARDEN_SVC_PHP_VARIANT:-}-debug:${PHP_VERSION:-7.4}${WARDEN_SVC_PHP_NODE:-} 37 | environment: 38 | - TRAEFIK_DOMAIN 39 | - TRAEFIK_SUBDOMAIN 40 | - SSH_AUTH_SOCK=${SSH_AUTH_SOCK_PATH_ENV:-/tmp/ssh-auth.sock} 41 | - NODE_VERSION=${NODE_VERSION:-12} 42 | - COMPOSER_VERSION=${COMPOSER_VERSION:-1} 43 | - COMPOSER_MEMORY_LIMIT=-1 44 | - PHP_IDE_CONFIG=serverName=${WARDEN_ENV_NAME}-docker 45 | - HISTFILE=/bash_history/.bash_history 46 | - CHOWN_DIR_LIST=${CHOWN_DIR_LIST:-} 47 | volumes: *volumes 48 | extra_hosts: *extra_hosts 49 | depends_on: 50 | - php-fpm 51 | volumes: 52 | bashhistory: 53 | sshdirectory: 54 | -------------------------------------------------------------------------------- /environments/includes/php-fpm.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock 5 | 6 | services: 7 | php-fpm: { volumes: *volumes } 8 | php-debug: { volumes: *volumes } 9 | -------------------------------------------------------------------------------- /environments/includes/php-fpm.linux.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - ${SSH_AUTH_SOCK:-/dev/null}:/run/host-services/ssh-auth.sock 5 | 6 | services: 7 | php-fpm: { volumes: *volumes } 8 | php-debug: { volumes: *volumes } 9 | -------------------------------------------------------------------------------- /environments/includes/rabbitmq.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | rabbitmq: 4 | hostname: "${WARDEN_ENV_NAME}-rabbitmq" 5 | image: ${WARDEN_IMAGE_REPOSITORY}/den-rabbitmq:${RABBITMQ_VERSION:-3.8} 6 | labels: 7 | - traefik.enable=true 8 | - traefik.http.routers.${WARDEN_ENV_NAME}-rabbitmq.tls=true 9 | - traefik.http.routers.${WARDEN_ENV_NAME}-rabbitmq.rule=Host(`rabbitmq.${TRAEFIK_DOMAIN}`) 10 | - traefik.http.services.${WARDEN_ENV_NAME}-rabbitmq.loadbalancer.server.port=15672 11 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 12 | volumes: 13 | - rabbitmq:/var/lib/rabbitmq 14 | 15 | volumes: 16 | rabbitmq: 17 | -------------------------------------------------------------------------------- /environments/includes/redis.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | redis: 4 | hostname: "${WARDEN_ENV_NAME}-redis" 5 | image: ${WARDEN_IMAGE_REPOSITORY}/den-redis:${REDIS_VERSION:-5.0} 6 | volumes: 7 | - redis:/data 8 | 9 | volumes: 10 | redis: 11 | -------------------------------------------------------------------------------- /environments/includes/selenium.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | selenium: 4 | hostname: ${WARDEN_ENV_NAME}_selenium 5 | image: seleniarm/standalone-chromium:${WARDEN_SELENIUM_VERSION:-latest} 6 | extra_hosts: 7 | - ${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0} 8 | - ${TRAEFIK_SUBDOMAIN:-app}.${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0} 9 | -------------------------------------------------------------------------------- /environments/includes/varnish.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | labels: 5 | - traefik.enable=false 6 | - traefik.http.routers.${WARDEN_ENV_NAME}-nginx.priority=2 7 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 8 | 9 | varnish: 10 | hostname: "${WARDEN_ENV_NAME}-varnish" 11 | image: ${WARDEN_IMAGE_REPOSITORY}/den-varnish:${VARNISH_VERSION:-6.0} 12 | depends_on: 13 | - nginx 14 | labels: 15 | - traefik.enable=true 16 | - traefik.http.routers.${WARDEN_ENV_NAME}-varnish.tls=true 17 | - traefik.http.routers.${WARDEN_ENV_NAME}-varnish.priority=1 18 | - traefik.http.routers.${WARDEN_ENV_NAME}-varnish.rule= 19 | HostRegexp(`{subdomain:.+}.${TRAEFIK_DOMAIN}`) || Host(`${TRAEFIK_DOMAIN}`) 20 | - traefik.http.services.${WARDEN_ENV_NAME}-varnish.loadbalancer.server.port=80 21 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 22 | -------------------------------------------------------------------------------- /environments/laravel/db.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | db: 4 | environment: 5 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-laravel} 6 | - MYSQL_DATABASE=${MYSQL_DATABASE:-laravel} 7 | - MYSQL_USER=${MYSQL_USER:-laravel} 8 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-laravel} 9 | -------------------------------------------------------------------------------- /environments/laravel/init.env: -------------------------------------------------------------------------------- 1 | 2 | DB_DISTRIBUTION=mariadb 3 | DB_DISTRIBUTION_VERSION=10.4 4 | NODE_VERSION=12 5 | COMPOSER_VERSION=1 6 | PHP_VERSION=7.4 7 | PHP_XDEBUG_3=1 8 | REDIS_VERSION=5.0 9 | 10 | WARDEN_DB=1 11 | WARDEN_REDIS=1 12 | 13 | ## Laravel Config 14 | APP_URL=http://app.$WARDEN_ENV_NAME.test 15 | APP_KEY=$GENERATED_APP_KEY 16 | 17 | APP_ENV=local 18 | APP_DEBUG=true 19 | 20 | DB_CONNECTION=mysql 21 | DB_HOST=db 22 | DB_PORT=3306 23 | DB_DATABASE=laravel 24 | DB_USERNAME=laravel 25 | DB_PASSWORD=laravel 26 | 27 | CACHE_DRIVER=redis 28 | SESSION_DRIVER=redis 29 | 30 | REDIS_HOST=redis 31 | REDIS_PORT=6379 32 | 33 | MAIL_DRIVER=sendmail 34 | -------------------------------------------------------------------------------- /environments/laravel/laravel.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | environment: 5 | - NGINX_PUBLIC=/public 6 | -------------------------------------------------------------------------------- /environments/local/local.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | -------------------------------------------------------------------------------- /environments/magento-cloud/init.env: -------------------------------------------------------------------------------- 1 | 2 | WARDEN_DB=1 3 | WARDEN_ELASTICHQ=0 4 | WARDEN_VARNISH=1 5 | WARDEN_RABBITMQ=1 6 | WARDEN_REDIS=1 7 | WARDEN_ELASTICSEARCH=%ELASTICSEARCH_ENABLED% 8 | WARDEN_OPENSEARCH=%OPENSEARCH_ENABLED% 9 | 10 | ELASTICSEARCH_VERSION=%ELASTICSEARCH_VERSION% 11 | OPENSEARCH_VERSION=%OPENSEARCH_VERSION% 12 | DB_DISTRIBUTION=mariadb 13 | DB_DISTRIBUTION_VERSION=%MARIADB_VERSION% 14 | NODE_VERSION=12 15 | COMPOSER_VERSION=%COMPOSER_VERSION% 16 | PHP_VERSION=%PHP_VERSION% 17 | PHP_XDEBUG_3=1 18 | RABBITMQ_VERSION=%RABBITMQ_VERSION% 19 | REDIS_VERSION=%REDIS_VERSION% 20 | VARNISH_VERSION=6.0 21 | 22 | WARDEN_SYNC_IGNORE= 23 | 24 | WARDEN_ALLURE=0 25 | WARDEN_SELENIUM=0 26 | WARDEN_SELENIUM_DEBUG=0 27 | WARDEN_BLACKFIRE=0 28 | WARDEN_SPLIT_SALES=0 29 | WARDEN_SPLIT_CHECKOUT=0 30 | WARDEN_TEST_DB=0 31 | WARDEN_MAGEPACK=0 32 | 33 | BLACKFIRE_CLIENT_ID= 34 | BLACKFIRE_CLIENT_TOKEN= 35 | BLACKFIRE_SERVER_ID= 36 | BLACKFIRE_SERVER_TOKEN= 37 | 38 | CLOUD_PROJECT=%PROJECT% 39 | CLOUD_ENVIRONMENT=%ENVIRONMENT% 40 | -------------------------------------------------------------------------------- /environments/magento-cloud/init.env.cmd: -------------------------------------------------------------------------------- 1 | function getProjectAndEnvironment { 2 | 3 | if [[ -f ".magento/local/project.yaml" ]] && [[ -f ".git/HEAD" ]]; then 4 | PROJECT=$(cat .magento/local/project.yaml | grep id | sed "s/id: //") 5 | ENVIRONMENT=$(cat .git/HEAD | sed "s/ref: refs\/heads\///") 6 | fi 7 | 8 | if [ -z "$PROJECT" ]; then 9 | ENV_DATA=$(magento-cloud environment:info --format=csv --no-header) 10 | [[ $ENV_DATA =~ ^id,([^[:space:]]*) ]] && ENVIRONMENT=${BASH_REMATCH[1]} 11 | [[ $ENV_DATA =~ project,([a-z|A-Z|1-9]*) ]] && PROJECT=${BASH_REMATCH[1]} 12 | fi 13 | } 14 | 15 | function getPHPVersion { 16 | ENV_DATA=$(magento-cloud apps --format=csv --no-header --project=$PROJECT --environment=$ENVIRONMENT) 17 | [[ $ENV_DATA =~ php:([0-9|\.]*) ]] && PHP_VERSION=${BASH_REMATCH[1]} 18 | } 19 | 20 | function getDBVersion { 21 | ENV_DATA=$(magento-cloud services --format=csv --no-header --project=$PROJECT --environment=$ENVIRONMENT) 22 | if [[ $ENV_DATA =~ elasticsearch:([0-9|\.]*) ]] 23 | then 24 | ELASTICSEARCH_VERSION=${BASH_REMATCH[1]} 25 | ELASTICSEARCH_ENABLED=1 26 | else 27 | if [[ $ENV_DATA =~ opensearch:([0-9|\.]*) ]] 28 | then 29 | OPENSEARCH_VERSION=${BASH_REMATCH[1]} 30 | OPENSEARCH_ENABLED=1 31 | fi 32 | fi 33 | if [[ $ENV_DATA =~ mysql:([0-9|\.]*) ]] 34 | then 35 | MARIADB_VERSION=${BASH_REMATCH[1]} 36 | fi 37 | if [[ $ENV_DATA =~ redis:([0-9|\.]*) ]] 38 | then 39 | REDIS_VERSION=${BASH_REMATCH[1]} 40 | fi 41 | if [[ $ENV_DATA =~ rabbitmq:([0-9|\.]*) ]] 42 | then 43 | RABBITMQ_VERSION=${BASH_REMATCH[1]} 44 | fi 45 | } 46 | 47 | function getComposerVersion { 48 | ENV_DATA=$(magento-cloud -q ssh 'composer --version' --project=$PROJECT --environment=$ENVIRONMENT) 49 | if [[ $ENV_DATA =~ 1\.([0-9]*)\. ]] 50 | then 51 | COMPOSER_VERSION=1 52 | else 53 | COMPOSER_VERSION=2 54 | fi 55 | } 56 | 57 | function checkMagentoCloudCli { 58 | if ! command -v magento-cloud &> /dev/null 59 | then 60 | echo -e "\033[33mmagento-cloud-cli could not be found.\033[0m" 61 | exit 1 62 | fi 63 | } 64 | 65 | checkMagentoCloudCli 66 | getProjectAndEnvironment 67 | getPHPVersion 68 | getDBVersion 69 | getComposerVersion 70 | 71 | cat .env | \ 72 | sed "s/=magento-cloud/=magento2/g" | \ 73 | sed "s/%MARIADB_VERSION%/${MARIADB_VERSION:-10.3}/g" | \ 74 | sed "s/%COMPOSER_VERSION%/${COMPOSER_VERSION:-1}/g" | \ 75 | sed "s/%PHP_VERSION%/${PHP_VERSION:-7.4}/g" | \ 76 | sed "s/%RABBITMQ_VERSION%/${RABBITMQ_VERSION:-3.8}/g" | \ 77 | sed "s/%REDIS_VERSION%/${REDIS_VERSION:-5.0}/g" | \ 78 | sed "s/%ELASTICSEARCH_ENABLED%/${ELASTICSEARCH_ENABLED:-0}/g" | \ 79 | sed "s/%ELASTICSEARCH_VERSION%/${ELASTICSEARCH_VERSION:-7.6}/g" | \ 80 | sed "s/%OPENSEARCH_ENABLED%/${OPENSEARCH_ENABLED:-0}/g" | \ 81 | sed "s/%OPENSEARCH_VERSION%/${OPENSEARCH_VERSION:-1.2}/g" | \ 82 | sed "s/%PROJECT%/${PROJECT}/g" | \ 83 | sed "s/%ENVIRONMENT%/${ENVIRONMENT}/g" > .env 84 | 85 | 86 | function getEnvironmentVariables { 87 | ENV_DATA=$(magento-cloud var --columns=Name --level=environment --no-header --format=csv --project=$PROJECT --environment=$ENVIRONMENT) 88 | ENV_DATA=$(echo "$ENV_DATA" | sort -u) 89 | mkdir -p .warden 90 | echo "version: '3.5' 91 | services: 92 | php-fpm: 93 | environment:" > .warden/warden-env.yml 94 | 95 | for LINE in $ENV_DATA 96 | do 97 | if [[ $LINE =~ ^env:([a-zA-Z0-9_]+) ]] 98 | then 99 | VAR=$(magento-cloud vget --property=value --level=environment --project=$PROJECT --environment=$ENVIRONMENT $LINE) 100 | LINE=$(echo $LINE | sed 's/env://g') 101 | echo " $LINE: '$VAR'" >> .warden/warden-env.yml 102 | fi 103 | done 104 | } 105 | 106 | while true; do 107 | read -p $'\033[32mDo you want to import the Environment variables from '"$ENVIRONMENT"'? y/n\033[0m ' resp 108 | case $resp in 109 | [Yy]*) 110 | echo "Saving enviroment variables in .warden/warden-env.yml"; 111 | getEnvironmentVariables 112 | break;; 113 | [Nn]*) exit;; 114 | *) echo "Please answer (y)es or (n)o";; 115 | esac 116 | done 117 | -------------------------------------------------------------------------------- /environments/magento-cloud/magento-cloud.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | -------------------------------------------------------------------------------- /environments/magento1/db.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | db: 4 | environment: 5 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-magento} 6 | - MYSQL_DATABASE=${MYSQL_DATABASE:-magento} 7 | - MYSQL_USER=${MYSQL_USER:-magento} 8 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-magento} 9 | command: 10 | - mysqld 11 | - --max_allowed_packet=1024M 12 | -------------------------------------------------------------------------------- /environments/magento1/init.env: -------------------------------------------------------------------------------- 1 | 2 | WARDEN_DB=1 3 | WARDEN_REDIS=1 4 | 5 | DB_DISTRIBUTION=mariadb 6 | DB_DISTRIBUTION_VERSION=10.3 7 | NODE_VERSION=12 8 | COMPOSER_VERSION=1 9 | PHP_VERSION=7.2 10 | PHP_XDEBUG_3=1 11 | REDIS_VERSION=5.0 12 | 13 | WARDEN_SELENIUM=0 14 | WARDEN_SELENIUM_DEBUG=0 15 | WARDEN_BLACKFIRE=0 16 | 17 | BLACKFIRE_CLIENT_ID= 18 | BLACKFIRE_CLIENT_TOKEN= 19 | BLACKFIRE_SERVER_ID= 20 | BLACKFIRE_SERVER_TOKEN= 21 | 22 | -------------------------------------------------------------------------------- /environments/magento1/magento1.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | environment: 5 | - NGINX_PUBLIC=${NGINX_PUBLIC:-} 6 | - NGINX_TEMPLATE=magento1.conf 7 | 8 | php-fpm: 9 | environment: 10 | - MAGE_IS_DEVELOPER_MODE=1 11 | 12 | php-debug: 13 | environment: 14 | - MAGE_IS_DEVELOPER_MODE=1 15 | -------------------------------------------------------------------------------- /environments/magento1/magento1.blackfire.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - .${WARDEN_WEB_ROOT:-}/media:/var/www/html/media:cached 5 | - appdata:/var/www/html 6 | 7 | x-environment: &environment 8 | - CHOWN_DIR_LIST=media ${CHOWN_DIR_LIST:-} 9 | 10 | services: 11 | php-blackfire: { volumes: *volumes, environment: *environment } 12 | -------------------------------------------------------------------------------- /environments/magento1/magento1.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - .${WARDEN_WEB_ROOT:-}/media:/var/www/html/media:cached 5 | - appdata:/var/www/html 6 | 7 | x-environment: &environment 8 | - CHOWN_DIR_LIST=media ${CHOWN_DIR_LIST:-} 9 | 10 | services: 11 | nginx: { volumes: *volumes } 12 | php-fpm: { volumes: *volumes, environment: *environment } 13 | php-debug: { volumes: *volumes, environment: *environment } 14 | 15 | volumes: 16 | appdata: 17 | -------------------------------------------------------------------------------- /environments/magento1/magento1.mutagen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | sync: 3 | defaults: 4 | mode: two-way-resolved 5 | watch: 6 | pollingInterval: 10 7 | ignore: 8 | vcs: true 9 | paths: 10 | # System files 11 | - ".DS_Store" 12 | - "._*" 13 | 14 | # Vim files 15 | - "*~" 16 | - "*.sw[a-p]" 17 | 18 | # Magento files 19 | - "/media" 20 | - "/var/**" 21 | 22 | permissions: 23 | defaultFileMode: "0644" 24 | defaultDirectoryMode: "0755" 25 | -------------------------------------------------------------------------------- /environments/magento2/db.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | db: 4 | environment: 5 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-magento} 6 | - MYSQL_DATABASE=${MYSQL_DATABASE:-magento} 7 | - MYSQL_USER=${MYSQL_USER:-magento} 8 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-magento} 9 | command: 10 | - mysqld 11 | - --max_allowed_packet=1024M 12 | - --explicit_defaults_for_timestamp=on 13 | -------------------------------------------------------------------------------- /environments/magento2/init.env: -------------------------------------------------------------------------------- 1 | 2 | WARDEN_DB=1 3 | WARDEN_ELASTICSEARCH=0 4 | WARDEN_OPENSEARCH=1 5 | WARDEN_ELASTICHQ=0 6 | WARDEN_VARNISH=1 7 | WARDEN_RABBITMQ=1 8 | WARDEN_REDIS=1 9 | 10 | OPENSEARCH_VERSION=2.5 11 | DB_DISTRIBUTION=mariadb 12 | DB_DISTRIBUTION_VERSION=10.6 13 | NODE_VERSION=12 14 | COMPOSER_VERSION=2.2 15 | PHP_VERSION=8.1 16 | PHP_XDEBUG_3=1 17 | RABBITMQ_VERSION=3.9 18 | REDIS_VERSION=7.0 19 | VARNISH_VERSION=7.1 20 | 21 | WARDEN_SYNC_IGNORE= 22 | 23 | WARDEN_ALLURE=0 24 | WARDEN_SELENIUM=0 25 | WARDEN_SELENIUM_DEBUG=0 26 | WARDEN_BLACKFIRE=0 27 | WARDEN_SPLIT_SALES=0 28 | WARDEN_SPLIT_CHECKOUT=0 29 | WARDEN_TEST_DB=0 30 | WARDEN_MAGEPACK=0 31 | 32 | BLACKFIRE_CLIENT_ID= 33 | BLACKFIRE_CLIENT_TOKEN= 34 | BLACKFIRE_SERVER_ID= 35 | BLACKFIRE_SERVER_TOKEN= 36 | 37 | -------------------------------------------------------------------------------- /environments/magento2/magento2.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | environment: 5 | - NGINX_PUBLIC=/pub 6 | - NGINX_TEMPLATE=magento2.conf 7 | 8 | php-fpm: 9 | labels: 10 | - traefik.enable=true 11 | - traefik.http.routers.${WARDEN_ENV_NAME}-livereload.tls=true 12 | - traefik.http.routers.${WARDEN_ENV_NAME}-livereload.priority=3 13 | - traefik.http.routers.${WARDEN_ENV_NAME}-livereload.rule= 14 | (HostRegexp(`{subdomain:.+}.${TRAEFIK_DOMAIN}`) || Host(`${TRAEFIK_DOMAIN}`)) 15 | && (Path(`/livereload.js`) || Path(`/livereload`)) 16 | - traefik.http.routers.${WARDEN_ENV_NAME}-livereload.service=${WARDEN_ENV_NAME}-livereload 17 | - traefik.http.services.${WARDEN_ENV_NAME}-livereload.loadbalancer.server.port=35729 18 | - traefik.docker.network=${WARDEN_ENV_NAME}_default 19 | environment: 20 | - MAGE_DEBUG_SHOW_ARGS=1 21 | 22 | php-debug: 23 | environment: 24 | - MAGE_DEBUG_SHOW_ARGS=1 25 | -------------------------------------------------------------------------------- /environments/magento2/magento2.blackfire.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - .${WARDEN_WEB_ROOT:-}/pub/media:/var/www/html/pub/media:cached 5 | - appdata:/var/www/html 6 | 7 | x-environment: &environment 8 | - CHOWN_DIR_LIST=pub/media ${CHOWN_DIR_LIST:-} 9 | 10 | services: 11 | php-blackfire: { volumes: *volumes, environment: *environment } 12 | -------------------------------------------------------------------------------- /environments/magento2/magento2.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - .${WARDEN_WEB_ROOT:-}/pub/media:/var/www/html/pub/media:cached 5 | - appdata:/var/www/html 6 | 7 | x-environment: &environment 8 | - CHOWN_DIR_LIST=pub/media ${CHOWN_DIR_LIST:-} 9 | 10 | services: 11 | nginx: { volumes: *volumes } 12 | php-fpm: { volumes: *volumes, environment: *environment } 13 | php-debug: { volumes: *volumes, environment: *environment } 14 | 15 | volumes: 16 | appdata: 17 | -------------------------------------------------------------------------------- /environments/magento2/magento2.magepack.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | magepack: 4 | hostname: "${WARDEN_ENV_NAME}-magepack" 5 | image: ${WARDEN_IMAGE_REPOSITORY}/den-magepack:${MAGEPACK_VERSION:-2.3} 6 | environment: 7 | - TRAEFIK_DOMAIN 8 | - TRAEFIK_SUBDOMAIN 9 | extra_hosts: 10 | - ${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0} 11 | - ${TRAEFIK_SUBDOMAIN:-app}.${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0} 12 | depends_on: 13 | - php-fpm 14 | -------------------------------------------------------------------------------- /environments/magento2/magento2.magepack.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - .${WARDEN_WEB_ROOT:-}/pub/media:/var/www/html/pub/media:cached 5 | - appdata:/var/www/html 6 | 7 | services: 8 | magepack: { volumes: *volumes } 9 | -------------------------------------------------------------------------------- /environments/magento2/magento2.magepack.linux.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - .${WARDEN_WEB_ROOT:-}/:/var/www/html 5 | 6 | services: 7 | magepack: { volumes: *volumes } 8 | -------------------------------------------------------------------------------- /environments/magento2/magento2.mutagen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | sync: 3 | defaults: 4 | mode: two-way-resolved 5 | watch: 6 | pollingInterval: 10 7 | ignore: 8 | vcs: false 9 | paths: 10 | # Root .git folder 11 | - "/.git/" 12 | 13 | # System files 14 | - ".DS_Store" 15 | - "._*" 16 | 17 | # Vim files 18 | - "*~" 19 | - "*.sw[a-p]" 20 | 21 | # Magento files 22 | - "/pub/media" 23 | - "/pub/static/**" 24 | - "!/pub/static/.htaccess" 25 | - "/var/**" 26 | - "!/var/.htaccess" 27 | 28 | permissions: 29 | defaultFileMode: "0644" 30 | defaultDirectoryMode: "0755" 31 | -------------------------------------------------------------------------------- /environments/magento2/magento2.splitdb.checkout.base.yml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | services: 3 | php-fpm: 4 | depends_on: 5 | - checkoutdb 6 | 7 | php-debug: 8 | depends_on: 9 | - checkoutdb 10 | 11 | checkoutdb: 12 | hostname: "${WARDEN_ENV_NAME}-checkoutdb" 13 | image: ${WARDEN_IMAGE_REPOSITORY}/den-${DB_DISTRIBUTION:-mariadb}:${DB_DISTRIBUTION_VERSION:-10.4} 14 | environment: 15 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-magento} 16 | - MYSQL_DATABASE=${MYSQL_DATABASE:-magento} 17 | - MYSQL_USER=${MYSQL_USER:-magento} 18 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-magento} 19 | command: 20 | - mysqld 21 | - --max_allowed_packet=1024M 22 | volumes: 23 | - checkoutdbdata:/var/lib/mysql 24 | 25 | volumes: 26 | checkoutdbdata: 27 | -------------------------------------------------------------------------------- /environments/magento2/magento2.splitdb.sales.base.yml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | services: 3 | php-fpm: 4 | depends_on: 5 | - salesdb 6 | 7 | php-debug: 8 | depends_on: 9 | - salesdb 10 | 11 | salesdb: 12 | hostname: "${WARDEN_ENV_NAME}-salesdb" 13 | image: $${WARDEN_IMAGE_REPOSITORY}/den-${DB_DISTRIBUTION:-mariadb}:${DB_DISTRIBUTION_VERSION:-10.4} 14 | environment: 15 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-magento} 16 | - MYSQL_DATABASE=${MYSQL_DATABASE:-magento} 17 | - MYSQL_USER=${MYSQL_USER:-magento} 18 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-magento} 19 | command: 20 | - mysqld 21 | - --max_allowed_packet=1024M 22 | volumes: 23 | - salesdbdata:/var/lib/mysql 24 | 25 | volumes: 26 | salesdbdata: 27 | -------------------------------------------------------------------------------- /environments/magento2/magento2.tests.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | tmp-mysql: 4 | hostname: "${WARDEN_ENV_NAME}-test-db" 5 | image: ${WARDEN_IMAGE_REPOSITORY}/den-${DB_DISTRIBUTION:-mariadb}:${DB_DISTRIBUTION_VERSION:-10.4} 6 | environment: 7 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-magento} 8 | - MYSQL_DATABASE=magento_integration_tests 9 | - MYSQL_USER=${MYSQL_USER:-magento} 10 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-magento} 11 | command: 12 | - mysqld 13 | - --max_allowed_packet=1024M 14 | - --explicit_defaults_for_timestamp=on 15 | volumes: 16 | - tmp-dbdata:/var/lib/mysql 17 | 18 | volumes: 19 | tmp-dbdata: 20 | driver_opts: 21 | type: tmpfs 22 | device: tmpfs 23 | -------------------------------------------------------------------------------- /environments/shopware/db.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | db: 4 | networks: 5 | default: 6 | aliases: 7 | - mysql 8 | environment: 9 | MYSQL_DATABASE: ${MYSQL_DATABASE:-shopware} 10 | DB_AUTO_CREATE_DB: ${DB_AUTO_CREATE_DB:-shopware shopware_e2e shopware_test} 11 | DB_AUTO_CREATE_SH: |- 12 | if [ -n "$$MYSQL_USER" ] && [ -n "$$DB_AUTO_CREATE_DB" ]; then 13 | for MYSQL_DATABASE in $$DB_AUTO_CREATE_DB; do 14 | mysql_note "Creating database $${MYSQL_DATABASE}" 15 | docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$$MYSQL_DATABASE\`;" 16 | 17 | mysql_note "Giving user $${MYSQL_USER} access to schema $${MYSQL_DATABASE}" 18 | docker_process_sql --database=mysql <<<"GRANT ALL ON \`$${MYSQL_DATABASE//_/\\_}\`.* TO '$$MYSQL_USER'@'%';" 19 | done 20 | docker_process_sql --database=mysql <<<"FLUSH PRIVILEGES;" 21 | fi 22 | entrypoint: | 23 | /bin/bash -c ' 24 | echo "$$DB_AUTO_CREATE_SH" > /docker-entrypoint-initdb.d/db-auto-create.sh 25 | exec /usr/local/bin/docker-entrypoint.sh mysqld 26 | ' 27 | -------------------------------------------------------------------------------- /environments/shopware/init.env: -------------------------------------------------------------------------------- 1 | 2 | WARDEN_DB=1 3 | WARDEN_REDIS=1 4 | WARDEN_RABBITMQ=0 5 | WARDEN_ELASTICSEARCH=0 6 | WARDEN_VARNISH=0 7 | 8 | DB_DISTRIBUTION=mariadb 9 | DB_DISTRIBUTION_VERSION=10.4 10 | NODE_VERSION=12 11 | COMPOSER_VERSION=2 12 | PHP_VERSION=7.4 13 | PHP_XDEBUG_3=1 14 | RABBITMQ_VERSION=3.8 15 | REDIS_VERSION=5.0 16 | VARNISH_VERSION=6.0 17 | 18 | -------------------------------------------------------------------------------- /environments/shopware/shopware.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | environment: 5 | - NGINX_PUBLIC=/public 6 | -------------------------------------------------------------------------------- /environments/shopware/shopware.darwin.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | x-volumes: &volumes 4 | - .${WARDEN_WEB_ROOT:-}/public/media:/var/www/html/public/media:cached 5 | - appdata:/var/www/html 6 | 7 | x-environment: &environment 8 | - CHOWN_DIR_LIST=public/media ${CHOWN_DIR_LIST:-} 9 | 10 | services: 11 | nginx: { volumes: *volumes } 12 | php-fpm: { volumes: *volumes, environment: *environment } 13 | php-debug: { volumes: *volumes, environment: *environment } 14 | 15 | volumes: 16 | appdata: 17 | -------------------------------------------------------------------------------- /environments/shopware/shopware.mutagen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | sync: 3 | defaults: 4 | mode: two-way-resolved 5 | watch: 6 | pollingInterval: 10 7 | ignore: 8 | vcs: true 9 | paths: 10 | # System files 11 | - ".DS_Store" 12 | - "._*" 13 | 14 | # Vim files 15 | - "*~" 16 | - "*.sw[a-p]" 17 | 18 | # Application files 19 | - "/public/media" 20 | - "/var" 21 | 22 | permissions: 23 | defaultFileMode: "0644" 24 | defaultDirectoryMode: "0755" 25 | -------------------------------------------------------------------------------- /environments/symfony/db.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | db: 4 | environment: 5 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-symfony} 6 | - MYSQL_DATABASE=${MYSQL_DATABASE:-symfony} 7 | - MYSQL_USER=${MYSQL_USER:-symfony} 8 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-symfony} 9 | -------------------------------------------------------------------------------- /environments/symfony/init.env: -------------------------------------------------------------------------------- 1 | 2 | WARDEN_DB=1 3 | WARDEN_REDIS=1 4 | WARDEN_RABBITMQ=0 5 | WARDEN_ELASTICSEARCH=0 6 | WARDEN_VARNISH=0 7 | 8 | DB_DISTRIBUTION=mariadb 9 | DB_DISTRIBUTION_VERSION=10.4 10 | NODE_VERSION=12 11 | COMPOSER_VERSION=2 12 | PHP_VERSION=7.4 13 | PHP_XDEBUG_3=1 14 | RABBITMQ_VERSION=3.8 15 | REDIS_VERSION=5.0 16 | VARNISH_VERSION=6.0 17 | 18 | -------------------------------------------------------------------------------- /environments/symfony/symfony.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | nginx: 4 | environment: 5 | - NGINX_PUBLIC=/public 6 | -------------------------------------------------------------------------------- /environments/wordpress/db.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | db: 4 | environment: 5 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-wordpress} 6 | - MYSQL_DATABASE=${MYSQL_DATABASE:-wordpress} 7 | - MYSQL_USER=${MYSQL_USER:-wordpress} 8 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-wordpress} 9 | -------------------------------------------------------------------------------- /environments/wordpress/init.env: -------------------------------------------------------------------------------- 1 | 2 | DB_DISTRIBUTION=mariadb 3 | DB_DISTRIBUTION_VERSION=10.4 4 | NODE_VERSION=12 5 | COMPOSER_VERSION=1 6 | PHP_VERSION=7.4 7 | PHP_XDEBUG_3=1 8 | 9 | WARDEN_DB=1 10 | WARDEN_REDIS=0 11 | 12 | APP_ENV=local 13 | APP_DEBUG=true 14 | 15 | DB_CONNECTION=mysql 16 | DB_HOST=db 17 | DB_PORT=3306 18 | DB_DATABASE=wordpress 19 | DB_USERNAME=wordpress 20 | DB_PASSWORD=wordpress 21 | -------------------------------------------------------------------------------- /environments/wordpress/wordpress.base.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | -------------------------------------------------------------------------------- /images/.trigger: -------------------------------------------------------------------------------- 1 | 0b32907e-d50d-45d6-ad25-badeb69517f8 2 | -------------------------------------------------------------------------------- /images/dashboard/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | ADD den_entrypoint /den_entrypoint 4 | ADD index.html /usr/share/nginx/html/index.html 5 | ADD img/Dnsmasq_icon.svg /usr/share/nginx/html/img/Dnsmasq_icon.svg 6 | 7 | ENTRYPOINT [ "/den_entrypoint" ] 8 | -------------------------------------------------------------------------------- /images/dashboard/den_entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DEN_VERSION=${DEN_VERSION:-"in-dev"} 4 | 5 | # Update version with current version 6 | sed -ie "s/{{DEN_VERSION}}/${DEN_VERSION}/g" /usr/share/nginx/html/index.html 7 | 8 | # Start Nginx 9 | /docker-entrypoint.sh nginx -g 'daemon off;' 10 | -------------------------------------------------------------------------------- /images/dnsmasq/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine as builder 2 | ARG WEBPROC_VERSION=0.4.0 3 | RUN apk --no-cache add --virtual build-dependencies \ 4 | git \ 5 | && mkdir -p /root/gocode \ 6 | && export GOPATH=/root/gocode \ 7 | && go install github.com/jpillora/webproc@v${WEBPROC_VERSION} 8 | 9 | FROM alpine:3 10 | 11 | # fetch dnsmasq and webproc binary 12 | RUN apk update \ 13 | && apk --no-cache add dnsmasq 14 | 15 | COPY --from=builder /root/gocode/bin/webproc /usr/local/bin/ 16 | 17 | #configure dnsmasq 18 | RUN mkdir -p /etc/default/ 19 | RUN echo -e "ENABLED=1\nIGNORE_RESOLVCONF=yes" > /etc/default/dnsmasq 20 | COPY dnsmasq.conf /etc/dnsmasq.conf 21 | #run! 22 | ENTRYPOINT ["webproc","--configuration-file","/etc/dnsmasq.conf","--","dnsmasq","--no-daemon"] -------------------------------------------------------------------------------- /images/dnsmasq/LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | Copyright © 2018 Jaime Pillora 3 | Copyright © 2022 SwiftOtter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /images/dnsmasq/dnsmasq.conf: -------------------------------------------------------------------------------- 1 | #dnsmasq config, for a complete example, see: 2 | # http://oss.segetech.com/intra/srv/dnsmasq.conf 3 | #log all dns queries 4 | log-queries 5 | #dont use hosts nameservers 6 | no-resolv 7 | #use cloudflare as default nameservers, prefer 1^4 8 | server=1.0.0.1 9 | server=1.1.1.1 10 | strict-order 11 | #serve all .company queries using a specific nameserver 12 | server=/company/10.0.0.1 13 | #explicitly define host-ip mappings 14 | address=/myhost.company/10.0.0.2 -------------------------------------------------------------------------------- /images/elasticsearch/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ES_VERSION 2 | FROM docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION} 3 | RUN bin/elasticsearch-plugin install --batch analysis-phonetic \ 4 | && bin/elasticsearch-plugin install --batch analysis-icu 5 | -------------------------------------------------------------------------------- /images/magepack/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM zenika/alpine-chrome:with-puppeteer 2 | 3 | USER root 4 | 5 | WORKDIR /var/www/html 6 | COPY bin/generate.sh /usr/bin/generate 7 | COPY bin/bundle.sh /usr/bin/bundle 8 | 9 | ARG MAGEPACK_VERSION=2.3 10 | RUN npm install -g magepack@^${MAGEPACK_VERSION} && npm cache clean --force 11 | 12 | CMD tail -f /dev/null 13 | 14 | USER chrome 15 | -------------------------------------------------------------------------------- /images/magepack/bin/bundle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /usr/bin/magepack bundle 4 | -------------------------------------------------------------------------------- /images/magepack/bin/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /usr/bin/magepack generate "$@" 4 | -------------------------------------------------------------------------------- /images/mailhog/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine as builder 2 | 3 | # Install MailHog: 4 | ARG MAILHOG_VERSION=1.0 5 | RUN apk --no-cache add --virtual build-dependencies \ 6 | git \ 7 | && mkdir -p /root/gocode \ 8 | && export GOPATH=/root/gocode \ 9 | && go install github.com/mailhog/MailHog@v${MAILHOG_VERSION} 10 | 11 | FROM alpine:3 12 | # Add mailhog user/group with uid/gid 1000. 13 | # This is a workaround for boot2docker issue #581, see 14 | # https://github.com/boot2docker/boot2docker/issues/581 15 | RUN adduser -D -u 1000 mailhog 16 | 17 | COPY --from=builder /root/gocode/bin/MailHog /usr/local/bin/ 18 | 19 | USER mailhog 20 | 21 | WORKDIR /home/mailhog 22 | 23 | ENTRYPOINT ["MailHog"] 24 | 25 | # Expose the SMTP and HTTP ports: 26 | EXPOSE 1025 8025 27 | -------------------------------------------------------------------------------- /images/mariadb/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG MARIADB_VERSION 2 | FROM mariadb:${MARIADB_VERSION} 3 | -------------------------------------------------------------------------------- /images/mysql/.trigger: -------------------------------------------------------------------------------- 1 | 36cf4c4c-03f1-4680-8cc0-9b90cfbd766b 2 | -------------------------------------------------------------------------------- /images/mysql/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG MYSQL_VERSION 2 | FROM mysql:${MYSQL_VERSION} 3 | 4 | # MySQL 8.0 require skip-bin-log to avoid workarounds: 5 | # See: https://github.com/davidalger/warden/pull/403 6 | COPY etc/mysql/conf.d/skip-bin-log.cnf /etc/mysql/conf.d/ 7 | -------------------------------------------------------------------------------- /images/mysql/etc/mysql/conf.d/skip-bin-log.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | skip-log-bin 3 | -------------------------------------------------------------------------------- /images/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG NGINX_VERSION 2 | FROM nginx:${NGINX_VERSION}-alpine 3 | RUN apk add --no-cache bash shadow 4 | 5 | ENV NGINX_UPSTREAM_HOST php-fpm 6 | ENV NGINX_UPSTREAM_PORT 9000 7 | ENV NGINX_UPSTREAM_DEBUG_HOST php-debug 8 | ENV NGINX_UPSTREAM_DEBUG_PORT 9000 9 | ENV NGINX_UPSTREAM_BLACKFIRE_HOST php-blackfire 10 | ENV NGINX_UPSTREAM_BLACKFIRE_PORT 9000 11 | ENV NGINX_ROOT /var/www/html 12 | ENV NGINX_PUBLIC '' 13 | ENV NGINX_TEMPLATE application.conf 14 | ENV XDEBUG_CONNECT_BACK_HOST '""' 15 | 16 | COPY etc/nginx/fastcgi_params /etc/nginx/fastcgi_params.template 17 | COPY etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.template 18 | COPY etc/nginx/available.d/*.conf /etc/nginx/available.d/ 19 | 20 | CMD envsubst '${NGINX_UPSTREAM_HOST} ${NGINX_UPSTREAM_PORT} \ 21 | ${NGINX_UPSTREAM_BLACKFIRE_HOST} ${NGINX_UPSTREAM_BLACKFIRE_PORT} \ 22 | ${NGINX_UPSTREAM_DEBUG_HOST} ${NGINX_UPSTREAM_DEBUG_PORT} \ 23 | ${NGINX_ROOT} ${NGINX_PUBLIC} ${NGINX_TEMPLATE}' \ 24 | < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf \ 25 | && envsubst '${XDEBUG_CONNECT_BACK_HOST}' \ 26 | < /etc/nginx/fastcgi_params.template > /etc/nginx/fastcgi_params \ 27 | && nginx -g "daemon off;" 28 | 29 | WORKDIR /var/www/html 30 | -------------------------------------------------------------------------------- /images/nginx/etc/nginx/available.d/application.conf: -------------------------------------------------------------------------------- 1 | location ~* /\.(?!well-known).* { return 403; } 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php$is_args$query_string; 5 | } 6 | 7 | location ~ \.php$ { 8 | try_files $uri =404; 9 | expires off; 10 | 11 | fastcgi_pass $fastcgi_backend; 12 | 13 | fastcgi_buffers 1024 4k; 14 | fastcgi_buffer_size 32k; 15 | fastcgi_busy_buffers_size 256k; 16 | fastcgi_read_timeout 600s; 17 | 18 | include fastcgi_params; 19 | 20 | fastcgi_param HTTPS on; 21 | 22 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 23 | fastcgi_param DOCUMENT_ROOT $realpath_root; 24 | fastcgi_param SERVER_PORT $http_x_forwarded_port; 25 | } 26 | -------------------------------------------------------------------------------- /images/nginx/etc/nginx/available.d/drupal.conf: -------------------------------------------------------------------------------- 1 | location = /favicon.ico { 2 | log_not_found off; 3 | access_log off; 4 | } 5 | 6 | location = /robots.txt { 7 | allow all; 8 | log_not_found off; 9 | access_log off; 10 | } 11 | 12 | location ~* \.(txt|log)$ { 13 | deny all; 14 | } 15 | 16 | location ~ \..*/.*\.php$ { 17 | return 403; 18 | } 19 | 20 | location ~/sites/.*/private/ { 21 | return 403; 22 | } 23 | 24 | location ~ ^/sites/[^/]+/files/.*\.php$ { 25 | deny all; 26 | } 27 | 28 | location ~* ^/.well-known/ { 29 | allow all; 30 | } 31 | 32 | location ~ (^|/)\. { 33 | return 403; 34 | } 35 | 36 | location / { 37 | try_files $uri /index.php?$query_string; 38 | } 39 | 40 | location @rewrite { 41 | rewrite ^ /index.php; 42 | } 43 | 44 | location ~ /vendor/.*\.php$ { 45 | deny all; 46 | return 404; 47 | } 48 | 49 | location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ { 50 | deny all; 51 | return 404; 52 | } 53 | 54 | location ~ '\.php$|^/update.php' { 55 | fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 56 | # Ensure the php file exists. Mitigates CVE-2019-11043 57 | try_files $fastcgi_script_name =404; 58 | # Security note: If you're running a version of PHP older than the 59 | # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. 60 | # See http://serverfault.com/q/627903/94922 for details. 61 | include fastcgi_params; 62 | # Block httpoxy attacks. See https://httpoxy.org/. 63 | fastcgi_param HTTP_PROXY ""; 64 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 65 | fastcgi_param PATH_INFO $fastcgi_path_info; 66 | fastcgi_param QUERY_STRING $query_string; 67 | fastcgi_intercept_errors on; 68 | fastcgi_pass $fastcgi_backend; 69 | } 70 | 71 | location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { 72 | try_files $uri @rewrite; 73 | expires max; 74 | log_not_found off; 75 | } 76 | 77 | # Fighting with Styles? This little gem is amazing. 78 | location ~ ^/sites/.*/files/styles/ { 79 | try_files $uri @rewrite; 80 | } 81 | 82 | # Handle private files through Drupal. Private file's path can come 83 | # with a language prefix. 84 | location ~ ^(/[a-z\-]+)?/system/files/ { 85 | try_files $uri /index.php?$query_string; 86 | } 87 | 88 | # Enforce clean URLs 89 | # Removes index.php from urls like www.example.com/index.php/my-page --> www.example.com/my-page 90 | # Could be done with 301 for permanent or other redirect codes. 91 | if ($request_uri ~* "^(.*/)index\.php/(.*)") { 92 | return 307 $1$2; 93 | } -------------------------------------------------------------------------------- /images/nginx/etc/nginx/available.d/magento1.conf: -------------------------------------------------------------------------------- 1 | location / { 2 | try_files $uri $uri/ @handler; 3 | expires 30d; 4 | } 5 | 6 | location ~* ^/(app|includes|lib|media/customer|media/downloadable|pkginfo|var|dev)/ { return 403; } 7 | location ~* ^/RELEASE_NOTES.txt { return 404; } 8 | location ~* ^/errors/.*\.(xml|phtml)$ { return 404; } 9 | location ~* ^/cron.(sh|php) { return 404; } 10 | location ~* ^/shell/ { return 404; } 11 | location ~* ^/media/.*\.(cfg|ini|xml)$ { return 404; } 12 | location ~* ^/media/.*\.(php|pl|py|jsp|asp|htm|shtml|sh|cgi) { return 404; } 13 | location ~* /\.thumbs { } 14 | location ~* /\.(?!well-known) { return 404; } 15 | location ~* /downloader/ { return 404; } 16 | location ~* ^/?(index.php/?)?rss/(order/new|catalog/notifystock|catalog/review) { return 404; } 17 | 18 | location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ { 19 | add_header Access-Control-Allow-Origin *; 20 | expires 30d; 21 | } 22 | 23 | location ~ ^/(skin|js(?!/index\.php)|media)/ { 24 | try_files $uri $uri/ =404; 25 | expires 30d; 26 | } 27 | 28 | # to use this fallback, remove media from previous location block 29 | location /media/ { 30 | try_files $uri $uri/ /get.php; 31 | expires 30d; 32 | } 33 | 34 | # location /sitemap.xml { 35 | # try_files /sitemaps/${MAGE_RUN_CODE}_sitemap.xml =404; 36 | # } 37 | 38 | location @handler { 39 | rewrite / /index.php; 40 | } 41 | 42 | location ~ \.php/ { 43 | rewrite ^(.*.php)/ $1 last; 44 | } 45 | 46 | # used to support admin js merging 47 | location = /js/index.php/x.js { 48 | rewrite ^(.*\.php)/ $1 last; 49 | } 50 | 51 | location /api/rest { 52 | rewrite ^/api/rest /api.php?type=rest last; 53 | } 54 | 55 | location ~ \.php$ { 56 | try_files $uri =404; 57 | expires off; 58 | 59 | fastcgi_pass $fastcgi_backend; 60 | 61 | fastcgi_buffers 1024 4k; 62 | fastcgi_buffer_size 128k; 63 | fastcgi_busy_buffers_size 256k; 64 | fastcgi_read_timeout 3600s; 65 | 66 | include fastcgi_params; 67 | 68 | fastcgi_param HTTPS on; 69 | 70 | # Prevents these headers being used to exploit Zend_Controller_Request_Http 71 | fastcgi_param HTTP_X_REWRITE_URL ""; 72 | fastcgi_param HTTP_X_ORIGINAL_URL ""; 73 | 74 | # fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE; 75 | # fastcgi_param MAGE_RUN_TYPE $MAGE_RUN_TYPE; 76 | 77 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 78 | fastcgi_param DOCUMENT_ROOT $realpath_root; 79 | fastcgi_param SERVER_PORT $http_x_forwarded_port; 80 | } 81 | -------------------------------------------------------------------------------- /images/nginx/etc/nginx/conf.d/default.conf: -------------------------------------------------------------------------------- 1 | # default Docker DNS server 2 | resolver 127.0.0.11; 3 | 4 | # Select upstream backend to use based on presense of Xdebug cookies and Blackfire headers 5 | map "$http_X_BLACKFIRE_QUERY:$cookie_XDEBUG_SESSION$cookie_XDEBUG_PROFILE$cookie_XDEBUG_TRACE" $fastcgi_backend { 6 | # Nothing for debug and nothing for blackfire means its a pure request 7 | ":" ${NGINX_UPSTREAM_HOST}:${NGINX_UPSTREAM_PORT}; 8 | 9 | # Use blackfire if the blackfire query is specified AND no debug cookie is set 10 | "~:$" ${NGINX_UPSTREAM_BLACKFIRE_HOST}:${NGINX_UPSTREAM_BLACKFIRE_PORT}; 11 | 12 | # In all other cases, a debug cookie will be present; use debug container 13 | default ${NGINX_UPSTREAM_DEBUG_HOST}:${NGINX_UPSTREAM_DEBUG_PORT}; 14 | } 15 | 16 | server { 17 | listen 80; 18 | 19 | root ${NGINX_ROOT}${NGINX_PUBLIC}; 20 | set $MAGE_ROOT ${NGINX_ROOT}; 21 | 22 | index index.html index.php; 23 | autoindex off; 24 | charset UTF-8; 25 | 26 | include /etc/nginx/available.d/${NGINX_TEMPLATE}; 27 | include /etc/nginx/default.d/*.conf; 28 | } 29 | -------------------------------------------------------------------------------- /images/nginx/etc/nginx/fastcgi_params: -------------------------------------------------------------------------------- 1 | 2 | fastcgi_param QUERY_STRING $query_string; 3 | fastcgi_param REQUEST_METHOD $request_method; 4 | fastcgi_param CONTENT_TYPE $content_type; 5 | fastcgi_param CONTENT_LENGTH $content_length; 6 | 7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 8 | fastcgi_param REQUEST_URI $request_uri; 9 | fastcgi_param DOCUMENT_URI $document_uri; 10 | fastcgi_param DOCUMENT_ROOT $document_root; 11 | fastcgi_param SERVER_PROTOCOL $server_protocol; 12 | fastcgi_param REQUEST_SCHEME $scheme; 13 | fastcgi_param HTTPS $https if_not_empty; 14 | 15 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 16 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 17 | 18 | fastcgi_param REMOTE_ADDR $remote_addr; 19 | fastcgi_param REMOTE_PORT $remote_port; 20 | fastcgi_param SERVER_ADDR $server_addr; 21 | fastcgi_param SERVER_PORT $server_port; 22 | fastcgi_param SERVER_NAME $server_name; 23 | 24 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 25 | fastcgi_param REDIRECT_STATUS 200; 26 | 27 | # Xdebug remote connect back support for Docker Desktop 28 | fastcgi_param HTTP_X_DEBUG_HOST ${XDEBUG_CONNECT_BACK_HOST}; 29 | -------------------------------------------------------------------------------- /images/opensearch/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG OPENSEARCH_VERSION 2 | FROM docker.io/opensearchproject/opensearch:${OPENSEARCH_VERSION} 3 | RUN bin/opensearch-plugin install analysis-phonetic \ 4 | && bin/opensearch-plugin install analysis-icu 5 | -------------------------------------------------------------------------------- /images/php-fpm/.trigger: -------------------------------------------------------------------------------- 1 | bfad0104-b9ae-44ad-bdde-0a0630dad75b 2 | -------------------------------------------------------------------------------- /images/php-fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | 4 | FROM golang:alpine AS mhs-builder 5 | RUN go install github.com/mailhog/mhsendmail@latest 6 | 7 | FROM ${ENV_SOURCE_IMAGE:-php}:${PHP_VERSION}-fpm-alpine 8 | USER root 9 | ARG PHP_VERSION 10 | 11 | ENV MAILHOG_HOST mailhog 12 | ENV MAILHOG_PORT 1025 13 | 14 | # PHP Extension Installer 15 | ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ 16 | 17 | # Copy mhsendmail to PHP 18 | COPY --from=mhs-builder /go/bin/mhsendmail /usr/local/bin/mhsendmail 19 | 20 | # Install PHP Extensions required by Magento OS, Adobe Commerce, and the UCT (pcntl) 21 | RUN chmod +x /usr/local/bin/install-php-extensions && install-php-extensions \ 22 | apcu \ 23 | amqp \ 24 | bcmath \ 25 | calendar \ 26 | exif \ 27 | gd \ 28 | intl \ 29 | imagick \ 30 | imap \ 31 | mysqli \ 32 | pcntl \ 33 | pdo_mysql \ 34 | redis \ 35 | soap \ 36 | sockets \ 37 | sodium \ 38 | xsl \ 39 | zip 40 | 41 | # Install helpful utilities 42 | RUN apk --no-cache add \ 43 | jq \ 44 | bash \ 45 | patch \ 46 | pv \ 47 | procps \ 48 | nano \ 49 | vim \ 50 | mariadb-client \ 51 | sudo \ 52 | busybox-suid \ 53 | gettext \ 54 | ca-certificates \ 55 | shadow \ 56 | git \ 57 | rsync \ 58 | bash-completion \ 59 | zsh \ 60 | git-zsh-completion \ 61 | fish \ 62 | pwgen \ 63 | openssh 64 | 65 | # Add Cron 66 | RUN apk --no-cache add busybox-openrc || apk --no-cache add busybox-initscripts 67 | 68 | # Bring in the files 69 | COPY docker-entrypoint /usr/local/bin/ 70 | COPY etc/profile.d/*.sh /etc/profile.d/ 71 | COPY etc/*.ini /usr/local/etc/php/ 72 | COPY etc/php.d/*.ini /usr/local/etc/php/conf.d/ 73 | COPY etc/php.d/05-additions.ini.template /usr/local/etc/php/conf.d/ 74 | 75 | # Install Composer 76 | COPY --from=composer:1 /usr/bin/composer /usr/bin/composer1 77 | COPY --from=composer:2.2 /usr/bin/composer /usr/bin/composer2lts 78 | COPY --from=composer:2 /usr/bin/composer /usr/bin/composer2 79 | 80 | # If PHP < 8.2 81 | RUN if [[ $(printf "8.2\n${PHP_VERSION}" | sort -g |head -n1) != "8.2" ]]; \ 82 | then install-php-extensions mcrypt; fi 83 | 84 | # If PHP < 7.2 85 | RUN if [[ $(printf "7.2\n${PHP_VERSION}" | sort -g | head -n1) != "7.2" ]]; \ 86 | then mv /usr/bin/composer2lts /usr/bin/composer2; fi 87 | 88 | # If PHP >= 7.1 89 | RUN if [[ $(printf "7.1\n${PHP_VERSION}" | sort -g | head -n1) == "7.1" ]]; \ 90 | then apk --no-cache add mariadb-connector-c; fi 91 | 92 | # If PHP >= 7.2 93 | RUN if [[ $(printf "7.2\n${PHP_VERSION}" | sort -g | head -n1) == "7.2" ]]; \ 94 | then apk --no-cache add composer-zsh-completion; fi 95 | 96 | # Enable command completion in Zsh 97 | RUN mkdir -p /etc/zsh/zshrc.d \ 98 | && echo "autoload -U compinit; compinit" > /etc/zsh/zshrc.d/completions.zsh \ 99 | && ln -s /usr/bin/fish /bin/fish 100 | 101 | # Install Oh My Zsh including the following Plugins: git, composer and n98-magerun 102 | RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" \ 103 | && sed -i 's/plugins=(git)/plugins=(git composer n98-magerun)/g' /root/.zshrc 104 | 105 | # Configure www-data user as primary php-fpm user for better local dev experience 106 | RUN groupmod -g 1000 www-data && usermod -u 1000 www-data \ 107 | && chmod 0755 ~www-data \ 108 | && mkdir -p /var/www/html \ 109 | && chown www-data:www-data /var/www/html \ 110 | && echo "www-data ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd 111 | 112 | # Override stop signal to stop process gracefully 113 | # https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163 114 | # Credit: davidalger 115 | STOPSIGNAL SIGQUIT 116 | 117 | ENTRYPOINT ["docker-entrypoint"] 118 | WORKDIR /var/www/html 119 | USER www-data 120 | EXPOSE 9000 121 | CMD ["php-fpm"] 122 | -------------------------------------------------------------------------------- /images/php-fpm/blackfire/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 4 | USER root 5 | 6 | RUN install-php-extensions blackfire 7 | 8 | # Install the Blackfire Client to provide access to the CLI tool 9 | COPY --from=blackfire/blackfire:latest /usr/local/bin/blackfire /usr/local/bin/blackfire 10 | 11 | COPY blackfire/etc/php.d/*.ini /usr/local/etc/php/conf.d/ 12 | 13 | USER www-data 14 | -------------------------------------------------------------------------------- /images/php-fpm/context/blackfire/etc/php.d/zz-blackfire.ini: -------------------------------------------------------------------------------- 1 | ; priority=90 2 | ; ?priority=90 3 | [blackfire] 4 | extension=blackfire.so 5 | blackfire.agent_socket = tcp://blackfire-agent:8707 6 | blackfire.agent_timeout = 0.25 7 | 8 | ;Sets fine-grained configuration for Probe. 9 | ;This should be left blank in most cases. For most installs, 10 | ;the server credentials should only be set in the agent. 11 | ;blackfire.server_id = 12 | 13 | ;Sets fine-grained configuration for Probe. 14 | ;This should be left blank in most cases. For most installs, 15 | ;the server credentials should only be set in the agent. 16 | ;blackfire.server_token = 17 | ;blackfire.log_level = 3 18 | ;blackfire.log_file = /tmp/blackfire.log 19 | -------------------------------------------------------------------------------- /images/php-fpm/context/docker-entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # configure php additions.ini 5 | cat /usr/local/etc/php/conf.d/05-additions.ini.template \ 6 | | envsubst '${MAILHOG_HOST} ${MAILHOG_PORT}' \ 7 | | sudo tee /usr/local/etc/php/conf.d/05-additions.ini 8 | 9 | # append warden issued root ca cert to ca-bundle trusted by curl/openssl 10 | if [ -f /etc/ssl/warden-rootca-cert/ca.cert.pem ]; then 11 | sudo cp /etc/ssl/warden-rootca-cert/ca.cert.pem /usr/local/share/ca-certificates/warden-rootca-cert.crt 12 | sudo tee -a /etc/ssl/certs/ca-certificates.crt < /usr/local/share/ca-certificates/warden-rootca-cert.crt > /dev/null 13 | fi 14 | 15 | # update trust outside if condition above to allow mounting PEM files into /etc/pki/ca-trust/source/anchors 16 | # https://github.com/gliderlabs/docker-alpine/issues/30 17 | sudo update-ca-certificates 2>/dev/null 18 | 19 | # start socat process in background to connect sockets used for agent access within container environment 20 | if [[ -S /run/host-services/ssh-auth.sock ]] \ 21 | && [[ "${SSH_AUTH_SOCK}" != "/run/host-services/ssh-auth.sock" ]] 22 | then 23 | sudo rm -f "${SSH_AUTH_SOCK}" 24 | sudo bash -c "nohup socat UNIX-CLIENT:/run/host-services/ssh-auth.sock \ 25 | UNIX-LISTEN:${SSH_AUTH_SOCK},fork,user=www-data,group=www-data 1>/var/log/socat-ssh-auth.log 2>&1 &" 26 | fi 27 | 28 | # start crond as a background process 29 | sudo crond 30 | 31 | # Configure composer2 as default when specified 32 | if [[ "${COMPOSER_VERSION:=2}" == "2.2" ]]; then 33 | sudo cp /usr/bin/composer2lts /usr/bin/composer 34 | elif [[ "${COMPOSER_VERSION}" == "2" ]]; then 35 | sudo cp /usr/bin/composer2 /usr/bin/composer 36 | else 37 | sudo cp /usr/bin/composer1 /usr/bin/composer 38 | fi 39 | 40 | # Resolve permission issues with directories auto-created by volume mounts; to use set CHOWN_DIR_LIST to 41 | # a list of directories (relative to working directory) to chown, walking up the paths to also chown each 42 | # specified parent directory. Example: "dir1/dir2 dir3" will chown dir1/dir2, then dir1 followed by dir3 43 | for DIR in ${CHOWN_DIR_LIST:-}; do 44 | if [[ -d "${DIR}" ]]; then 45 | while :; do 46 | sudo chown www-data:www-data "${DIR}" 47 | DIR=$(dirname "${DIR}") 48 | if [[ ${DIR} == "." ]] || [[ ${DIR} == "/" ]] || [[ ${DIR} == "/home" ]]; then 49 | break; 50 | fi 51 | done 52 | fi 53 | done 54 | 55 | # Resolve permission issue with /var/www/html being owned by root as a result of volume mounted on php-fpm 56 | # and nginx combined with nginx running as a different uid/gid than php-fpm does. This condition, when it 57 | # surfaces would cause mutagen sync failures (on initial startup) on macOS environments. 58 | sudo chown www-data:www-data /var/www/html 59 | 60 | # first arg is `-f` or `--some-option` 61 | if [ "${1#-}" != "$1" ]; then 62 | set -- php-fpm "$@" 63 | fi 64 | 65 | exec "$@" 66 | -------------------------------------------------------------------------------- /images/php-fpm/context/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | [php] 2 | memory_limit=-1 3 | -------------------------------------------------------------------------------- /images/php-fpm/context/etc/php-fpm-fcgi.ini: -------------------------------------------------------------------------------- 1 | [php] 2 | memory_limit=756M 3 | -------------------------------------------------------------------------------- /images/php-fpm/context/etc/php.d/01-php.ini: -------------------------------------------------------------------------------- 1 | date.timezone = UTC 2 | max_execution_time = 3600 3 | max_input_vars = 10000 4 | display_errors = On 5 | post_max_size = 25M 6 | session.auto_start = Off 7 | upload_max_filesize = 25M 8 | zend.exception_ignore_args = false 9 | zend.exception_string_param_max_len = 1000 -------------------------------------------------------------------------------- /images/php-fpm/context/etc/php.d/05-additions.ini.template: -------------------------------------------------------------------------------- 1 | sendmail_path = "/usr/local/bin/mhsendmail --smtp-addr='${MAILHOG_HOST}:${MAILHOG_PORT}'" 2 | -------------------------------------------------------------------------------- /images/php-fpm/context/etc/php.d/10-opcache.ini: -------------------------------------------------------------------------------- 1 | ; Enable opcache extension module 2 | zend_extension=opcache.so 3 | 4 | opcache.enable = On 5 | opcache.enable_cli = Off 6 | opcache.memory_consumption = 512 7 | opcache.interned_strings_buffer = 64 8 | opcache.max_accelerated_files = 65407 9 | opcache.validate_timestamps = true 10 | opcache.revalidate_freq = 2 11 | opcache.save_comments = 1 12 | -------------------------------------------------------------------------------- /images/php-fpm/context/etc/php.d/11-apc.ini: -------------------------------------------------------------------------------- 1 | [apc] 2 | apc.enable=On 3 | apc.enable_cli=On 4 | -------------------------------------------------------------------------------- /images/php-fpm/context/etc/profile.d/bind.sh: -------------------------------------------------------------------------------- 1 | # Setup history search ability (only bind when a tty is present) 2 | if [[ "$SHELL" == "/bi/bash" && -t 1 ]]; then 3 | bind '"\e[A":history-search-backward' 4 | bind '"\e[B":history-search-forward' 5 | fi 6 | -------------------------------------------------------------------------------- /images/php-fpm/context/etc/profile.d/path.sh: -------------------------------------------------------------------------------- 1 | ## these images use n versions (use same node as root); add /usr/local/bin to root $PATH 2 | if [[ "$EUID" = 0 || "$UID" = 0 ]]; then 3 | PATH=$(echo "$PATH" | sed -E 's#(/usr/local/sbin)#\1:/usr/local/bin#') 4 | fi 5 | 6 | ## support packages installed via pip into --user context 7 | export PATH=~/.local/bin:$PATH 8 | 9 | ## support packages installed via `composer global require ` 10 | export PATH=~/.composer/vendor/bin:$PATH 11 | -------------------------------------------------------------------------------- /images/php-fpm/context/etc/profile.d/ps1.sh: -------------------------------------------------------------------------------- 1 | if [[ "$EUID" != "0" && "$UID" != "0" ]]; then 2 | export PS1='\[\033[0;36m\]\u@\h\[\033[0m\]:\[\033[0;37m\]\w\[\033[0m\]$ ' 3 | else 4 | export PS1='\[\033[0;5m\]\u@\h\[\033[0m\]:\[\033[0;31m\]\w\[\033[0m\]# ' 5 | fi 6 | -------------------------------------------------------------------------------- /images/php-fpm/context/xdebug3/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | [php] 2 | memory_limit=-1 3 | 4 | [xdebug] 5 | xdebug.mode=debug 6 | xdebug.start_with_request=yes 7 | xdebug.client_host=${XDEBUG_REMOTE_HOST} 8 | -------------------------------------------------------------------------------- /images/php-fpm/context/xdebug3/etc/php-fpm-fcgi.ini: -------------------------------------------------------------------------------- 1 | [php] 2 | memory_limit=756M 3 | 4 | [xdebug] 5 | xdebug.mode=debug,trace,profile 6 | xdebug.start_with_request=trigger 7 | -------------------------------------------------------------------------------- /images/php-fpm/context/xdebug3/etc/php.d/15-xdebug3.2.ini.template: -------------------------------------------------------------------------------- 1 | ; Enable xdebug extension module 2 | zend_extension=xdebug.so 3 | 4 | xdebug.discover_client_host="on" 5 | xdebug.client_discovery_header="HTTP_X_DEBUG_HOST,HTTP_X_FORWARDED_FOR,REMOTE_ADDR" 6 | xdebug.idekey="PHPSTORM" 7 | xdebug.show_local_vars="on" 8 | xdebug.var_display_max_depth=3 9 | xdebug.max_nesting_level=250 10 | xdebug.file_link_format = '"phpstorm://open?file=%f&line=%l"' 11 | 12 | xdebug.output_dir="/tmp" 13 | xdebug.profiler_output_name="cachegrind.out.%t.%s_%R" 14 | xdebug.trace_output_name="trace.%t.%s_%R" 15 | -------------------------------------------------------------------------------- /images/php-fpm/context/xdebug3/etc/php.d/15-xdebug3.ini.template: -------------------------------------------------------------------------------- 1 | xdebug.discover_client_host="on" 2 | xdebug.client_discovery_header="HTTP_X_DEBUG_HOST" 3 | xdebug.idekey="PHPSTORM" 4 | xdebug.show_local_vars="on" 5 | xdebug.var_display_max_depth=3 6 | xdebug.max_nesting_level=250 7 | xdebug.file_link_format = '"phpstorm://open?file=%f&line=%l"' 8 | 9 | xdebug.output_dir="/tmp" 10 | xdebug.profiler_output_name="cachegrind.out.%t.%s_%R" 11 | xdebug.trace_output_name="trace.%t.%s_%R" 12 | -------------------------------------------------------------------------------- /images/php-fpm/magento1/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 4 | USER root 5 | 6 | ADD https://files.magerun.net/n98-magerun.phar /usr/local/bin/n98-magerun 7 | RUN chmod +rx /usr/local/bin/n98-magerun \ 8 | && ln -s /usr/local/bin/n98-magerun /usr/local/bin/magerun \ 9 | && ln -s /usr/local/bin/n98-magerun /usr/local/bin/mr 10 | 11 | ADD https://raw.githubusercontent.com/netz98/n98-magerun/master/res/autocompletion/bash/n98-magerun.phar.bash /etc/bash_completion.d/n98-magerun.phar 12 | RUN chmod +r /etc/bash_completion.d/n98-magerun.phar 13 | 14 | USER www-data 15 | -------------------------------------------------------------------------------- /images/php-fpm/magento1/blackfire/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 4 | USER root 5 | 6 | RUN install-php-extensions blackfire 7 | 8 | # Install the Blackfire Client to provide access to the CLI tool 9 | COPY --from=blackfire/blackfire:latest /usr/local/bin/blackfire /usr/local/bin/blackfire 10 | 11 | COPY blackfire/etc/php.d/*.ini /usr/local/etc/php/conf.d/ 12 | 13 | USER www-data 14 | -------------------------------------------------------------------------------- /images/php-fpm/magento1/xdebug3/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 4 | ARG XDEBUG_TYPE="xdebug-stable" 5 | ARG PHP_VERSION 6 | USER root 7 | 8 | RUN install-php-extensions ${XDEBUG_TYPE} 9 | 10 | COPY xdebug3/etc/*.ini /usr/local/etc/php/ 11 | COPY xdebug3/etc/php.d/* /usr/local/etc/php/conf.d/ 12 | 13 | RUN if [[ $(printf "8.0\n${PHP_VERSION}" | sort -g | head -n1) == "8.0" ]]; \ 14 | then mv /usr/local/etc/php/conf.d/15-xdebug3.2.ini.template /usr/local/etc/php/conf.d/15-xdebug.ini; \ 15 | else mv /usr/local/etc/php/conf.d/15-xdebug3.ini.template /usr/local/etc/php/conf.d/15-xdebug.ini; fi 16 | 17 | USER www-data 18 | -------------------------------------------------------------------------------- /images/php-fpm/magento2/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 4 | USER root 5 | 6 | # Magerun 7 | ADD https://files.magerun.net/n98-magerun2.phar /usr/local/bin/n98-magerun2 8 | RUN chmod +rx /usr/local/bin/n98-magerun2 \ 9 | && ln -s /usr/local/bin/n98-magerun2 /usr/local/bin/n98-magerun \ 10 | && ln -s /usr/local/bin/n98-magerun2 /usr/local/bin/magerun2 \ 11 | && ln -s /usr/local/bin/n98-magerun2 /usr/local/bin/magerun \ 12 | && ln -s /usr/local/bin/n98-magerun2 /usr/local/bin/mr \ 13 | && ln -s /usr/local/bin/n98-magerun2 /usr/local/bin/n98-magerun2.phar 14 | 15 | # Magerun Auto-complete 16 | ADD https://raw.githubusercontent.com/netz98/n98-magerun2/master/res/autocompletion/bash/n98-magerun2.phar.bash /etc/bash_completion.d/n98-magerun2.phar 17 | ADD https://raw.githubusercontent.com/netz98/n98-magerun2/master/res/autocompletion/fish/n98-magerun2.phar.fish /etc/fish/completions/n98-magerun2.phar.fish 18 | ADD https://raw.githubusercontent.com/netz98/n98-magerun2/master/res/autocompletion/zsh/n98-magerun2.plugin.zsh /usr/share/zsh/site-functions/_n98-magerun2 19 | 20 | RUN sed -i 's/\(#compdef n98-magerun2.phar\)/\1 n98-magerun2=n98-magerun2.phar n98-magerun=n98-magerun2.phar magerun2=n98-magerun2.phar magerun=n98-magerun2.phar/' /usr/share/zsh/site-functions/_n98-magerun2 \ 21 | && sed -i 's/\(compdef _n98_magerun2 n98-magerun2.phar\)/\1 n98-magerun2=n98-magerun2.phar n98-magerun=n98-magerun2.phar magerun2=n98-magerun2.phar magerun=n98-magerun2.phar/' /usr/share/zsh/site-functions/_n98-magerun2 \ 22 | && sed -i 's/\(complete -f -c n98-magerun2.phar\)/\1 -c n98-magerun2 -c n98-magerun -c magerun2 -c magerun/' /etc/fish/completions/n98-magerun2.phar.fish \ 23 | && ln -s /etc/fish/completions/n98-magerun2.phar.fish /etc/fish/completions/n98-magerun2.fish \ 24 | && ln -s /etc/fish/completions/n98-magerun2.phar.fish /etc/fish/completions/n98-magerun.fish \ 25 | && ln -s /etc/fish/completions/n98-magerun2.phar.fish /etc/fish/completions/magerun2.fish \ 26 | && ln -s /etc/fish/completions/n98-magerun2.phar.fish /etc/fish/completions/magerun.fish \ 27 | && chmod +r /etc/fish/completions/n98-magerun2.phar.fish \ 28 | && chmod +r /etc/bash_completion.d/n98-magerun2.phar \ 29 | && chmod +r /usr/share/zsh/site-functions/_n98-magerun2 30 | 31 | # Mage2 TV Cache 32 | RUN mkdir /home/www-data/mage-cache-clean \ 33 | && cd /home/www-data/mage-cache-clean \ 34 | && composer2 require mage2tv/magento-cache-clean \ 35 | && ln -s /home/www-data/mage-cache-clean/vendor/bin/cache-clean.js /usr/local/bin/cache-clean.js \ 36 | && ln -s /home/www-data/mage-cache-clean/vendor/bin/cache-clean.js /usr/local/bin/cache-clean \ 37 | && chmod +rx -R /home/www-data/mage-cache-clean 38 | 39 | USER www-data -------------------------------------------------------------------------------- /images/php-fpm/magento2/blackfire/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 4 | USER root 5 | 6 | RUN install-php-extensions blackfire 7 | 8 | # Install the Blackfire Client to provide access to the CLI tool 9 | COPY --from=blackfire/blackfire:latest /usr/local/bin/blackfire /usr/local/bin/blackfire 10 | 11 | COPY blackfire/etc/php.d/*.ini /usr/local/etc/php/conf.d/ 12 | 13 | USER www-data 14 | -------------------------------------------------------------------------------- /images/php-fpm/magento2/xdebug3/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 4 | ARG XDEBUG_TYPE="xdebug-stable" 5 | ARG PHP_VERSION 6 | USER root 7 | 8 | RUN install-php-extensions ${XDEBUG_TYPE} 9 | 10 | COPY xdebug3/etc/*.ini /usr/local/etc/php/ 11 | COPY xdebug3/etc/php.d/* /usr/local/etc/php/conf.d/ 12 | 13 | RUN if [[ $(printf "8.0\n${PHP_VERSION}" | sort -g | head -n1) == "8.0" ]]; \ 14 | then mv /usr/local/etc/php/conf.d/15-xdebug3.2.ini.template /usr/local/etc/php/conf.d/15-xdebug.ini; \ 15 | else mv /usr/local/etc/php/conf.d/15-xdebug3.ini.template /usr/local/etc/php/conf.d/15-xdebug.ini; fi 16 | 17 | USER www-data 18 | -------------------------------------------------------------------------------- /images/php-fpm/node/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | ARG NODE_VERSION 4 | 5 | FROM node:${NODE_VERSION}-alpine AS node 6 | RUN npm install -g grunt-cli gulp 7 | 8 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 9 | USER root 10 | 11 | # Copy Node to PHP 12 | COPY --from=node /usr/lib /usr/lib 13 | COPY --from=node /usr/local/share /usr/local/share 14 | COPY --from=node /usr/local/lib /usr/local/lib 15 | COPY --from=node /usr/local/include /usr/local/include 16 | COPY --from=node /usr/local/bin /usr/local/bin 17 | 18 | # Copy Yarn 19 | COPY --from=node /opt /opt 20 | 21 | RUN apk del ghostscript imagemagick gcc x265-libs libheif mariadb-client fish icu-libs libde265 libjxl libstdc++ && apk add --update --no-cache ghostscript imagemagick gcc x265-libs libheif mariadb-client fish icu-libs libde265 libjxl libstdc++ 22 | 23 | USER www-data -------------------------------------------------------------------------------- /images/php-fpm/xdebug3/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ENV_SOURCE_IMAGE 2 | ARG PHP_VERSION 3 | FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} 4 | ARG XDEBUG_TYPE="xdebug-stable" 5 | ARG PHP_VERSION 6 | USER root 7 | 8 | RUN install-php-extensions ${XDEBUG_TYPE} 9 | 10 | COPY xdebug3/etc/*.ini /usr/local/etc/php/ 11 | COPY xdebug3/etc/php.d/* /usr/local/etc/php/conf.d/ 12 | 13 | RUN if [[ $(printf "8.0\n${PHP_VERSION}" | sort -g | head -n1) == "8.0" ]]; \ 14 | then mv /usr/local/etc/php/conf.d/15-xdebug3.2.ini.template /usr/local/etc/php/conf.d/15-xdebug.ini; \ 15 | else mv /usr/local/etc/php/conf.d/15-xdebug3.ini.template /usr/local/etc/php/conf.d/15-xdebug.ini; fi 16 | 17 | USER www-data 18 | -------------------------------------------------------------------------------- /images/rabbitmq/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG RABBITMQ_VERSION 2 | FROM rabbitmq:${RABBITMQ_VERSION}-management 3 | -------------------------------------------------------------------------------- /images/redis/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REDIS_VERSION 2 | FROM docker.io/library/redis:${REDIS_VERSION}-alpine 3 | -------------------------------------------------------------------------------- /images/varnish/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VARNISH_VERSION=7.1 2 | FROM varnish:${VARNISH_VERSION} 3 | 4 | USER root 5 | 6 | ENV VCL_CONFIG /etc/varnish/default.vcl 7 | ENV CACHE_SIZE 256m 8 | ENV VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600 \ 9 | -p feature=+esi_ignore_https -p feature=+esi_disable_xml_check -p http_resp_hdr_len=32k 10 | 11 | COPY default.vcl /etc/varnish/default.vcl.template 12 | RUN apk add --no-cache gettext 13 | RUN chown -R varnish:varnish /etc/varnish 14 | 15 | ENV BACKEND_HOST nginx 16 | ENV BACKEND_PORT 80 17 | ENV ACL_PURGE_HOST 0.0.0.0/0 18 | 19 | USER varnish 20 | EXPOSE 80 21 | CMD envsubst '${BACKEND_HOST} ${BACKEND_PORT} ${ACL_PURGE_HOST}' \ 22 | < /etc/varnish/default.vcl.template > /etc/varnish/default.vcl \ 23 | && varnishd -F -f $VCL_CONFIG -s malloc,$CACHE_SIZE $VARNISHD_PARAMS 24 | -------------------------------------------------------------------------------- /images/varnish/Dockerfile.legacy: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos/centos:stream8 2 | 3 | RUN dnf upgrade -y \ 4 | && dnf clean all \ 5 | && rm -rf /var/cache/dnf 6 | 7 | ARG VARNISH_VERSION=60lts 8 | ARG RPM_SCRIPT=https://packagecloud.io/install/repositories/varnishcache/varnish${VARNISH_VERSION}/script.rpm.sh 9 | RUN curl -s "${RPM_SCRIPT}" | bash \ 10 | && dnf install -y epel-release \ 11 | && dnf module disable -y varnish \ 12 | && dnf install -y varnish gettext \ 13 | && dnf clean all \ 14 | && rm -rf /var/cache/dnf 15 | 16 | ENV VCL_CONFIG /etc/varnish/default.vcl 17 | ENV CACHE_SIZE 256m 18 | ENV VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600 \ 19 | -p feature=+esi_ignore_https -p feature=+esi_disable_xml_check -p http_resp_hdr_len=32k 20 | 21 | COPY default.vcl /etc/varnish/default.vcl.template 22 | 23 | ENV BACKEND_HOST nginx 24 | ENV BACKEND_PORT 80 25 | ENV ACL_PURGE_HOST 0.0.0.0/0 26 | 27 | EXPOSE 80 28 | CMD envsubst '${BACKEND_HOST} ${BACKEND_PORT} ${ACL_PURGE_HOST}' \ 29 | < /etc/varnish/default.vcl.template > /etc/varnish/default.vcl \ 30 | && varnishd -F -f $VCL_CONFIG -s malloc,$CACHE_SIZE $VARNISHD_PARAMS 31 | -------------------------------------------------------------------------------- /images/varnish/Dockerfile.lts: -------------------------------------------------------------------------------- 1 | ARG VARNISH_VERSION=6.0 2 | FROM varnish:${VARNISH_VERSION} 3 | 4 | USER root 5 | 6 | RUN apt-get update && apt-get install -y gettext && rm -rf /var/lib/apt/lists/* 7 | 8 | ENV VCL_CONFIG /etc/varnish/default.vcl 9 | ENV CACHE_SIZE 256m 10 | ENV VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600 \ 11 | -p feature=+esi_ignore_https -p feature=+esi_disable_xml_check -p http_resp_hdr_len=32k 12 | 13 | COPY default.vcl /etc/varnish/default.vcl.template 14 | RUN chown -R varnish:varnish /etc/varnish 15 | RUN chgrp -R varnish /var/lib/varnish 16 | RUN chmod -R g+rwx /var/lib/varnish 17 | 18 | ENV BACKEND_HOST nginx 19 | ENV BACKEND_PORT 80 20 | ENV ACL_PURGE_HOST 0.0.0.0/0 21 | 22 | USER varnish 23 | EXPOSE 80 24 | CMD envsubst '${BACKEND_HOST} ${BACKEND_PORT} ${ACL_PURGE_HOST}' \ 25 | < /etc/varnish/default.vcl.template > /etc/varnish/default.vcl \ 26 | && varnishd -F -f $VCL_CONFIG -s malloc,$CACHE_SIZE $VARNISHD_PARAMS 27 | -------------------------------------------------------------------------------- /utils/core.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | ## global service containers to be connected with the project docker network 5 | DOCKER_PEERED_SERVICES=("traefik" "tunnel" "mailhog") 6 | 7 | ## messaging functions 8 | function warning { 9 | >&2 printf "\033[33mWARNING\033[0m: $@\n" 10 | } 11 | 12 | function error { 13 | >&2 printf "\033[31mERROR\033[0m: $@\n" 14 | } 15 | 16 | function fatal { 17 | error "$@" 18 | exit -1 19 | } 20 | 21 | function version { 22 | echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; 23 | } 24 | 25 | ## determines if value is present in an array; returns 0 if element is present 26 | ## in array, otherwise returns 1 27 | ## 28 | ## usage: containsElement 29 | ## 30 | function containsElement { 31 | local e match="$1" 32 | shift 33 | for e; do [[ "$e" == "$match" ]] && return 0; done 34 | return 1 35 | } 36 | 37 | ## verify docker is running 38 | function assertDockerRunning { 39 | if ! docker system info >/dev/null 2>&1; then 40 | fatal "Docker does not appear to be running. Please start Docker." 41 | fi 42 | } 43 | 44 | ## methods to peer global services requiring network connectivity with project networks 45 | function connectPeeredServices { 46 | for svc in ${DOCKER_PEERED_SERVICES[@]}; do 47 | echo "Connecting ${svc} to $1 network" 48 | (docker network connect "$1" ${svc} 2>&1| grep -v 'already exists in network') || true 49 | done 50 | } 51 | 52 | function disconnectPeeredServices { 53 | for svc in ${DOCKER_PEERED_SERVICES[@]}; do 54 | echo "Disconnecting ${svc} from $1 network" 55 | (docker network disconnect "$1" ${svc} 2>&1| grep -v 'is not connected') || true 56 | done 57 | } 58 | -------------------------------------------------------------------------------- /utils/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 3 | 4 | function installSshConfig () { 5 | if ! grep '## WARDEN START ##' /etc/ssh/ssh_config >/dev/null; then 6 | echo "==> Configuring sshd tunnel in host ssh_config (requires sudo privileges)" 7 | echo " Note: This addition to the ssh_config file can sometimes be erased by a system" 8 | echo " upgrade requiring reconfiguring the SSH config for tunnel.den.test." 9 | cat <<-EOT | sudo tee -a /etc/ssh/ssh_config >/dev/null 10 | 11 | ## WARDEN START ## 12 | Host tunnel.warden.test 13 | HostName 127.0.0.1 14 | User user 15 | Port 2222 16 | IdentityFile ~/.den/tunnel/ssh_key 17 | Host tunnel.den.test 18 | HostName 127.0.0.1 19 | User user 20 | Port 2222 21 | IdentityFile ~/.den/tunnel/ssh_key 22 | ## WARDEN END ## 23 | EOT 24 | fi 25 | 26 | # Migrate from Warden to Den 27 | if grep "~/.warden/tunnel/ssh_key" /etc/ssh/ssh_config >/dev/null; then 28 | sudo sed -i.bak 's/~\/.warden/~\/.den/' /etc/ssh/ssh_config 29 | fi 30 | } 31 | 32 | function assertWardenInstall { 33 | if [[ ! -f "${WARDEN_HOME_DIR}/.installed" ]] \ 34 | || [[ "${WARDEN_HOME_DIR}/.installed" -ot "${WARDEN_DIR}/bin/den" ]] 35 | then 36 | [[ -f "${WARDEN_HOME_DIR}/.installed" ]] && echo "==> Updating Den" || echo "==> Starting initialization" 37 | 38 | "${WARDEN_DIR}/bin/den" install 39 | 40 | [[ -f "${WARDEN_HOME_DIR}/.installed" ]] && echo "==> Update complete" || echo "==> Initialization complete" 41 | date > "${WARDEN_HOME_DIR}/.installed" 42 | fi 43 | 44 | ## append settings for tunnel.den.test in /etc/ssh/ssh_config 45 | # 46 | # NOTE: This function is called on every invocation of this assertion in an attempt to ensure 47 | # the ssh configuration for the tunnel is present following it's removal following a system 48 | # upgrade (macOS Catalina has been found to reset the global SSH configuration file) 49 | # 50 | 51 | installSshConfig 52 | } 53 | -------------------------------------------------------------------------------- /version: -------------------------------------------------------------------------------- 1 | in-dev 2 | --------------------------------------------------------------------------------