Backend integration #1
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "wip-enough"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Structure
@dachary: When you have the time, please review
infrastructure.utils.Infra
and the templates ininfrastructure/templates/infrasture
Backend integrationto WIP: Backend integrationThe CI failure is expected, I have to setup a Gitea service within the CI to properly run tests. Will implement tomorrow.
@ -0,0 +1,2 @@
enough --domain d.hostea.org host create {{subdomain}}-host
d.hostea.org is correct but it should be set to d.$HOSTEA_DOMAIN (when HOSTEA_DOMAIN should be made available at installation time in the settings file created by the playbook).
@ -0,0 +5,4 @@
# Public hostname of the Gitea instance
#
#
gitea_host: "gitea.{{ domain }}"
Note: Enough will replace this {{ domain }} with the actual value, the dashboard does not need to do it. But the gitea. must be replaced by subdomain which is presumably the name asssigned to the instance by the dashboard.
@ -0,0 +12,4 @@
# Mailer from
#
#
gitea_mailer_from: "noreply@enough.community"
This must be replaced with noreply@{{ domain }}. It is set to enough.community to facilitate tests because the SMTP relay is very picky about non-existent domain names.
@ -0,0 +38,4 @@
#
# Admin user password
#
#gitea_password: etquofEtseudett
This must be set by the dashboard to a password that is then communicated to the user so they can login.
@ -0,0 +44,4 @@
#
# Admin user email
#
gitea_email: contact@enough.community
This must be set to the email of the user so they can receive notifications.
@ -0,0 +50,4 @@
#
# Unique hostname of the woodpecker server relative to {{ domain }}
#
woodpecker_hostname: "woodpecker"
This should probably be derived from the subdomain, like subdomainci?
can we do sub-subdomain? If the user's Gitea is available at mygitea.hostea.org, then the CI at
woodpecker.mygitea.hostea.org
?I'd rather not try my luck with this 😓 But it would be prettier.
Acknowledged, post-MVP goal then :)
@ -0,0 +68,4 @@
#
# Woodpecker shared agent secret `openssl rand -hex 32`
#
#woodpecker_agent_secret: c2cd326f7104c2ca93e6d22da0b28d1e33b4aeaa071c08945e0ade576b3192ce
This must be set by the dashboard but the user does not need to know about it.
Thanks for the quick and comprehensive view! I'll implement the changes you've suggested.
@ -15,2 +15,4 @@
django-phonenumber-field==6.3.0
djangorestframework==3.13.1
gitdb==4.0.9
GitPython==3.1.27
I tend to prefer using http://amoffat.github.io/sh/ like so👍
because (i) I know the git CLI and learning the python modules API has no appeal (ii) they struggle to catch up with what git does.
My 2cts ;-)
Cool library, thanks for the suggestion. Works perfectly for our use case, I'll switch in a bit.
PLease see here for create a new VM with
subdomain=add_vm
commit.woodpecker_agent_secret
is dynamically generatedd.$HOSTA_DOMAIN
in hostscript is configurable via settings.pygitea_password
is generated and returned to usergitea_email
is set to user's emailAlso, support for
dashboard/local_settings.py
is implemented.This PR doesn't implement tests, I'll implement them tomorrow. If in hurry, please feel free to merge this PR.
@dachary: the current version of
Infra.add_vm
method isn't idempotent, running it twice will create two commits aswoodpecker_agent_secret
andgitea_password will be overwritten. In such cases, will enough update the already created instance's
woodpecker_agent_secretand
gitea_password`?I'll implement checks tomorrow to ensure that things aren't being overwritten
WIP: Backend integrationto Backend integration