-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Whether this is an issue I suppose is a matter of perspective. The routes in /admin/config for the plugins don't include APPLICATION_ROOT. I suppose the routes are given by the plugins themselves and could include the APPLICATION_ROOT, but it seems to me the plugins shouldn't have to know the base CTFd configuration. Ideally CTFd/plugins/__init__.py(register_admin_plugin_menu_bar) should be modified like
if route.startswith("http"):
am =Menu(title=title, route=route, link_target=link_target)
else:
application_root = current_app.config.get("APPLICATION_ROOT")
am = Menu(title=title, route=application_root + route, link_target=link_target)
app.admin_plugin_menu_bar.append(am)and probably CTFd/plugins/__init__.py(register_user_plugin_menu_bar) likewise. Though this change might mean that CTFd/themes/admin/templates/base.html and CTFd/themes/core/templates/base.html might need to be adapted for the new saved plugin routes. Otherwise, CTFd/themes/core/templates/config.hmlmight be adapted to include the APPLICATION_ROOT.