diff --git a/ara/server/settings.py b/ara/server/settings.py index 9ed29d7c..d6f0720f 100644 --- a/ara/server/settings.py +++ b/ara/server/settings.py @@ -91,12 +91,12 @@ SECRET_KEY = get_secret_key() DISTRIBUTED_SQLITE = settings.get("DISTRIBUTED_SQLITE", False) # Under which URL should requests be delegated to the distributed sqlite wsgi application -DISTRIBUTED_SQLITE_PREFIX = settings.get("DISTRIBUTED_SQLITE_PREFIX", "ara-api") +DISTRIBUTED_SQLITE_PREFIX = settings.get("DISTRIBUTED_SQLITE_PREFIX", "ara-report") # Root directory under which databases will be found relative to the requested URLs. # This will restrict where the WSGI application will go to seek out databases. -# For example, the URL "example.org/some/path/ara-api" would translate to -# "/var/www/logs/some/path/ara-api" instead of "/some/path/ara-api". +# For example, the URL "example.org/some/path/ara-report" would translate to +# "/var/www/logs/some/path/ara-report" instead of "/some/path/ara-report". DISTRIBUTED_SQLITE_ROOT = settings.get("DISTRIBUTED_SQLITE_ROOT", "/var/www/logs") if DISTRIBUTED_SQLITE: diff --git a/ara/server/wsgi.py b/ara/server/wsgi.py index a983fc8e..c4c6b429 100644 --- a/ara/server/wsgi.py +++ b/ara/server/wsgi.py @@ -60,7 +60,7 @@ def distributed_sqlite(environ, start_response): # The root under which database files are expected root = settings.DISTRIBUTED_SQLITE_ROOT - # The prefix after which everything should be delegated (ex: /ara-api) + # The prefix after which everything should be delegated (ex: /ara-report) prefix = settings.DISTRIBUTED_SQLITE_PREFIX # Static assets should always be served by the regular app diff --git a/doc/source/api-configuration.rst b/doc/source/api-configuration.rst index 7febfb8d..5bb52097 100644 --- a/doc/source/api-configuration.rst +++ b/doc/source/api-configuration.rst @@ -46,7 +46,7 @@ For more details, click on the configuration parameters. +--------------------------------+--------------------------------------------------------+------------------------------------------------------+ | ARA_DISTRIBUTED_SQLITE_ | ``False`` | Whether to enable distributed sqlite backend | +--------------------------------+--------------------------------------------------------+------------------------------------------------------+ -| ARA_DISTRIBUTED_SQLITE_PREFIX_ | ``ara-api`` | Prefix to delegate to the distributed sqlite backend | +| ARA_DISTRIBUTED_SQLITE_PREFIX_ | ``ara-report`` | Prefix to delegate to the distributed sqlite backend | +--------------------------------+--------------------------------------------------------+------------------------------------------------------+ | ARA_DISTRIBUTED_SQLITE_ROOT_ | ``/var/www/logs`` | Root under which sqlite databases are expected | +--------------------------------+--------------------------------------------------------+------------------------------------------------------+ @@ -276,13 +276,13 @@ ARA_DISTRIBUTED_SQLITE_PREFIX - **Configuration file variable**: ``DISTRIBUTED_SQLITE_PREFIX`` - **Provided by**: ``ara.server.db.backends.distributed_sqlite`` and ``ara.server.wsgi.distributed_sqlite`` - **Type**: ``string`` -- **Default**: ``ara-api`` +- **Default**: ``ara-report`` Under which URL should requests be delegated to the distributed sqlite wsgi application. -``ara-api`` would delegate everything under ``.*/ara-api/.*`` +``ara-report`` would delegate everything under ``.*/ara-report/.*`` The path leading to this prefix must contain the ``ansible.sqlite`` database file, for example: -``/var/www/logs/some/path/ara-api/ansible.sqlite``. +``/var/www/logs/some/path/ara-report/ansible.sqlite``. For more information, see: :ref:`distributed sqlite backend `. @@ -299,8 +299,8 @@ Root directory under which databases will be found relative to the requested URL This will restrict where the WSGI application will go to seek out databases. -For example, the URL ``example.org/some/path/ara-api`` would translate to -``/var/www/logs/some/path/ara-api``. +For example, the URL ``example.org/some/path/ara-report`` would translate to +``/var/www/logs/some/path/ara-report``. For more information, see: :ref:`distributed sqlite backend `. diff --git a/doc/source/distributed-sqlite-backend.rst b/doc/source/distributed-sqlite-backend.rst index c7254b45..706f2955 100644 --- a/doc/source/distributed-sqlite-backend.rst +++ b/doc/source/distributed-sqlite-backend.rst @@ -7,8 +7,8 @@ The ARA API server provides an optional backend that dynamically loads sqlite databases based on the requested URL with the help of a WSGI application middleware. -In summary, it maps an URL such as ``http://example.org/some/path/ara-api`` to -a location on the file system like ``/var/www/logs/some/path/ara-api`` and +In summary, it maps an URL such as ``http://example.org/some/path/ara-report`` +to a location on the file system like ``/var/www/logs/some/path/ara-report`` and loads an ``ansible.sqlite`` database from that directory, if it exists. .. note:: diff --git a/roles/ara_api/defaults/main.yaml b/roles/ara_api/defaults/main.yaml index 0c507c84..bfca5ec0 100644 --- a/roles/ara_api/defaults/main.yaml +++ b/roles/ara_api/defaults/main.yaml @@ -156,7 +156,7 @@ ara_api_secret_key: null ara_api_distributed_sqlite: false # ARA_DISTRIBUTED_SQLITE_PREFIX - Prefix to delegate to the distributed sqlite backend -ara_api_distributed_sqlite_prefix: ara-api +ara_api_distributed_sqlite_prefix: ara-report # ARA_DISTRIBUTED_SQLITE_ROOT - Root under which sqlite databases are expected ara_api_distributed_sqlite_root: /var/www/logs diff --git a/tests/with_distributed_sqlite.yaml b/tests/with_distributed_sqlite.yaml index a81f046d..4b801b05 100644 --- a/tests/with_distributed_sqlite.yaml +++ b/tests/with_distributed_sqlite.yaml @@ -22,6 +22,7 @@ ara_tests_cleanup: true ara_api_root_dir: "{{ ansible_user_dir }}/.ara-tests" ara_api_distributed_sqlite_root: "{{ ansible_user_dir }}/.ara-tests" + ara_api_distributed_sqlite_prefix: ara-test-report ara_api_wsgi_server: gunicorn ara_api_secret_key: testing ara_api_debug: true @@ -29,9 +30,9 @@ ara_api_server: "http://127.0.0.1:8000" ara_api_client: http _test_directories: - - "tests/some/path/ara-api" - - "tests/dev/ara-api" - - "tests/prod/ara-api" + - "tests/some/path/ara-test-report" + - "tests/dev/ara-test-report" + - "tests/prod/ara-test-report" tasks: # Generate ourselves a fresh database to run tests with - name: Set up the API with the default sqlite backend