Base_url deprecation, but unclear what to do about it

Hi everyone,

upgrading to 0.110, I get a complaint about base_url in the http component.

That option is deprecated, but it’s unclear what to actually do with the information that’s in there.

https://www.home-assistant.io/integrations/http/ doesn’t mention anything about base_url, and there is nothing obvious to replace the information with.

https://developers.home-assistant.io/blog/2020/05/08/instance-url-helper mentions what changed from an internal perspective.

https://github.com/home-assistant/core/commit/2223592486179547f7429419a40e107db616562f#diff-579ab6a404463a7992f2626b9139dac2 is the commit that deprecates it, but I can’t tell from there what’s supposed to replace it. I see references to internal_url and external_url, but those are not values that can be set through the config.

I’m unclear as to what mechanism will make sure that my external URL the HA webserver is advertising will still be the same as what’s on the letsencrypt certificate. Does anyone know how to migrate that information?

4 Likes
  • Remove base_url from http component completely.

  • Go to Configuration > General

  • Input your external and internal url in the appropriate boxes

  • Press save

6 Likes

Or, if you have homeassistant: in configuration.yaml, external_url: and/or internal_url: go under that.

Here’s where this change was discussed in the release notes: https://www.home-assistant.io/blog/2020/05/20/release-110/#internal--external-urls

6 Likes

Hello
I made these changes and it worked, I use Duckdns, but soon after I realized that the voice commands through Google Assistant did not work anymore. Is there anything else to change?

1 Like

I added the urls as per the instructions above in those fields. However I am unable to access my duckdns url anymore. If I removed the base_url component from configuration.Yaml.

I removed base_url: https://???.duckdns.org:8123 from
http:
base_url: https://?????.duckdns.org:8123
from http: in configuration.yaml.
When I go to setup in General Configuration the External URL/Internal URL it is not accessible - “Editor disabled because config stored in configuration.yaml”
Capture
I am running Home Assistant 0.112.2/HassOS 4.11 on a NUC. I have restarted server & host but I am now unable to reach Home Assistant via DuckDNS
What am I doing wrong?
.

Are you accessing now with out the port 8123?

Try just the url without the port.

Thanks for the suggestion.

Something’s not quite right.

When I remove the port (8123) the url ???.duckdns.org opens up the Devices Page in my Zigbee2Mqtt Addon.

The External/Internal URL is still not accessible in General Settings.

Just noticed I posted my own similar thread about this and failed to search so bad on me. I see the message in the logs to remove the base_url, what specifically am I removing? So in my configuration.yaml I have:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
  base_url: https://<URL>
  server_port: 8123
  ssl_certificate: /ssl/<URL>-chain.pem
  ssl_key: /ssl/<URL>-key.pem
  use_x_forwarded_for: true
  trusted_proxies:
    - 127.0.0.1
    - 192.168.0.14

Do I just remove the base_url: https://<URL> piece and place it in the Configuration > General area or do I need to do something with the port or all the entries?

I deleted the base_url: & server_port: lines and now its working again.
However the Settings for External URL: & Internal URL: in Configuration - General is still greyed out & showing “Editor disabled because config stored in configuration.yaml”

You can remove the base url and server port and now place your URLs in the general section and job done.

Now your duckdns url should be accessible with out using the port based on your settings.

Is the advanced mode under your profile enabled?

1 Like

Is the advanced mode under your profile enabled? Yes it is.

I am in the same situation. Just upgraded to 0.112.3
removed base_url from http: and can’t enter the vaules in the GUI

it worked for me after I removed the rest as well

homeassistant:
  # some basic information on where we are ...
  #name: Home
  #latitude: !secret HOME_LATITUDE
  #longitude: !secret HOME_LONGITUDE
  #unit_system: metric
  #time_zone: Australia/Sydney
  #elevation: 178

I can give it a try but not a duckdns user. I have my own GoDaddy certs and DNS. From what I see above sounds like with the rest of my settings for ssl certs and the like still in there the options in General will still stay grayed out which wouldn’t work.

datamonkey - removng the additional lines also worked for me. Thanks

I removed the latitude, lingitude, elevation, unit_system, time_zone and name from the homeassistant: block and everything became editable which was interesting since the base_url was still in the configuration.yaml. That said, I removed the base_url value now from configuration.yaml and appended :8123 on my external URL that was guessed in the field and seems like it’s working.

1 Like

@bruert @datamonkey The editor at Configuration > General will be disabled if you have certain items in under homeassistant:
See here for details: https://www.home-assistant.io/docs/configuration/basic/

Instead of removing all of those items from configuration.yaml, you could have replaced base_url: with external_url:. Nothing wrong with using the UI for configurating that information though–just wanted to explain why the editor was disabled.

1 Like

Question on this. When you do it thru the GUI and using mariadb/mysql does that data get kept in the DB or elsewhere? I know in the past like past as in going to version 0.112 the migration script didn’t work and had to wipe out the DB but wasn’t sure if that was just the logbook data or what.