# HG changeset patch # User Goffi # Date 1558984244 -7200 # Node ID ba45dcdbeeaf85d22a256d94e5e721b50cde2102 # Parent b9a5418e9f2e8b40e3761c472611676848b1eb27 server: fixed sites alias: host aliases were incorrectly detected (existing_vhosts was not filled) and pages were imported several times. diff -r b9a5418e9f2e -r ba45dcdbeeaf libervia/server/server.py --- a/libervia/server/server.py Mon May 27 09:27:15 2019 +0200 +++ b/libervia/server/server.py Mon May 27 21:10:44 2019 +0200 @@ -1922,6 +1922,8 @@ site_path=site_path, path=root_path) + existing_vhosts[site_name] = res + if self.options['dev_mode']: self.files_watcher.watchDir( site_path, auto_add=True, recursive=True, @@ -1930,14 +1932,16 @@ tasks_manager = TasksManager(self, res) yield tasks_manager.runTasks() res.putChild(C.BUILD_DIR, static.File(self.getBuildPath(site_name))) + + LiberviaPage.importPages(self, res) + # FIXME: default pages are accessible if not overriden by external website + # while necessary for login or re-using existing pages + # we may want to disable access to the page by direct URL + # (e.g. /blog disabled except if called by external site) + LiberviaPage.importPages(self, res, root_path=default_site_path) + res._setMenu(self.options["menu_json"]) + self.vhost_root.addHost(host_name.encode('utf-8'), res) - LiberviaPage.importPages(self, res) - # FIXME: default pages are accessible if not overriden by external website - # while necessary for login or re-using existing pages - # we may want to disable access to the page by direct URL - # (e.g. /blog disabled except if called by external site) - LiberviaPage.importPages(self, res, root_path=default_site_path) - res._setMenu(self.options["menu_json"]) templates_res = web_resource.Resource() self.putChildAll(C.TPL_RESOURCE, templates_res)