-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use OS hostname if hostname is undefined in settings #1309
Use OS hostname if hostname is undefined in settings #1309
Conversation
d838f72
to
1abbb9a
Compare
I just rebased this on staging. |
1abbb9a
to
db0cd50
Compare
I rebased this on staging. Tests on travis and jenkins are going to be red because of #1327. |
db0cd50
to
8232e28
Compare
8232e28
to
450d94e
Compare
hostname | ||
else | ||
Addrinfo.tcp(tmp, 0).getnameinfo.first | ||
Addrinfo.tcp(Socket.gethostname, 0).getnameinfo.first |
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.
Shouldn't this fail with a more useful error message than SocketError: getaddrinfo: nodename nor servname provided, or not known
?
Ok let's start with the easy thing: In addition to that, everywhere where you've used the url-rails helpers, and therefore set |
If `Settings.hostname` is defined, it is the same as `config.fqdn`, so this is only really a change if `Settings.hostname` is `nil`. This doesn't change the deployment config. There we explicitly use `Settings.hostname` because we don't want to read the hostname from our development machines when deploying.
I don't understand this. The settings/development.yml specifies the port 3000. |
450d94e
to
b941d9b
Compare
Now this should be done. |
@@ -3,7 +3,9 @@ class Reference < ApplicationSerializer | |||
attributes :iri | |||
|
|||
def iri | |||
urls.logic_mapping_url(object, host: Settings.hostname) | |||
urls.logic_mapping_url(object, | |||
host: Settings.hostname, |
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.
Why Settings.hostname
instead of Ontohub::Application.config.fqdn
?
Good catches. Looks like I forgot how to grep. |
Ran seeds and tests, seems ok now: 👍 |
…undefined_in_settings Use OS hostname if hostname is undefined in settings
This automatically reads the hostname from the operating system and uses it in the application if
hostname
is not set in the settings.yml (as @jelmd requested).