Index: openacs-4/packages/acs-subsite/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/index.tcl,v diff -u -r1.22 -r1.22.2.1 --- openacs-4/packages/acs-subsite/www/admin/index.tcl 15 Sep 2018 09:46:20 -0000 1.22 +++ openacs-4/packages/acs-subsite/www/admin/index.tcl 22 Jan 2024 17:34:50 -0000 1.22.2.1 @@ -1,5 +1,3 @@ -# /packages/mbryzek-subsite/www/admin/index.tcl - ad_page_contract { @author Bryan Quinn (bquinn@arsdigita.com) @author Michael Bryzek (mbryzek@arsdigita.com) @@ -30,11 +28,26 @@ # Get the main site location, which is the configured location. # When SuppressHttpPort is set, get it without the port. # -set suppress_port [parameter::get -parameter SuppressHttpPort \ - -package_id [apm_package_id_from_key acs-tcl] \ - -default 0] -set main_site_location [util::configured_location -suppress_port=$suppress_port] -set full_acs_admin_url $main_site_location$acs_admin_url +# Caveat: when running inside a container, the configured locations +# are not useful for return URLs, since the IP addresses and ports are +# typically mapped. For the time being, use the configured_location +# just when host-node-mapping is performed. +# +if {[db_string have_hostname_map {select count(*) from host_node_map}]} { + # + # Construct URL based on configured location. + # + set suppress_port [parameter::get -parameter SuppressHttpPort \ + -package_id [apm_package_id_from_key acs-tcl] \ + -default 0] + set main_site_location [util::configured_location -suppress_port=$suppress_port] + set full_acs_admin_url $main_site_location$acs_admin_url +} else { + # + # Stick with location-relative URL + # + set full_acs_admin_url $acs_admin_url +} set convert_subsite_p [expr { [llength [apm::get_package_descendent_options [ad_conn package_key]]] > 0 }]