Skip to content
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

Redirects to IP address when domain is used in address bar #1215

Closed
ghost opened this issue Dec 4, 2017 · 4 comments · Fixed by #1300
Closed

Redirects to IP address when domain is used in address bar #1215

ghost opened this issue Dec 4, 2017 · 4 comments · Fixed by #1300
Labels
kind/defect Behavior that is inconsistent with what's intended product/ova Related to the OVA packaging of vSphere Integrated Containers

Comments

@ghost
Copy link

ghost commented Dec 4, 2017

@gigawhitlocks commented on Fri Dec 01 2017

I have installed Admiral through the VIC 1.3 RC2 OVA and provided custom certificates that are assigned to vch.theknown.net, a domain that I control. This domain resolves to the private IP on which I have installed the OVA. When I click on the admin portal, I'm redirected instead to https://private_ip/ and, thus, receive a certificate warning.

There should be a way for me to change the base url of links referencing Admiral to use the domain name being accessed if that behavior cannot be detected, and in any case, I should be able to access Admiral at vch.theknown.net:8282 if I specify that in my browser without being redirected to IP_ADDRESS:8282


@gigawhitlocks commented on Fri Dec 01 2017

Also if I try to manually change the IP address to the domain name, I get this glorious response:

screen shot 2017-12-01 at 4 56 13 pm

Uh, lol, no. That's not good.


@andrewtchin commented on Fri Dec 01 2017

After Ian set the FQDN in the vApp settings the config was updated but after the SSO login, he was redirected back to the IP.

Based on this https://github.com/vmware/vic-product/pull/1066/files
We should be setting the hostname everywhere except for the below, but I'm not sure what that is used for:

# put admiral endpoint in guestinfo                                                                  
$script_dir/set_guestinfo.sh admiral.endpoint https://"$ip_address":"$ADMIRAL_PORT" 

Any ideas on if we need to set something else @sergiosagu @morris-jason ?


@sergiosagu commented on Mon Dec 04 2017

@andrewtchin - I think that the problem comes from the value that the parameter --publicUri may get within the start script: https://github.com/vmware/vic-product/blob/master/installer/build/scripts/admiral/start_admiral.sh

That parameter should be the FQDN specified during the OVA installation, if any.

You can leave this issue in this repo if you want, but it's more an OVA install/config issue.


@morris-jason commented on Mon Dec 04 2017

@sergiosagu the publicUrl is being set as expected - (this is a naming problem. We call it OVA_VM_IP but it actually is a hostname if available, set by configure_admiral.)
The command being run by systemd is:

/usr/bin/docker run -p 8282:8282 
--name vic-admiral 
-v /storage/data/admiral:/var/admiral 
-v /storage/data/admiral/configs:/configs 
-v /storage/log/admiral:/admiral/log 
-v /etc/vmware/admiral/logging-vic.properties:/config/logging.properties 
-e ADMIRAL_PORT=-1 

-e JAVA_OPTS=-Ddcp.net.ssl.trustStore=/configs/trustedcertificates.jks -Ddcp.net.ssl.trustStorePassword=changeit -Dencryption.key.file=/var/admiral/8282/encryption.key -Dinit.encryption.key.file=true -e CONFIG_FILE_PATH=/configs/config.properties 

-e XENON_OPTS=--publicUri=https://vch.theknown.net:8282/ --bindAddress=0.0.0.0 --port=-1 --authConfig=/configs/psc-config.properties --securePort=8282 --keyFile=/configs/server.key --certificateFile=/configs/server.crt --startMockHostAdapterInstance=false 

--log-driver=json-file --log-opt max-size=1g --log-opt max-file=10 vmware/admiral:vic_v1.3.0-rc2

Disregard obvious issues of spacing and quoting - I edited the command to make it look better for github output.


@morris-jason commented on Mon Dec 04 2017

In fact, the problem seems to be:

cat /storage/data/admiral/configs/psc-config.properties
#Fri Dec 01 22:34:09 UTC 2017
admiral-url=https\://10.192.59.142\:8282
.....<redacted>
@ghost ghost self-assigned this Dec 4, 2017
@ghost ghost added product/ova Related to the OVA packaging of vSphere Integrated Containers kind/defect Behavior that is inconsistent with what's intended priority/high labels Dec 4, 2017
@ghost
Copy link
Author

ghost commented Dec 4, 2017

This seems to be a problem with the fileserver at https://github.com/vmware/vic-product/blob/master/installer/fileserver/tasks.go#L94.

When @gigawhitlocks started the ova without a fqdn, the psc configs contained redirect IPs because the components were running on the appliance ip, not a hostname.
After the fqdn was added to guest info, the getting started page was re-initialized, but the clause referenced above prevented new psc configs with the hostname redirects from being generated.

I've confirmed the Management portal is now running at https://vch.theknown.net:8282 after deleting the old psc files before re-initializing.
@andrewtchin please triage as a 1.3.1 inclusion or a 1.3-rc3/4 pr.

@ghost
Copy link
Author

ghost commented Dec 4, 2017

The appropriate psc configuration is also present:

cat /etc/vmware/psc/admiral/psc-config.properties
#Mon Dec 04 15:17:21 UTC 2017
admiral-url=https\://vch.theknown.net\:8282
...<redacted>

@ghost
Copy link
Author

ghost commented Dec 18, 2017

The root problem here is that the fileserver would not recreate psc configs after an re-initialization. Fixed in pr #1266.

@hickeng
Copy link
Member

hickeng commented Jan 3, 2018

Ideally we should be using the FQDN/IP that was used in the request to access the page, not necessarily the one that VM is aware of. This will allow use of NAT and virtual server configurations.
This is required for VMC support.

@ghost ghost mentioned this issue Jan 9, 2018
@ghost ghost closed this as completed in #1300 Jan 17, 2018
ghost pushed a commit that referenced this issue Jan 17, 2018
Make a variety of changes to the systemd configuration of
the vic-product appliance, including:
 - Improved serviceability and linear boot dependencies.
 - A new custom boot target and new target for psc config.
 - Adds a psc reconfiguration target accommodating changes in
   system configuration over time.
 - Improved adherence to systemd best practices.
Fixes #1215, #1265, and #1267.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/defect Behavior that is inconsistent with what's intended product/ova Related to the OVA packaging of vSphere Integrated Containers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants