diff --git a/.github/workflows/setup.sh b/.github/workflows/setup.sh index 49112cd5..5ed07143 100755 --- a/.github/workflows/setup.sh +++ b/.github/workflows/setup.sh @@ -18,7 +18,7 @@ if [[ -z $MINIMAL_INSTALL ]]; then # VCS support pacman -Sy --noconfirm breezy darcs mercurial subversion # web server - pacman -Sy --noconfirm python-aioauth-client python-aiohttp python-aiohttp-apispec-git python-aiohttp-cors python-aiohttp-debugtoolbar python-aiohttp-jinja2 python-aiohttp-security python-aiohttp-session python-cryptography python-jinja + pacman -Sy --noconfirm python-aioauth-client python-aiohttp python-aiohttp-apispec-git python-aiohttp-cors python-aiohttp-jinja2 python-aiohttp-security python-aiohttp-session python-cryptography python-jinja # additional features pacman -Sy --noconfirm gnupg python-boto3 rsync fi diff --git a/Dockerfile b/Dockerfile index a4d776ad..9ea1b032 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ RUN pacman -Sy --noconfirm --asdeps devtools git pyalpm python-cerberus python-i pacman -Sy --noconfirm --asdeps python-build python-flit python-installer python-wheel && \ pacman -Sy --noconfirm --asdeps breezy git mercurial python-aiohttp python-aiohttp-cors python-boto3 python-cryptography python-jinja python-requests-unixsocket python-systemd rsync subversion && \ runuser -u build -- install-aur-package python-aioauth-client python-aiohttp-apispec-git python-aiohttp-jinja2 \ - python-aiohttp-debugtoolbar python-aiohttp-session python-aiohttp-security + python-aiohttp-session python-aiohttp-security ## FIXME since 1.0.4 devtools requires dbus to be run, which doesn't work now in container COPY "docker/systemd-nspawn.sh" "/usr/local/bin/systemd-nspawn" diff --git a/docs/architecture.rst b/docs/architecture.rst index 0e0c01b4..9205f12f 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -363,7 +363,6 @@ Web application requires the following python packages to be installed: * Core part requires ``aiohttp`` (application itself), ``aiohttp_jinja2`` and ``Jinja2`` (HTML generation from templates). * Additional web features also require ``aiohttp-apispec`` (autogenerated documentation), ``aiohttp_cors`` (CORS support, required by documentation). -* In addition, ``aiohttp_debugtoolbar`` is required for debug panel. Please note that this option does not work together with authorization and basically must not be used in production. * In addition, authorization feature requires ``aiohttp_security``, ``aiohttp_session`` and ``cryptography``. * In addition to base authorization dependencies, OAuth2 also requires ``aioauth-client`` library. * In addition if you would like to disable authorization for local access (recommended way in order to run the application itself with reporting support), the ``requests-unixsocket`` library is required. diff --git a/docs/configuration.rst b/docs/configuration.rst index 243d94a9..67fbe86f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -121,9 +121,6 @@ Reporting to web service related settings. In most cases there is fallback to we Web server settings. This feature requires ``aiohttp`` libraries to be installed. * ``address`` - optional address in form ``proto://host:port`` (``port`` can be omitted in case of default ``proto`` ports), will be used instead of ``http://{host}:{port}`` in case if set, string, optional. This option is required in case if ``OAuth`` provider is used. -* ``debug`` - enable debug toolbar, boolean, optional, default ``no``. -* ``debug_check_host`` - check hosts to access debug toolbar, boolean, optional, default ``no``. -* ``debug_allowed_hosts`` - allowed hosts to get access to debug toolbar, space separated list of string, optional. * ``enable_archive_upload`` - allow to upload packages via HTTP (i.e. call of ``/api/v1/service/upload`` uri), boolean, optional, default ``no``. * ``host`` - host to bind, string, optional. * ``index_url`` - full url of the repository index page, string, optional. diff --git a/package/archlinux/PKGBUILD b/package/archlinux/PKGBUILD index 7f6c4a8a..ae2999cb 100644 --- a/package/archlinux/PKGBUILD +++ b/package/archlinux/PKGBUILD @@ -16,7 +16,6 @@ optdepends=('breezy: -bzr packages support' 'python-aiohttp: web server' 'python-aiohttp-apispec>=3.0.0: web server' 'python-aiohttp-cors: web server' - 'python-aiohttp-debugtoolbar: web server with enabled debug panel' 'python-aiohttp-jinja2: web server' 'python-aiohttp-security: web server with authorization' 'python-aiohttp-session: web server with authorization' diff --git a/package/share/ahriman/settings/ahriman.ini b/package/share/ahriman/settings/ahriman.ini index f06dd598..6bf2d950 100644 --- a/package/share/ahriman/settings/ahriman.ini +++ b/package/share/ahriman/settings/ahriman.ini @@ -79,9 +79,6 @@ command = rsync --archive --compress --partial --delete chunk_size = 8388608 [web] -debug = no -debug_check_host = no -debug_allowed_hosts = host = 127.0.0.1 static_path = /usr/share/ahriman/templates/static templates = /usr/share/ahriman/templates diff --git a/pyproject.toml b/pyproject.toml index 661053f2..b640c948 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,6 @@ web = [ "aiohttp-apispec", "aiohttp_cors", "aiohttp_jinja2", - "aiohttp_debugtoolbar", "aiohttp_session", "aiohttp_security", "cryptography", diff --git a/src/ahriman/core/configuration/schema.py b/src/ahriman/core/configuration/schema.py index 9e414e70..4e315f57 100644 --- a/src/ahriman/core/configuration/schema.py +++ b/src/ahriman/core/configuration/schema.py @@ -297,22 +297,6 @@ CONFIGURATION_SCHEMA: ConfigurationSchema = { "empty": False, "is_url": ["http", "https"], }, - "debug": { - "type": "boolean", - "coerce": "boolean", - }, - "debug_check_host": { - "type": "boolean", - "coerce": "boolean", - }, - "debug_allowed_hosts": { - "type": "list", - "coerce": "list", - "schema": { - "type": "string", - "empty": False, - }, - }, "enable_archive_upload": { "type": "boolean", "coerce": "boolean", diff --git a/src/ahriman/web/web.py b/src/ahriman/web/web.py index 1dd7362b..15f5a319 100644 --- a/src/ahriman/web/web.py +++ b/src/ahriman/web/web.py @@ -171,16 +171,6 @@ def setup_server(configuration: Configuration, spawner: Spawn, repositories: lis application.logger.info("setup process spawner") application["spawn"] = spawner - # disable debug panel as it is not compatible with python 3.11 at the moment - # https://github.com/aio-libs/aiohttp-debugtoolbar/issues/477 - # application.logger.info("setup debug panel") - # debug_enabled = configuration.getboolean("web", "debug", fallback=False) - # if debug_enabled: - # import aiohttp_debugtoolbar # type: ignore[import-untyped] - # aiohttp_debugtoolbar.setup(application, - # hosts=configuration.getlist("web", "debug_allowed_hosts", fallback=[]), - # check_host=configuration.getboolean("web", "debug_check_host", fallback=False)) - application.logger.info("setup authorization") validator = application["validator"] = Auth.load(configuration, database) if validator.enabled: diff --git a/tests/ahriman/web/test_web.py b/tests/ahriman/web/test_web.py index 3beea310..4a9d4e32 100644 --- a/tests/ahriman/web/test_web.py +++ b/tests/ahriman/web/test_web.py @@ -122,22 +122,6 @@ def test_run_with_auth(application_with_auth: Application, mocker: MockerFixture ) -@pytest.mark.skip(reason="https://github.com/aio-libs/aiohttp-debugtoolbar/issues/477") -def test_run_with_debug(application_with_debug: Application, mocker: MockerFixture) -> None: - """ - must run application with enabled debug panel - """ - port = 8080 - application_with_debug["configuration"].set_option("web", "port", str(port)) - run_application_mock = mocker.patch("ahriman.web.web.run_app") - - run_server(application_with_debug) - run_application_mock.assert_called_once_with( - application_with_debug, host="127.0.0.1", port=port, sock=None, handle_signals=True, - access_log=pytest.helpers.anyvar(int), access_log_class=FilteredAccessLogger - ) - - def test_run_with_socket(application: Application, mocker: MockerFixture) -> None: """ must run application diff --git a/tests/testresources/core/ahriman.ini b/tests/testresources/core/ahriman.ini index fc9ed8c7..21aba0e9 100644 --- a/tests/testresources/core/ahriman.ini +++ b/tests/testresources/core/ahriman.ini @@ -112,9 +112,6 @@ username = arcan1s [remote-service] [web] -debug = no -debug_check_host = no -debug_allowed_hosts = enable_archive_upload = yes host = 127.0.0.1 static_path = ../web/templates/static