-
-
Notifications
You must be signed in to change notification settings - Fork 1
fix: make server-side hostnames available through KeymanHosts
#53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
For local environment, we need to use host.docker.internal as the hostname, with corresponding ports, in order for the sites in their containers be able to communicate with each other. This adds `$SERVER_keyman_com` variables etc to the `KeymanHosts` class, in preparation for fixing this across each of the sites. This is also groundwork for allowing the various containers in the production and staging environments to communicate with each other directly, rather than going via cloudflare, which should improve performance and reduce traffic on the cluster. This change will be implemented in a follow-up PR.
* Splits the server-side and client-side references to keyman sites so that docker-based PHP can reference host.docker.internal on development machines for cross-references. * Removes all remaining usage of global `$KeymanHost` variable, instead using `KeymanHost::Instance()` for consistency. * Removes some links to legacy sites such as sentry.keyman.com. * TODO: update to `BOOTSTRAP_VERSION=v0.17` in build.sh before merge. Relates-to: keymanapp/shared-sites#53
* Splits the server-side and client-side references to keyman sites so that docker-based PHP can reference host.docker.internal on development machines for cross-references. * Removes some links to legacy sites such as sentry.keyman.com. * TODO: update to `BOOTSTRAP_VERSION=v0.17` in build.sh before merge. Relates-to: keymanapp/shared-sites#53 Relates-to: keymanapp/keyman.com#545
* Splits the server-side and client-side references to keyman sites so that docker-based PHP can reference host.docker.internal on development machines for cross-references. * TODO: update to `BOOTSTRAP_VERSION=v0.17` in build.sh before merge. Relates-to: keymanapp/shared-sites#53 Relates-to: keymanapp/keyman.com#545 Relates-to: keymanapp/api.keyman.com#272
* Splits the server-side and client-side references to keyman sites so that docker-based PHP can reference host.docker.internal on development machines for cross-references. * TODO: update to `BOOTSTRAP_VERSION=v0.17` in build.sh before merge. Relates-to: keymanapp/shared-sites#53 Relates-to: keymanapp/keyman.com#545 Relates-to: keymanapp/api.keyman.com#272 Relates-to: keymanapp/keymanweb.com#129
$this->SERVER_s_keyman_com = "http://host.docker.internal:8054"; | ||
$this->SERVER_api_keyman_com = "http://host.docker.internal:8058"; | ||
$this->SERVER_help_keyman_com = "http://host.docker.internal:8055"; | ||
$this->SERVER_keyman_com = "http://host.docker.internal:8053"; | ||
$this->SERVER_keymanweb_com = "http://host.docker.internal:8057"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean these port values are never overridden by KEYMAN_COM_PROXY_PORT?
And do they need to be manually kept in sync with keyman-local-ports.inc.sh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if ports change, we'd need to fix both places (plus a couple of other places where this has snuck in)
$this->SERVER_help_keyman_com = $this->help_keyman_com; | ||
$this->SERVER_keyman_com = $this->keyman_com; | ||
$this->SERVER_keymanweb_com = $this->keymanweb_com; | ||
} | ||
$this->fixupHosts(); | ||
} | ||
|
||
private function fixupHosts() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these correspond to ll 34-35, could we rename to fixupSiteHostname()?
Just trying to follow all the uses of "hosts" in this file...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hoping to eliminate fixupHosts altogether in a future PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
For local environment, we need to use host.docker.internal as the hostname, with corresponding ports, in order for the sites in their containers be able to communicate with each other. This adds
$SERVER_keyman_com
variables etc to theKeymanHosts
class, in preparation for fixing this across each of the sites.This is also groundwork for allowing the various containers in the production and staging environments to communicate with each other directly, rather than going via cloudflare, which should improve performance and reduce traffic on the cluster. This change will be implemented in a follow-up PR.