Commit Graph

42 Commits (6c31555a5253592dbbaea73e3775cf97f23e71b9)

Author SHA1 Message Date
Aravinth Manivannan a95158f3df
fix: Gite credentials email: fix subject and let user know instance is
ci/woodpecker/push/woodpecker Pipeline was successful Details
being provisioned

fixes: https://gitea.hostea.org/Hostea/dashboard/issues/44
2022-07-09 10:54:45 +05:30
Aravinth Manivannan b12cc044da
fix: Invoice generation must not consider deleted VMs' names for
ci/woodpecker/push/woodpecker Pipeline was successful Details
checking if payment is already fulfilled

DESCRIPTION
    Invoice generation is dependent on instance_name. Deleting a VM
    doesn't delete the corresponding payments record since payment
    receipts should be preserved for accounting purposes.

    But being heavily dependent on instance_name, without taking deleted
    VMs into account produces incorrect behavior under certain
    circumstances: if a VM named 'foo' is paid for and is deleted before
    its billing cycle is competed and a new VM is created with the same
    name, either by the same user or a different user, invoice won't be
    generated for the new VM since a payment record already exists for
    that billing cycle for the VM named 'foo'.

    Marking deleted VMs' payment records unsuitable for checking if a VM
    is already paid for will result in correct behavior.

fixes: https://gitea.hostea.org/Hostea/dashboard/issues/38
2022-07-08 22:28:39 +05:30
Loïc Dachary 6e84746a2c
git config before push
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-07-08 15:47:53 +02:00
Loïc Dachary 8d02fe107f
always clone the fleet repository
ci/woodpecker/pr/woodpecker Pipeline failed Details
It is small and not worth the trouble of dealing with fetch/pull

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-07-07 10:05:18 +02:00
Aravinth Manivannan 9303ea59ed fix: s/EMAIL_SENDER_ADDRESS/DEFAULT_FROM_EMAIL/
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-07-04 12:42:02 -04:00
Aravinth Manivannan eb68b1e984 feat: Gitea root creds email with nicer content 2022-07-04 12:42:02 -04:00
Aravinth Manivannan 5e5ce02759 feat: instance created notification email template with nicer body 2022-07-04 12:42:02 -04:00
Loïc Dachary 7c045b12d5
Revert "enough hoste delete is not idempotent"
ci/woodpecker/pr/woodpecker Pipeline failed Details
Fixes: #18

This reverts commit ccec1262f0.
2022-07-03 14:58:27 +02:00
Loïc Dachary eefa2120a9
enough host delete is not idempotent
ci/woodpecker/pr/woodpecker Pipeline failed Details
pretend it is until
https://lab.enough.community/main/infrastructure/-/issues/359 is resolved
2022-07-02 16:43:51 +02:00
Aravinth Manivannan e5ebdc29ce
feat: CI: replace fleet repo remote URI with remote URI template
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-07-01 19:57:22 +05:30
Aravinth Manivannan f86dd2ff37
feat: delete_vm takes only one parameter 2022-07-01 19:54:20 +05:30
Aravinth Manivannan 8fc20d16be
feat: ues separate fleet repo for each unit test 2022-07-01 19:54:15 +05:30
Aravinth Manivannan 8be1e02a21
feat: load footer ctx in all templates
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-06-30 14:37:49 +05:30
Aravinth Manivannan 9d89bc071c
fet: show Gitea and woodpecker URIs in view instance page 2022-06-30 13:05:57 +05:30
Aravinth Manivannan f00746a36d
feat: notify user on instance creation
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-06-30 01:10:55 +05:30
Aravinth Manivannan 53ec0a3982
fix: woodpecker and gitea construction typo
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-06-30 01:08:22 +05:30
Aravinth Manivannan fc5a23e60a
feat: configurable VM base domain and customer Gitea and Woodpecker URI generators
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
SUMMARY

    The hostnames are partially generated by the Dashboard and
    enough.community.

    The stuff between angle brackets(`<>`) are substituted and filled-in
    by the Dashboard and the stuff between parenthesis(`{}`) are
    substituted and filled-in by enough.

URI FORMAT

    Gitea URI
	<vm-name>.{{ domain }}

    Woodpecker URI
	<vm-name>-ci.{{ domain }}

    Where domain is agreed to be equal to HOSTEA_DOMAIN

fixes: https://gitea.hostea.org/Hostea/dashboard/issues/11
2022-06-29 11:05:33 +05:30
Aravinth Manivannan e4c418b45b
feat: show Gitea admin's login credentials and send creds via email to admin
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-29 00:49:58 +05:30
Aravinth Manivannan b123bfa582
feat: grab commit ID after add_vm execution
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-29 00:27:47 +05:30
Aravinth Manivannan 5ec87c83ec
feat: redirect user after successful payments for VM creation 2022-06-29 00:22:49 +05:30
Aravinth Manivannan e63719764a
fix: idempotency: change configuration in fleet repository too, when vm
ci/woodpecker/push/woodpecker Pipeline was successful Details
create is re-run for the same VM with different configuration

fixes: https://gitea.hostea.org/Hostea/dashboard/issues/8
2022-06-28 23:57:02 +05:30
Aravinth Manivannan 49ae2189d4
feat & fix: make vm create/rm commands idempotent
SUMMARY
    Commands are now tolerant to being invoked twice.

    Command: vm create
	Doesn't fail if VM of same name exists with the same
	configuration

	Doesn't fail if VM of the same name and different configuration
	exist. Updates configuration and deploys(pushes to Hostea/fleet
	repository) new configuration.

    Command: vm delete
	Doesn't fail if VM of given name doesn't exist
2022-06-28 20:54:21 +05:30
Aravinth Manivannan 8baefeb413
fix: don't save Gitea admin passwords in DB 2022-06-28 20:53:56 +05:30
Aravinth Manivannan e4a7310c79
feat & fix: don't append enough commands to hostscript and fix service.yml path
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-28 14:47:21 +05:30
Loïc Dachary 1eaa22b330
gitea runs on port 22, ssh on port 2222
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-06-28 10:50:17 +02:00
Aravinth Manivannan 947479fc31
fix: enough remove command was hardcoded; fixed with customizable param
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-28 13:49:43 +05:30
Aravinth Manivannan f68d051432
fix: provision.yml template error
ci/woodpecker/push/woodpecker Pipeline failed Details
ref: https://gitea.hostea.org/Hostea/dashboard/issues/9
2022-06-28 13:37:02 +05:30
Aravinth Manivannan caadd0783a
fix: hostscript path
ci/woodpecker/push/woodpecker Pipeline failed Details
fixes: https://gitea.hostea.org/Hostea/dashboard/issues/7
2022-06-28 12:00:47 +05:30
Aravinth Manivannan 71d4f793ba
feat: docs: vm management commands
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-28 01:31:42 +05:30
Aravinth Manivannan 927c2a7703
feat: vm delete management command
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-28 01:24:43 +05:30
Aravinth Manivannan 0606c4ade0
feat: vm create management command 2022-06-28 00:57:25 +05:30
Aravinth Manivannan d84021915f
fix: typo 2022-06-28 00:56:34 +05:30
Aravinth Manivannan 026a1a4c12
chore: refactor infrastructure/views.py; move VM creation to utility fn 2022-06-27 20:59:24 +05:30
Aravinth Manivannan 3318ca8da2
feat: infrastructure tests: check if commits are pushed to remote
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-27 04:53:52 +05:30
Aravinth Manivannan 8997d0ff0f
chore: cleanup config override in infrastructure/tests.py
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-27 04:37:56 +05:30
Aravinth Manivannan 26b7ea3ef2
fix & rm: create/rm hostscripts, rm HOSTEA_DOMAIN
ci/woodpecker/push/woodpecker Pipeline failed Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-06-25 18:24:52 +05:30
Aravinth Manivannan 871a05ddd3
feat: payment check before creation and save gitea passwd in DB
ci/woodpecker/push/woodpecker Pipeline failed Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-06-25 18:03:04 +05:30
Aravinth Manivannan beb4b29c49
feat: pass template configuration, map VM sizes, generate secrets
return gitea passwd, git pull before writing and push after add/rm
2022-06-25 18:02:03 +05:30
Aravinth Manivannan 94aad8e6ea
fix: templates: load user credentials and pass dynamic configuration.
Also escape curly braces
2022-06-25 18:00:13 +05:30
Aravinth Manivannan f3324579c9
feat: utilities to add and remove VM on the Hostea repo 2022-06-24 20:35:32 +05:30
Aravinth Manivannan 1a234d402f
feat: init templates from enough docs[0]
[0]: https://enough-community.readthedocs.io/en/latest/services/hostea.html
2022-06-24 20:35:00 +05:30
Aravinth Manivannan ff8a21d9dc
feat: bootstrap infrastructure app with create_instance delete_instance
views
2022-06-24 20:34:11 +05:30