-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow for providing an alternative domain for the proxy
Have the service report back the proxyURL for each project, rather than being embedded inside the frontend bundle. Concequence is duplicating some data but very minor and allows for us to serve different projects from different proxies in the future. Removed unused vite env var, added method to pull service's current path and substitute in the http proxy port. Works for local dev, should maintain current behaviour. Custom domain can be applied via optional config. New config value added to the config schema. Config schema documentation has been regenerated (including some other absent items).
- Loading branch information
1 parent
0d63842
commit 083572c
Showing
10 changed files
with
240 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
VITE_API_URI=http://localhost:8080 | ||
VITE_SERVER_URI=http://localhost:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ | |
} | ||
] | ||
}, | ||
"domains": {}, | ||
"privateOrganizations": [], | ||
"urlShortener": "", | ||
"contactEmail": "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { GIT_PROXY_SERVER_PORT: PROXY_HTTP_PORT, GIT_PROXY_UI_PORT: UI_PORT } = | ||
require('../config/env').Vars; | ||
const config = require('../config'); | ||
|
||
module.exports = { | ||
getProxyURL: (req) => { | ||
const defaultURL = `${req.protocol}://${req.headers.host}`.replace( | ||
`:${UI_PORT}`, | ||
`:${PROXY_HTTP_PORT}`, | ||
); | ||
return config.getDomains().proxy ?? defaultURL; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.