-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: support whitelabel #733
base: master
Are you sure you want to change the base?
Conversation
…-monorepo into feat-whitelabel
@@ -3,7 +3,7 @@ | |||
<head> | |||
<meta charset="UTF-8" /> | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |||
<title>Snapshot</title> | |||
<title></title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should still keep Snapshot here by default. (can be changed later) At least for some of the crawlers
server: { | ||
host: '127.0.0.1' | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's responding on both localhost and 127.0.0.1
Last minute update in the test env var, network id has been removed, now it's just |
Any reason for that? Would that work with SX spaces too? |
Before it was working with sx, but with this change, not anymore. Will bring that back if we add support for sx, but for now, it's simpler, and we only support offchain since we're resolving domain name with the hub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried all the ways and it works well! tACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tAck
Didn't get around to testing it today, will review it tomorrow. |
Summary
Closes: https://github.com/snapshot-labs/workflow/issues/142
This PR shows a special version of the website (white label version*), when accessed through a valid custom domain).
A white label is a stripped down version of the main website, with all Snapshot branding removed, with the site appearing like something owned by the DAO. No inside links to snapshot should remain, everything on the website should only concern the DAO.
A custom domain is a domain name (e.g.
vote.balancer.fi
) associated to a space id (balancer.eth
), saved and served through a list managed by ourself. Currently, we used the hub, through theSpace
object to fetch a space, given a domain, so this feature is offchain spaces only.Main features
/network:id
prefix for space routes)space
key in most of the routes nested underspace-
, as this key will be inherited automatically when nested and when needed. Skipping this hardcoding allow routes to be compatible with white label routes, which do not have this paramsChanges summary
useWhiteLabel
composableHow to test
White label domain<->spaceID mapping list can be overridden locally by using the custom env variable
VITE_WHITE_LABEL_MAPPING
, formatted likeDOMAIN;SPACEID
(e.g.VITE_WHITE_LABEL_MAPPING='vote.balancer.fi:balancer.eth'
)With
VITE_WHITE_LABEL_MAPPING='127.0.0.1;balancer.eth'
, http://localhost:8080 will serve the snapshot website, whereas http://127.0.0.1:8080 will serve the balancer.eth white label versionTesting a custom domain associated to a space
VITE_WHITE_LABEL_MAPPING='127.0.0.1;balancer.eth yarn dev
To test the splash screen, add a delay
Loading http://127.0.0.1:8080 will now show the splash screen for 1s (emulating the delay for resolving the custom domain from the hub)
Testing a custom domain not associated to a space
yarn dev
Testing a custom domain not being able to resolve
yarn dev
To-Do
xxx/xxx
)fetchSpace