Commit Graph

89 Commits (e72d8b76c4e79dceac932a5d68ec56fe2bcebff4)

Author SHA1 Message Date
Aravinth Manivannan e72d8b76c4
fix: run wget in quiet mode and adapt MAILDEV_URL based on environment
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-23 23:54:45 +05:30
Aravinth Manivannan 254dafbff0
hotfix: run gitea on host
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-23 23:31:27 +05:30
Aravinth Manivannan 695b94a4d1
hot fix: disable gitea service 2022-06-23 23:27:45 +05:30
Aravinth Manivannan a5abfe0f04
fix: mv test dependency services to woodpecker config file
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-23 21:28:26 +05:30
Aravinth Manivannan 1004d540ad
chore: install docker-compose in CI
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-23 21:20:48 +05:30
Aravinth Manivannan 4714bc4123
fix: woodpecker config file syntax
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-23 21:15:39 +05:30
Aravinth Manivannan 1a8bc9c1ab
feat: integration testing
SUMMARY
    integration/__main__.py is a CLI-based HTTP client that can interact
    with Hostea Dashboard and Gitea.

    Integration tests are run via integration/tests.sh, which is a
    driver for the HTTP client at integration/__main__.py. The script is
    capable of spinning up a test environment consisting of services
    defined in docker-compose-dev-deps.yml and the Hostea Dashboard and
    tearing it down after a successful run.

    The credentials used to create various accounts and other parameters
    are all defined in integration/tests.sh script it self. So it is
    self contained.

CLIENT FUNCTIONALITY:

    HOSTEA DASHBOARD:
	 - register user with email verification
	 - login
	 - create OIDC app
	 - visit support page

    GITEA:
	 - Install Gitea(DB configuration, etc. The first form that's
	 presented to the visitor after a new instance is deployed)
	 - Register User
	 - Login User
	 - Create repository
	 - Configure OIDC SSO
	 - Login via SSO
2022-06-23 21:06:58 +05:30
Aravinth Manivannan caa190d99c
feat: use local gitea instance for hostea support in dev 2022-06-23 21:06:57 +05:30
Aravinth Manivannan b1e1a18e67
chore: run dependency services in test script via docker-compose-dev-deps 2022-06-23 21:06:56 +05:30
Aravinth Manivannan 759fa3f883
feat: define dev env with smtp and gitea services 2022-06-23 21:06:31 +05:30
Aravinth Manivannan c1577f824c
feat: Dashboard-Gitea SSO integration test script
STEPS
    1. Register new user on dashboard

    2. Confirm user email, link is received from email. maildev/maildev
       is an SMTP server specifically built for testing emails locally.
       It comes with a REST API[0], which is used to access emails

    3. Sign in to Dashboard

    4. Visit /support/new/ on dashboard to raise new support request

    5. Redirection to Hostea Gitea support repository is done via
       JavaScript, so we simply test to see if the support repository's
       new issue page is present in the Dashboard response

    6. Go to support repository's new issue page. Gitea will redirect to
       sign in page

    7. Parse sign in page, find OIDC SSO link in sign in page

    8. Visit OIDC SSO link in sign in page, to be redirected to
       authorization page

    9. If OIDC integration on Dashboard is setup via `create_oidc`
       management command, then auto-authorization will be enabled for
       the integration. So user will be redirected to Gitea

    10. For new OIDC logins, Gitea will present a form to choose
	preferred username and enter email address. So fill that form
	and submit it.

	Please note the form submits to a different URL than the one at
	which the form is available. See `Gitea.__link_acount` and
	`Gitea.__link_acount_signup` and its usage in `Gitea._sso_login`

    11. Verify user creation by GET /{username}, should respond HTTP 200

    12. Visit new issue on support repository, should respond HTTP 200

RESOURCES
    [0]: https://github.com/maildev/maildev/blob/master/docs/rest.md
2022-06-23 21:06:28 +05:30
Aravinth Manivannan 19ed720b82
feat: mv redirect if authenticated to decorator and guard other
ci/woodpecker/push/woodpecker Pipeline was successful Details
sigin/signup views
2022-06-22 00:43:10 +05:30
Aravinth Manivannan 96e71d7c32
fix: auto-redirect authenticated user when visiting login page 2022-06-22 00:43:10 +05:30
Aravinth Manivannan f6c89999e9
feat: test account verification email 2022-06-22 00:43:10 +05:30
Aravinth Manivannan 19682874ba
feat: payments system configuration docs
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-22 00:40:06 +05:30
Aravinth Manivannan d470033429
feat: implement billing with stripe
SUMMARY
    PAYMENT WORKFLOW
	1. User is redirected after a new instance is created into a view
	   that generates invoice. There are checks in place to ensure
	   invoices are not generated twice for the same VM. There is also a
	   check in place to generate invoices for time periods that are
	   already paid for
	2. User is redirected to payment form
	3. Stripe takes over
	4. If payment is successful, user is redirected to success page
	5. If payment failed, user is redirected to failure page

    PENDING INVOICES
	The user can see pending invoices on their dashboard

    PAYMENT RECEIPTS
	The user can see payment receipts on their dashboard
