Commit Graph

15 Commits

Author SHA1 Message Date
David Moreau Simard 33e4c1d841
Update README to explain ara-server was migrated back into ara
The ara-server standalone repository is being discontinued.
The clear and logical separation of components was nice but the overhead
in complexity was not worth it.

Change-Id: I9d5e3096db4972405932ae2af46ee63bfeef43b5
2019-03-02 08:47:26 -05:00
Florian Apolloner 47dc0ad989 Fixed XSS issue from DRF.
Details in https://github.com/encode/django-rest-framework/issues/6330

Change-Id: Icea25569b92c3559029ae1c93712e746684187f1
2019-01-17 22:40:43 +01:00
Florian Apolloner cf2bda747b Adjusted requirements to include yaml for dynaconf.
Change-Id: I5eccfde22fdd0725d41258bc4acc7fe771289874
2019-01-15 18:11:38 +01:00
Florian Apolloner 1039878100 Updated Django dependency to 2.1.5
This is needed so that
e1721ece48 (diff-f6d1c75ec606389da5af6558bf57f171)
is included and saves us from having compat code in https://review.openstack.org/#/c/617112/1

This is also a good idea in preparation of the Django 2.2 release which
will be LTS and probably the version ARA should target.

Change-Id: I36d74c6c0a0165dd1ceaf695185809af5d6da18e
2019-01-04 17:01:42 +01:00
David Moreau Simard 71a2e122d7
Remove requirement on django-environ
It was used in the previous implementation of settings.py which has
since been replaced with dynaconf.

Change-Id: Id8bca7a35cbc817120e04d3fc6247eaee48bef01
2018-12-21 10:04:18 -05:00
David Moreau Simard 2bd8c3f654
Refactor and standardize how files are added to playbooks
Files are now (once again) related to playbooks.
We expect the playbook to be created first and then it's files are
created and associated to it.

- the /api/v1/playbook/<id>/files endpoint was removed
- the playbook id is now required when doing a POST on /api/v1/files
- playbook.file referenced a file object and no longer exists.
- playbook.file was replaced by "path" which is the path for the playbook
  file.
- playbook.files still exists but, from an API standpoint, this means
  that to find the files associated to a playbook, we can now do
  something like:

    "/api/v1/files?playbook=%s" % playbook.id

To find the playbook file itself, we can do something like:

    "/api/v1/files?playbook=%s&path=%s" % (playbook.id, playbook.path)

Change-Id: Id51129757e1626313caee4005b081027e5694aba
2018-12-20 17:49:01 -05:00
David Moreau Simard 16aa41eaf8 Refactor configuration to use dynaconf
This changes the configuration engine from everett to dynaconf.
dynaconf allows loading configuration from files (json, ini, yaml, toml)
as well as environment variables prefixed by ARA_.

Our usage of dynaconf is similar to the use case from the Pulp [1]
project and they have documented an issue when loading database
parameters [2]. This issue is worked around by importing dynaconf in the
different entry points.

This introduces some other changes as well:
- We're now creating a default configuration and data directory at
  ~/.ara. The location of this directory is controlled with the
  ARA_BASE_DIR environment variable.
- We're now creating a default configuration template in
  ~/.ara/default_config.yaml.
- The default database is now located at ~/.ara/ara.sqlite. The location
  of this database can be customized with the ARA_DATABASE_NAME
  environment variable.
  Note that ARA 0.x used "~/.ara/ansible.sqlite" -- the file name change
  is deliberate in order to avoid user databases clashing between
  versions.

More documentation on this will be available in an upcoming patch.

[1]: https://github.com/pulp/pulp
[2]: https://github.com/rochacbruno/dynaconf/issues/89

Change-Id: I8178b4ca9f2b4d7f4c45c296c08391e84e8b990d
2018-12-20 17:53:11 +01:00
Florian Apolloner 05915224d7 Allow configuration of settings via config files.
Change-Id: I3ac35ef56453f5cc7ab0fd3ffc0816a9e89b7b55
2018-10-22 19:48:52 +02:00
Guillaume Vincent fef942b62f
Add search by name on playbook endpoint
Change-Id: I1ffb958aff4aa466cb15e3e2c2e9f0bb28207224
2018-10-16 09:48:33 -04:00
Florian Apolloner 509bbb8486 Small cleanups for django best practices.
Changes include:

 * Custom admin app config instead of monkey patching attributes.
 * DRF Routers & Viewsets instead of manual view configuration.
 * nested viewsets from drf-extensions (for now) to scope files to playbooks.
 * Removed media serving since runserver does this alreay in dev;
    deployment will need another option anyways.

Change-Id: I409bd3f7faa5f133fcb204613baebf2512d34c1a
2018-09-28 08:51:36 +02:00
David Moreau Simard 6a1dd890f0
Add CORS middleware for webapp development
Otherwise it won't work because the API server listens on 127.0.0.1,
not localhost.
The right fix is probably to set the nodejs server to start on
127.0.0.1, though.
Figure this out later.

Change-Id: I260e794e8ff842f6b854d313d6c243e431220fcd
2018-09-05 10:08:01 -04:00
David Moreau Simard fe079a66fc
Bump Django to >2
If we're starting something from scratch, we might as well do it on the
new release of Django.

Change-Id: I9b82fdb02aa0f38f8a7c6ec970e8abb835468ed5
2018-03-29 12:36:23 -04:00
David Moreau Simard 5fbbdac265
Bootstrap the repository with the basic machinery (#1)
- Make the project installable with pbr
- Use tox to run tests, build docs, runserver
- Flesh out the README a little bit
- Real docs is WIP.

Change-Id: I3dc92250cd93add0cdf11c6a67d8f1081560d4e1
2018-03-29 12:36:22 -04:00
Guillaume Vincent 3d42296683
Remove DRF nested router and make api flat
Change-Id: Ib71519b9fab19d58b23467b811bc7aa482c1455b
2018-03-29 12:36:20 -04:00
Guillaume Vincent a889a71bcd
💥 first commit
Change-Id: I42df36220dce581a929c604a13bba0ccb3d580e6
2018-03-29 12:36:14 -04:00