Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Adding a toggleable additional Gitea external mirror #2071

Draft
wants to merge 48 commits into
base: develop
Choose a base branch
from

Conversation

craddm
Copy link
Contributor

@craddm craddm commented Aug 1, 2024

✅ Checklist

  • You have given your pull request a meaningful title (e.g. Enable foobar integration rather than 515 foobar).
  • You are targeting the appropriate branch. If you're not certain which one this is, it should be develop.
  • Your branch is up-to-date with the target branch (it probably was when you started, but it may have changed since then).

🚦 Depends on

⤴️ Summary

Adds an optionally deployable second Gitea instance intended for use as an external mirror that can then be accessed via the internal Gitea instance.

🌂 Related issues

Relates to milestone for release 5.1.0 an all Gitea issues e.g. #1998

🔬 Tests

Ongoing

@craddm craddm added the enhancement New functionality that should be added to the Safe Haven label Aug 1, 2024
@craddm craddm added this to the Release 5.1.0 milestone Aug 1, 2024
@craddm craddm self-assigned this Aug 1, 2024
Comment on lines 64 to 65
class SREGiteaExternalServerComponent(ComponentResource):
"""Deploy Gitea server with Pulumi"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of overlap between this and the SREGiteaServerComponent. Can we combine both into a single reusable component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's what I'm actually doing, I just haven't pushed yet

Comment on lines 99 to 102
if props.gitea_servers == GiteaServers.BOTH:
gitea_servers = ["external", "internal"]
else:
gitea_servers = ["internal"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if props.gitea_servers == GiteaServers.BOTH:
gitea_servers = ["external", "internal"]
else:
gitea_servers = ["internal"]
gitea_servers = ["external", "internal"] if (props.gitea_servers == GiteaServers.BOTH) else ["internal"]

not sure this is clearer though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also switching to using a boolean True/False for deploying the external mirror anyway, as we'd (presumably) always want the internal one anyway

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like I should stop commenting on your WIP PR 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already some good points to nip some things in the bud 😆

Comment on lines +114 to +118
ldap_server_hostname=props.ldap_server_hostname,
ldap_server_port=props.ldap_server_port,
ldap_username_attribute=props.ldap_username_attribute,
ldap_user_filter=props.ldap_user_filter,
ldap_user_search_base=props.ldap_user_search_base,
Copy link
Member

@jemrobinson jemrobinson Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't want don't need the external server to plug in to our LDAP directory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes on Gitea configuration here

@jemrobinson
Copy link
Member

One other thing to consider - you'll probably want the external mirror deployed into its own subnet so that we can set the networking rules accordingly (external one will be allowed internet access but no access from workspaces; internal one will have no internet access but access allowed from workspaces).

@jemrobinson jemrobinson changed the base branch from develop-v5.1.0 to develop September 2, 2024 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality that should be added to the Safe Haven
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants