Change default for ARA_DISTRIBUTED_SQLITE_PREFIX to /ara-report
Considering the (re-)implementation of a built-in web report interface, it makes sense to move the default back to ara-report instead of ara-api. This results in: - /ara-report/: the web report interface - /ara-report/api/v1/: the API Change-Id: I06cdc07f26a39dc356284a2a549f0ea3a4935e1a
This commit is contained in:
parent
16c65d9f11
commit
5ceeddaf11
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <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 <distributed-sqlite-backend>`.
|
||||
|
||||
|
|
|
@ -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::
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue