From 9e40f0ce652254d976e20599de55314b02788d42 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Thu, 24 Oct 2024 13:54:32 -0400 Subject: [PATCH] just get this thing healthy again --- .github/workflows/pr-apache-tests.yml | 2 +- .github/workflows/pr-docs-tests.yml | 2 +- .github/workflows/pr-linter.yml | 2 +- .github/workflows/pr-unit-tests.yml | 4 ++-- .github/workflows/release.yml | 17 +++++++++++------ .node-version | 2 +- README.md | 4 ++-- builders/apache.js | 27 +++++++++++++++++---------- config/default-ssl.conf | 4 ++-- config/httpd.conf | 2 +- docs/index.md | 4 ++-- examples/.gitkeep | 0 examples/2.4/.lando.yml | 4 ++-- examples/custom/.lando.yml | 4 ++-- 14 files changed, 45 insertions(+), 33 deletions(-) delete mode 100644 examples/.gitkeep diff --git a/.github/workflows/pr-apache-tests.yml b/.github/workflows/pr-apache-tests.yml index 8e26f72..ccc12eb 100644 --- a/.github/workflows/pr-apache-tests.yml +++ b/.github/workflows/pr-apache-tests.yml @@ -19,7 +19,7 @@ jobs: os: - ubuntu-24.04 node-version: - - '18' + - '20' steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/pr-docs-tests.yml b/.github/workflows/pr-docs-tests.yml index ea07050..3537cb8 100644 --- a/.github/workflows/pr-docs-tests.yml +++ b/.github/workflows/pr-docs-tests.yml @@ -11,7 +11,7 @@ jobs: os: - ubuntu-24.04 node-version: - - '18' + - '20' steps: # Install deps and cache - name: Checkout code diff --git a/.github/workflows/pr-linter.yml b/.github/workflows/pr-linter.yml index 4bd4214..7dbfd1b 100644 --- a/.github/workflows/pr-linter.yml +++ b/.github/workflows/pr-linter.yml @@ -11,7 +11,7 @@ jobs: os: - ubuntu-24.04 node-version: - - '18' + - '20' steps: # Install deps and cache - name: Checkout code diff --git a/.github/workflows/pr-unit-tests.yml b/.github/workflows/pr-unit-tests.yml index 98bb261..c64da65 100644 --- a/.github/workflows/pr-unit-tests.yml +++ b/.github/workflows/pr-unit-tests.yml @@ -12,9 +12,9 @@ jobs: os: - windows-2022 - ubuntu-24.04 - - macos-12 + - macos-13 node-version: - - '18' + - '20' steps: # Install deps and cache - name: Checkout code diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75a131e..4fca8d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,18 +48,23 @@ jobs: # Deploy - name: Publish to npm run: | + VERSION=$(node -p "require('./package.json').version") + PACKAGE=$(node -p "require('./package.json').name") + if [ "${{ github.event.release.prerelease }}" == "false" ]; then npm publish --access public --dry-run npm publish --access public - VERSION=$(node -p "require('./package.json').version") - PACKAGE_NAME=$(node -p "require('./package.json').name") - npm dist-tag add $PACKAGE_NAME@$VERSION edge - echo "::notice title=Updated edge tag::The edge tag now points to $VERSION" - echo "::notice title=Published ${{ github.ref_name }} to @${{ github.repository }}::This is a stable release published to the default 'latest' npm tag" + npm dist-tag add "$PACKAGE@$VERSION" edge + + echo "::notice title=Published $VERSION to $PACKAGE::This is a stable release published to the default 'latest' npm tag" + echo "::notice title=Updated latest tag to $VERSION::The stable tag now points to $VERSION" + echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION" else npm publish --access public --tag edge --dry-run npm publish --access public --tag edge - echo "::notice title=Published ${{ github.ref_name }} to @${{ github.repository }}@edge::This is a pre-release published to the 'edge' npm tag" + + echo "::notice title=Published $VERSION to $PACKAGE::This is a prerelease published to the 'edge' npm tag" + echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION" fi env: NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}} diff --git a/.node-version b/.node-version index 3c03207..209e3ef 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18 +20 diff --git a/README.md b/README.md index 9386c50..a113469 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Add a `apache` service to your Landofile ```yaml services: myservice: - type: apache + type: apache:2.4 ``` For more info you should check out the [docs](https://docs.lando.dev/apache): @@ -50,4 +50,4 @@ Made with [contributors-img](https://contrib.rocks). ## Other Selected Resources * [LICENSE](https://github.com/lando/apache/blob/main/LICENSE.md) -* [The best professional advice ever](https://www.youtube.com/watch?v=tkBVDh7my9Q) \ No newline at end of file +* [The best professional advice ever](https://www.youtube.com/watch?v=tkBVDh7my9Q) diff --git a/builders/apache.js b/builders/apache.js index a09b9eb..02fb3a6 100644 --- a/builders/apache.js +++ b/builders/apache.js @@ -19,6 +19,13 @@ module.exports = { server: 'httpd.conf', vhosts: 'default.conf', }, + environment: { + APACHE_HTTP_PORT_NUMBER: '80', + APACHE_USER: 'www-data', + APACHE_GROUP: 'www-data', + LANDO_NEEDS_EXEC: 'DOEEET', + }, + ports: ['80'], remoteFiles: { server: '/opt/bitnami/apache/conf/httpd.conf', vhosts: '/opt/bitnami/apache/conf/vhosts/lando.conf', @@ -31,21 +38,21 @@ module.exports = { // Constructor constructor(id, options = {}) { options = _.merge({}, config, options); - // Use different default for ssl - if (options.ssl) options.defaultFiles.vhosts = 'default-ssl.conf'; + + // Use different config for ssl + if (options.ssl) { + options.defaultFiles.vhosts = 'default-ssl.conf'; + options.environment.APACHE_HTTPS_PORT_NUMBER = '443'; + options.ports.push('443'); + } + // Build the default stuff here const apache = { image: `bitnami/apache:${options.version}`, command: '/launch.sh', - environment: { - APACHE_HTTP_PORT_NUMBER: '80', - APACHE_HTTPS_PORT_NUMBER: '443', - APACHE_USER: 'www-data', - APACHE_GROUP: 'www-data', - LANDO_NEEDS_EXEC: 'DOEEET', - }, - ports: ['80'], + environment: options.environment, user: 'root', + ports: options.ports, volumes: [ `${options.confDest}/launch.sh:/launch.sh`, `${options.confDest}/${options.defaultFiles.server}:${options.remoteFiles.server}`, diff --git a/config/default-ssl.conf b/config/default-ssl.conf index f81de62..c5d0e23 100644 --- a/config/default-ssl.conf +++ b/config/default-ssl.conf @@ -3,7 +3,7 @@ # Let apache know we're behind a SSL reverse proxy SetEnvIf X-Forwarded-Proto https HTTPS=on - + DocumentRoot "${LANDO_WEBROOT}" Options Indexes FollowSymLinks @@ -22,7 +22,7 @@ SetEnvIf X-Forwarded-Proto https HTTPS=on LoadModule ssl_module modules/mod_ssl.so - + DocumentRoot "${LANDO_WEBROOT}" SSLEngine on SSLCertificateFile "/certs/cert.crt" diff --git a/config/httpd.conf b/config/httpd.conf index 6bd016c..3397b7c 100644 --- a/config/httpd.conf +++ b/config/httpd.conf @@ -515,6 +515,6 @@ PidFile "/opt/bitnami/apache/tmp/httpd.pid" TraceEnable Off Include /opt/bitnami/apache/conf/deflate.conf IncludeOptional /opt/bitnami/apache/conf/vhosts/*.conf -Include /opt/bitnami/apache/conf/bitnami/bitnami.conf + RequestHeader unset Proxy diff --git a/docs/index.md b/docs/index.md index 66d16f6..f2fa4fc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,7 +13,7 @@ You can easily add it to your Lando app by adding an entry to the [services](htt ```yaml services: myservice: - type: apache + type: apache:2.4 ``` ## Supported versions @@ -32,7 +32,7 @@ To use a patch version, you can do something as shown below: ```yaml services: myservice: - type: apache:2.4.33 + type: apache:2.4.62 ``` But make sure you use one of the available [patch tags](https://hub.docker.com/r/bitnami/apache/tags) for the underlying image we are using. diff --git a/examples/.gitkeep b/examples/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/examples/2.4/.lando.yml b/examples/2.4/.lando.yml index a7c9f5e..844a45d 100644 --- a/examples/2.4/.lando.yml +++ b/examples/2.4/.lando.yml @@ -1,6 +1,6 @@ name: lando-apache proxy: - override: + defaults: - landoapache.lndo.site services: defaults: @@ -11,4 +11,4 @@ services: # This is important because it lets lando know to test against the plugin in this repo # DO NOT REMOVE THIS! plugins: - "@lando/apache": ./../../ \ No newline at end of file + "@lando/apache": ../.. diff --git a/examples/custom/.lando.yml b/examples/custom/.lando.yml index 0ab4a57..4e6af9f 100644 --- a/examples/custom/.lando.yml +++ b/examples/custom/.lando.yml @@ -1,6 +1,6 @@ name: lando-apache-custom proxy: - override: + custom: - landoapachecustom.lndo.site services: custom: @@ -23,4 +23,4 @@ services: # This is important because it lets lando know to test against the plugin in this repo # DO NOT REMOVE THIS! plugins: - "@lando/apache": ./../../ \ No newline at end of file + "@lando/apache": ../..