Skip to content

Commit

Permalink
fix bug clobbering default recipe proxy urls when user ones are speci…
Browse files Browse the repository at this point in the history
…fied
  • Loading branch information
pirog committed Sep 6, 2024
1 parent aac2eb7 commit 5cbfa85
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
20 changes: 17 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

## Bug Fixes

* Fixed bug causing default `proxy` settings to be clobbered by user specified ones

## Internal

* Updated DevOps to use new `lando exec`
* Updated `ubuntu` test runners to `24.04`

## v1.4.0 - [May 1, 2024](https://github.com/lando/backdrop/releases/tag/v1.4.0)
* Fixed spelling errors. [#48](https://github.com/lando/backdrop/issues/48)
* Updated mariadb plugin. [#51](https://github.com/lando/mariadb/issues/51)

* Fixed spelling errors. [#48](https://github.com/lando/backdrop/issues/48)
* Updated mariadb plugin. [#51](https://github.com/lando/mariadb/issues/51)

## v1.3.0 - [March 8, 2024](https://github.com/lando/backdrop/releases/tag/v1.3.0)
* Updated to latest database services.

* Updated to latest database services.

## v1.2.1 - [March 4, 2024](https://github.com/lando/backdrop/releases/tag/v1.2.1)

### Fixes

* Improved `database` selection for purposes of `config` loading, fixes some `database` bootup issues when the `database` type is overridden downstream

## v1.2.0 - [February 24, 2024](https://github.com/lando/backdrop/releases/tag/v1.2.0)
Expand Down
3 changes: 3 additions & 0 deletions examples/backdrop-custom/.lando.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: backdrop-custom
proxy:
appserver_nginx:
- hollaback.backdrop.lndo.site
recipe: backdrop
config:
php: '8.3'
Expand Down
4 changes: 4 additions & 0 deletions examples/backdrop-custom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ lando php -m | grep Xdebug
# Should have bee 1.x-1.x
lando bee version | grep "Bee for Backdrop CMS" | grep "1.x-1.x"

# Should have proxy urls present in lando info
lando info | grep "backdrop-custom.lndo.site"
lando info | grep "hollaback.backdrop.lndo.site"

# Should be using custom config files
lando ssh -s appserver -c "curl -L appserver_nginx/info.php" | grep memory_limit | grep 513M
lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep server_name | grep pirog
Expand Down
10 changes: 8 additions & 2 deletions utils/get-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ module.exports = options => {
if (!_.has(options, 'proxyService') && options.webserver.type === 'nginx') options.proxyService = 'appserver_nginx';
else if (!_.has(options, 'proxyService') && options.webserver.type === 'apache') options.proxyService = 'appserver';

// set and return
return _.set({}, options.proxyService, [`${options.app}.${options._app._config.domain}`]);
// get any intial proxy stuff for proxyService
const urls = _.get(options, `_app.config.proxy.${options.proxyService}`, []);
// add
urls.push(`${options.app}.${options._app._config.domain}`);
// set
options.proxy[options.proxyService] = _.uniq(_.compact(urls));
// return
return options.proxy;
};

0 comments on commit 5cbfa85

Please sign in to comment.