summaryrefslogtreecommitdiffstats
path: root/dashboard
AgeCommit message (Collapse)AuthorFilesLines
2018-12-03BUG FIX: Properly decodes ssh public keyfileParker Berberian2-1/+3
Because of how Python3 changed how it handled strings, the byte string read from the user's keyfile was not directly serializable. This decodes the bytes into a unicode string, assuming UTF-8 encoding. Change-Id: I5f723a61fb577fa6d4e76e701ef529521ab389ba Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-11-28Removed Vanilla Form SubmissionParker Berberian4-12/+36
On google chrome, using vanilla html forms, eg: document.getElementById("Form_id").submit(); does not properly set the CSRF header from the cookies. This results in 403 unauthorized errors in chrome when doing certain things. This is possibly an issue to do with how chrome handles iframes differently from firefox. To fix, we replaced basic forms with serialized XMLHttpRequests, which are more common in this codebase anyway. Change-Id: I93e92cd326c8bba47408b66a95d9d5d806c154f6 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-11-26Fixed Misc BugsParker Berberian9-12/+30
Some corner cases that cause issues recently came to our attention. Fixes issues in the booking workflow and the Notification system. Change-Id: Ie16118ba1bdbeff86bb41a16dc783337b921d527 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-11-26Fix all flake8 errorsParker Berberian58-689/+947
The flake8 command in test.sh finds no longer finds any errors. This may form a basis of a jenkins verify job as a sort of 'weak compile-time checks' The flake8 command will not complain about line length, and will not complain about django's manage.py file Change-Id: Ic47cb4fc7ada55e64485661ab6881aef475018ff Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-11-07Merge "Rewrite Notification subsystem"Trevor Bramwell23-463/+291
2018-11-07Rewrite Notification subsystemParker Berberian23-463/+291
In this commit: - delete a lot of really bad and / or unused code - redesign a much simpler Notification model - create and send notifications to the user's inbox on booking start & end - migrations - emails user when booking is ready and when it ends Not in this commit: - Creating notifications from lab messages - warning messages when a booking is about to end - creating "summary" notifications when e.g. a booking has been fulfilled by a lab Change-Id: I69b4dc36c3f2bce76d810106baadeef5a562cc7d Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-11-01Merge "Restrict Postgres to version 10"Trevor Bramwell1-1/+1
2018-10-31Merge "Improved Collaborators UX"Trevor Bramwell2-3/+4
2018-10-31Merge "Fixes for access creation and removal"Trevor Bramwell2-15/+28
2018-10-31Merge "Fixed Indentation"Trevor Bramwell1-239/+231
2018-10-31Merge "Hides information about your booking from other users"Trevor Bramwell1-0/+4
2018-10-31Merge "Fix Booking List"Trevor Bramwell1-2/+2
2018-10-29Fixed IndentationParker Berberian1-239/+231
This is a pretty complex html file that we will have to modify soon, so I made sure that every tag is opened and closed at the correct height. The correct height for a tag is 4 spaces more indented than its parent Change-Id: Ie356b61746477f65304f38c019f471e5cae1aa94 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-26Improved Collaborators UXParker Berberian2-3/+4
Some small improvements based on feedback from Trevor. - Changed lable from "users" to "collaborators" to try and be more clear - Do not show your own name in the dropdown by default - You cannot select yourself as a collaborator Change-Id: Ie2e9070232765ed9eabe6657924ed8addaa0165a Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-26Hides information about your booking from other usersParker Berberian1-0/+4
If a user is not the owner or a collaborator on a booking, they should be kept from seeing the booking detail page which may contain credentials, etc from the lab fulfilling the booking. Change-Id: I27c383a0e1d017b5d02a7c9a37676f6a968c9270 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-26Forces hostnames to not be emptyParker Berberian1-0/+1
Previously, when a host was 'added' but not given a hostname, it was excluded from the list of hosts sent to the backend for processing. By explicitly adding each host to the result, we avoid this and force the checking of an empty hostname (which will correctly fail). Change-Id: Ia533bc23baf558a5e297dab629dbf47fb4704d7f Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-24Restrict Postgres to version 10Trevor Bramwell1-1/+1
Postgres 11 was just released and the images does not yet support automatic data upgrades. Restricting it to 10 should keep users from running into issues when using/testing the dashboard. Change-Id: I7758cb01b5c6c0c75166536fc0d99277995d5da0 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
2018-10-24Fixes for access creation and removalParker Berberian2-15/+28
Fixes include: - creating ssh access jobs for users with ssh keys - ensuring vpn access is revoked after booking ends Creates ssh access jobs with the user's ssh keys, if they exist Change-Id: Ia2e9f0c5a2f90b45732a5767a62b87a5a5492b94 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-24Fix Booking ListParker Berberian1-2/+2
The table that lists all active bookings at /booking/list/ was using booking.user. This doesn't exist anymore, changed to booking.owner Change-Id: I76c8d498f4dbe64d88c4c6f7b5e380559b125e44 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-23Merge "Fix Missing Static Assets"Parker Berberian1-2/+2
2018-10-23Merge "Fixed serialization"Parker Berberian1-2/+1
2018-10-23Merge "Fix error in Booking cleanup task"Parker Berberian1-1/+1
2018-10-23Merge "Fix clear_delta() function"Parker Berberian1-1/+2
2018-10-23Merge "Added template"Parker Berberian1-0/+18
2018-10-23Merge "Fix Typo"Parker Berberian1-1/+0
2018-10-23Merge "Adds migrations"Parker Berberian2-0/+45
2018-10-23Fix Missing Static AssetsTrevor Bramwell1-2/+2
collectstatic copies the static assets to STATIC_ROOT (which is set to '/static'), instead of the static directory under pharos_dashboard. Updating the static volume, which is served from NGINX to include these files should fix the missing assets. Change-Id: I19288e9825c1513684e4ee5f8a9542b1a0ceeeb1 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
2018-10-22Fixed serializationParker Berberian1-2/+1
There was no need to serialize he dict ourselves. JsonResponse wants to recieve a dict. Change-Id: I2af1d9d8f0ccec4644e64ffce0de6005773be786 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-19Fix error in Booking cleanup taskParker Berberian1-1/+1
added a missing function call that was causing celery to fail to clean up Jobs. Change-Id: I07a5e576d3dfcac320be206cc3235d17d4b286e0 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-17Fix clear_delta() functionParker Berberian1-1/+2
NetworkConfig.clear_delta() appeared to be a noop, but can set the delta to a nonempty string if delta is None. This reverts a change I made here: https://gerrit.opnfv.org/gerrit/#/c/63385/6..7/dashboard/src/api/models.py Change-Id: I72661ca9d889801fb6183943c8ae0e5e38cc960a Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-17Added templateParker Berberian1-0/+18
This template should not have been removed. Change-Id: Ic794ee40f45bd44af6fa976983b1c93660c8bb1c Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-17Fix TypoParker Berberian1-1/+0
In one of the patchsets of LaaS 2.0 a typo was added. Change-Id: I02ff24bea345279df6643c0b1a4358ab2eff1d31 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-17Adds migrationsParker Berberian2-0/+45
In reviewing the LaaS 2.0 code, models were changed without the accompanying migrations. Change-Id: Ibdba456d9650c7d7d8750328852f27866a899328 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-15Removed references to old codeParker Berberian2-128/+1
With the LaaS 2.0 rewrite, there was still some old/dead/broken code being referenced. This patch fixes that. Change-Id: I25803652bc59bba1e416e526d205742c52f14a65 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-15Lab as a Service 2.0Parker Berberian234-2004/+15935
See changes here: https://wiki.opnfv.org/display/INF/Pharos+Laas Change-Id: I59ada5f98e70a28d7f8c14eab3239597e236ca26 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu> Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-08Development Override Compose FileTrevor Bramwell11-51/+123
Now that images are built and hosted for the dashboard and worker container the compose file can reference upstream images instead of ones locally built. A second compose file is added which overrides compose configuration so that images are built locally. Initial commands for running the container are moved into 'init.sh' which gets copied into the image, since the current images cannot be ran by themselves as they require the command listed in the compose file. The compose version bumped from 2 to 3 as there are no version 2 specific features being used that need to be modified. Change-Id: I23813a859a676ba009cba8f5a62b7153da006eef Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
2018-10-05Update Postgres UsageTrevor Bramwell3-15/+3
Setting POSTGRES_{DB,USER,PASSWORD} variables removes the need to volume mount the script for specifying the user and database. Change-Id: I7ee958c8d36702d1afd701e026b642ac84440ee8 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
2018-10-01Use Upstream Rabbitmq Docker ContainerTrevor Bramwell5-21/+6
The upstream rabbitmq container supports specifying the default admin user and password through the environment variables: RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS. Utilizing these variables removes the need to build a rabbitmq container specific to the Pharos LaaS Dashboard. Change-Id: I390d7fa9254a0f28b374235254caff59b219cd87 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
2018-10-01Bump Python Cryptography Library VersionTrevor Bramwell2-2/+2
The underlying OpenSSL version changed in an upstream container which cryptography==1.4 did not support. Bumping the cryptography library fixes the build as they introduce broader support for OpenSSL versions in their newer releases. Change-Id: Ibd2f73aefebb39cc4121b77fa38aecb32b8494ae Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
2018-07-20change ',' to '.' in settings.pywutianwei1-1/+1
Change-Id: I4f4a3419eef2aba407d772b39be62214b6b7142e Signed-off-by: wutianwei <wutianwei1@huawei.com>
2018-04-13Merge "Limit User Booking Length and Extensions"Parker Berberian5-4/+67
2018-04-13Merge "Gracefully Handle Missing Jenkins Utilization for Dev Pod"Parker Berberian1-19/+24
2018-03-27Implement Booking Cleanup TaskSawyer Bergeron3-2/+29
Jira: PHAROS-344 Two new settings in config.env allow setting 1) how "stale" an expired booking can get before being culled and 2) how many expired bookings are kept around before culling If either condition is met, expired bookings will be deleted until both are false. Change-Id: I6b091e93c6fe5d47b75ebf5325b717fa898c773c Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2018-03-26Gracefully Handle Missing Jenkins Utilization for Dev PodSawyer Bergeron1-19/+24
Jira: PHAROS-364 Change-Id: I0641c658914e600672151d7c0d1661acba794f0f Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2018-03-26Limit User Booking Length and ExtensionsSawyer Bergeron5-4/+67
Jira: PHAROS-363 Bookings can now only be 3 weeks upon creation with a maximum of 2 1 week extensions. Change-Id: I677770de3f62f188d23e60be6d71b42b25bf007e Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2018-02-28Merge "Allow Configuring 'DEFAULT_EMAIL_FROM' in Django"stable/fraserParker Berberian2-0/+2
2018-02-27Allow Configuring 'DEFAULT_EMAIL_FROM' in DjangoTrevor Bramwell2-0/+2
This sets the default 'FROM' address in the header of outgoing emails from the system. Making this configurable allows users to specify the address notification emails come from. Change-Id: Ibe229ef503847411f4879d5715392f816a455733 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
2018-02-22Link AUP from dashboardSawyer Bergeron1-1/+5
Jira: PHAROS-361 Link and associated text below booking confirmation button now direct users to Wiki#AUP and inform them that they agree to those policies by continuing. Change-Id: I18953cc71691a03290cbce979fbf500081ca3c10 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2018-02-19Merge "Provide Interface for Booking Deletion"Parker Berberian5-4/+71
2018-02-19Provide Interface for Booking DeletionSawyer Bergeron5-4/+71
Jira: PHAROS-355 User can now delete their own booking by going to the detail view of their booking and clicking 'delete' Change-Id: I279da364c2a5dfd03b877d1236c610d0fef563bc Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>