-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Custom domains improvements #2203
Comments
Yes! Bye bye |
Well, that would not even be necessary. It also hosts categories, verified spaces, skins,... But yea I'm definitely for moving that stuff over to the UI repo and get rid of the submodule. I don't see any benefits in having it. |
I share your view and admittedly it's a small but a pain point as we got much incoming from users who activated their domain but lead to the homepage of snapshot rather than their space destination. #2205 @mktcode At present the domain field in the settings seems serve little purpose besides all work done in the domain.json and DNS config.
On UX side: No longer need an activation and manually whitelist It will definitely worth the effort! |
That make lot of sense, we can do this |
TODO: Hub:
UI:
|
Hey @mktcode, @bonustrack, shall we proceed with this implementation? |
I could work on this again early next month I think but anyone shall feel free. I'm currently just keeping the hub PR branch in sync with master. |
Currently we need to update the snapshot-spaces submodule whenever we want to add a new custom domain, leading to a PR for that submodule repo and then the UI repo.
I think this list of domains should be considered configuration and not code and therefore does not necessarily belong in a repository.
We already store the custom domains in the space settings in the DB. The json file is redundant and only exists as a simple solution to a problem that could be solved more elegantly (hopefully).
CNAME=cname.snapshot.org
) and now need a way to update/inform 657 spaces.I would like to suggest a solution that solves all of this, while also improving the UX by removing the need for manually updating a whitelist. I want to put some effort into this because I think the custom domain feature (after expressing some criticism :P) is actually a critical and important feature, not just a "nice to have". In combination with skins it's a first, easy to implement level of customization for DAOs to make themselves and their community feel more "at home". (The second level of customization would be re-usable UI components plus snapshot.js for completely custom integrations.) I would like this to be as simple and automated as possible, especially when we're not talking about 6k spaces anymore but a million.
To avoid accessing json fields in DB queries I would like to move the domain to it's own column, so we can do fast lookups. For the (currently) 657 spaces with a custom domain, this migration can easily be done by a script, accompanied by a few changes in the hub/graphql api. This would require some work but the changes are rather trivial and the domain field in the settings json is (as far as I can tell) not used at all anyway.
To prevent spaces from squatting a domain they don't own, by adding it in their space settings, blocking it for anyone else, we can check the CNAME record first and allow only domains that already point to
cname.snapshot.org
. (If this can also be a wildcard domain, spaces could be required to use<spaceid>.cname.snapshot.org
.) This can easily done with node.js in the hub. A legitimate space would configure the domain, update the space settings and that's it.By providing the CNAME check as an endpoint in the hub, the UI can give early feedback on the settings page and show an info box for admins, on all existing custom domains that have not yet updated their CNAME record.
With this setup we would not need to whitelist domains anymore and we can safely let spaces configure their domain DNS and update the settings and that's it. Less work for everyone and it's not even that much work required to implement it. In a week from now it could all be done, especially because I already did some work to find some unknowns. Given the long-term benefit I think that's more than reasonable.
The text was updated successfully, but these errors were encountered: