comparison sat/plugins/plugin_misc_app_manager.py @ 3564:2c9e95796371

plugin app manager: "public_url" must NOT have a schema
author Goffi <goffi@goffi.org>
date Fri, 11 Jun 2021 17:39:59 +0200
parents be6d91572633
children d66a8453b02b
comparison
equal deleted inserted replaced
3563:267e4987b58b 3564:2c9e95796371
158 f"invalid !sat_conf value ({config_data!r}), a list of 1 to 4 items is " 158 f"invalid !sat_conf value ({config_data!r}), a list of 1 to 4 items is "
159 "expected" 159 "expected"
160 ) 160 )
161 161
162 value = self.host.memory.getConfig(section, name, default) 162 value = self.host.memory.getConfig(section, name, default)
163 if name == "public_url" and (not value or not value.startswith('http')): 163 # FIXME: "public_url" is used only here and doesn't take multi-sites into account
164 if name == "public_url" and (not value or value.startswith('http')):
164 if not value: 165 if not value:
165 log.warning(_( 166 log.warning(_(
166 'No value found for "public_url", using "https://example.org" for ' 167 'No value found for "public_url", using "example.org" for '
167 'now, please set the proper value in sat.conf')) 168 'now, please set the proper value in libervia.conf'))
168 else: 169 else:
169 log.warning(_( 170 log.warning(_(
170 'invalid value for "public_url" ({value}), it must start with ' 171 'invalid value for "public_url" ({value}), it musts not start with '
171 '"http", ignoring it and using "https://example.org" instead') 172 'schema ("http"), ignoring it and using "example.org" '
173 'instead')
172 .format(value=value)) 174 .format(value=value))
173 value = "https://example.org" 175 value = "example.org"
174 176
175 if filter_ is None: 177 if filter_ is None:
176 pass 178 pass
177 elif filter_ == 'first': 179 elif filter_ == 'first':
178 value = value[0] 180 value = value[0]