2022-06-22 00:37:03 +05:30
Aravinth Manivannan 760c0e90af
feat: create_instance_util test utility 2022-06-22 00:36:59 +05:30
Aravinth Manivannan 4908754b0d
feat: init billing app 2022-06-22 00:36:46 +05:30
Aravinth Manivannan 743f3447e7
feat: redirect to invoice after instance creation 2022-06-21 23:31:04 +05:30
Aravinth Manivannan bddd7a88b2
feat: link billing views in secondary nav bar 2022-06-21 23:30:20 +05:30
Aravinth Manivannan 8507129063
feat: create_oidc management command to create SSO integration for
ci/woodpecker/push/woodpecker Pipeline was successful Details
Hostea
2022-06-19 22:25:33 +05:30
Aravinth Manivannan cc1ecaf6a0
feat: init django-oauth-toolkit 2022-06-19 22:25:27 +05:30
Aravinth Manivannan a04cbf0943
feat: password strength validation during registration and migrate tests to cope with it
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-19 21:23:38 +05:30
Aravinth Manivannan faa7e924cc
feat: get_user_id management command
ci/woodpecker/push/woodpecker Pipeline was successful Details
DESCRIPTION
    Gets the DB assigned ID associated with a username
2022-06-19 21:02:38 +05:30
Aravinth Manivannan 38619babc7
feat: improve view VM styling and show VM configuration 2022-06-19 15:23:50 +05:30
Aravinth Manivannan 429934c795
fix: insert default instance configurations using migrations scripts
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-19 13:36:28 +05:30
Aravinth Manivannan 3f7f9fc1ed
fix: run migrations before testing
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-18 22:20:41 +05:30
Aravinth Manivannan d5dc06be18
feat: views for listing, viewing and deleting specific VMs
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-18 22:12:41 +05:30
Aravinth Manivannan 2fb1a3d0d1
fix: one user can have multiple instances; OneToOneField -> ForeignKey 2022-06-18 21:56:02 +05:30
Aravinth Manivannan 627087cf0e
feat: sudo view 2022-06-18 21:54:31 +05:30
Aravinth Manivannan 2ccf3d9679
feat: confirm access decorator
DESCRIPTION
    Some views are privileged and unauthorized execution can have
    irreversible changes. confirm_access decorator checks if the user's
    session is verified for privileged operation execution.

    If not, it will redirect user to "accounts.sudo" vie" vie" vie" view
2022-06-18 21:52:18 +05:30
Aravinth Manivannan 1e7d45d53b
fix: login redirection 2022-06-18 20:02:54 +05:30
Aravinth Manivannan ca8bb56d6c
fix: logout route was being served by wrong handler and tests
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-18 19:53:26 +05:30
Aravinth Manivannan ce5694d56a
fix: create VM form styling
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-18 14:07:04 +05:30
Aravinth Manivannan bdf8f6989f
chore: improve coverage
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-18 13:54:03 +05:30
Aravinth Manivannan 39e54df5ef
feat: create default VM configurations on initialization
ref:
    [1] https://gitea.hostea.org/Hostea/july-mvp/issues/10#issuecomment-639
    [2] https://gitea.hostea.org/Hostea/july-mvp/issues/10#issuecomment-642
    [3] https://gitea.hostea.org/Hostea/july-mvp/issues/10#issuecomment-643
2022-06-18 13:52:52 +05:30
Aravinth Manivannan 99a7533a79
feat: test coverage report generation
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-18 00:07:56 +05:30
Aravinth Manivannan 5c8e36ad9d
fix: add rent field to tests
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-18 00:02:18 +05:30
Aravinth Manivannan 391a3502e7
fix: add rent field to instance config
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-17 23:56:19 +05:30
Aravinth Manivannan 67d657e8fd
feat: change instance configuration display styling 2022-06-17 23:55:30 +05:30
Aravinth Manivannan d15eb7ae3d
feat: add instance view 2022-06-17 23:29:11 +05:30
Aravinth Manivannan 3705c64616
feat: add instance configuration form visible only to admins
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-17 20:33:48 +05:30
Aravinth Manivannan 3be96ed131
feat: docs: support platform configuration 2022-06-17 19:19:23 +05:30
Aravinth Manivannan 328b44e729
feat: support app
ci/woodpecker/push/woodpecker Pipeline was successful Details
Summary
    Support app shows links to user to create new issue on the Hostea
    meta repository(configurable via settings.py) and view open issues.

    (auto)Redirection via dashboard to new issue page on Gitea and issue
    tracker repository is setup. In future, a form will be exposed
    within the dashboard itself to streamline support related workflows.
2022-06-17 18:12:02 +05:30
Aravinth Manivannan d2fc48f399
feat: add support links to secondary nav 2022-06-17 17:27:49 +05:30
Aravinth Manivannan 5a10b06e11
feat & chore: list logged in user in nav & linting 2022-06-17 17:02:39 +05:30
Aravinth Manivannan 64b4437acd
feat: bootstrap dashboard templates and dashboard homepage view
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-17 16:03:13 +05:30
Aravinth Manivannan 1a0ca0117a
feat: init dash app 2022-06-17 16:03:05 +05:30
Aravinth Manivannan 92a50b8a7a
fix: duplicate main tag 2022-06-17 15:37:32 +05:30
Aravinth Manivannan 11b6a25878
feat & fix: redirect to dash and show page title for login and register 2022-06-17 14:40:42 +05:30