Skip to content

Commit a71dfbc

Browse files
authored
Added redirect to specific domain caprover#314 (caprover#1744)
1 parent 1251c42 commit a71dfbc

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

src/datastore/AppsDataStore.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ class AppsDataStore {
615615
repoInfo: RepoInfo,
616616
authenticator: Authenticator,
617617
customNginxConfig: string,
618+
redirectDomain: string,
618619
preDeployFunction: string,
619620
serviceUpdateOverride: string,
620621
websocketSupport: boolean,
@@ -689,6 +690,7 @@ class AppsDataStore {
689690
appObj.websocketSupport = !!websocketSupport
690691
appObj.nodeId = nodeId
691692
appObj.customNginxConfig = customNginxConfig
693+
appObj.redirectDomain = redirectDomain
692694
appObj.preDeployFunction = preDeployFunction
693695
appObj.serviceUpdateOverride = serviceUpdateOverride
694696
appObj.description = description
@@ -887,6 +889,7 @@ class AppsDataStore {
887889
notExposeAsWebApp: false,
888890
customDomain: [],
889891
hasDefaultSubDomainSsl: false,
892+
redirectDomain: '',
890893
forceSsl: false,
891894
websocketSupport: false,
892895
}

src/models/AppDefinition.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ interface IAppDefinitionBase {
6767
preDeployFunction?: string
6868
serviceUpdateOverride?: string
6969
customNginxConfig?: string
70+
redirectDomain?: string
7071
networks: string[]
7172
customDomain: IAppCustomDomain[]
7273
tags?: IAppTag[]

src/routes/user/apps/appdefinition/AppDefinitionRouter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ router.post('/update/', function (req, res, next) {
327327
const volumes = req.body.volumes || []
328328
const ports = req.body.ports || []
329329
const instanceCount = req.body.instanceCount || '0'
330+
const redirectDomain = req.body.redirectDomain || ''
330331
const preDeployFunction = req.body.preDeployFunction || ''
331332
const serviceUpdateOverride = req.body.serviceUpdateOverride || ''
332333
const containerHttpPort = Number(req.body.containerHttpPort) || 80
@@ -399,6 +400,7 @@ router.post('/update/', function (req, res, next) {
399400
ports,
400401
repoInfo,
401402
customNginxConfig,
403+
redirectDomain,
402404
preDeployFunction,
403405
serviceUpdateOverride,
404406
websocketSupport,

src/user/ServiceManager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ class ServiceManager {
652652
ports: IAppPort[],
653653
repoInfo: RepoInfo,
654654
customNginxConfig: string,
655+
redirectDomain: string,
655656
preDeployFunction: string,
656657
serviceUpdateOverride: string,
657658
websocketSupport: boolean,
@@ -773,6 +774,7 @@ class ServiceManager {
773774
repoInfo,
774775
self.authenticator,
775776
customNginxConfig,
777+
redirectDomain,
776778
preDeployFunction,
777779
serviceUpdateOverride,
778780
websocketSupport,

src/utils/MigrateCaptainDuckDuck.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export default class MigrateCaptainDuckDuck {
337337
repoInfo,
338338
self.authenticator,
339339
app.customNginxConfig,
340+
'',
340341
app.preDeployFunction,
341342
'',
342343
false,

0 commit comments

Comments
 (0)