Skip to content

Commit 471730d

Browse files
committed
[server config] Introduce isDedicatedInstallation, and use it to replace isSIngleOrgInstallation
incl. further cleanup around getConfiguration and server config
1 parent bb65be7 commit 471730d

File tree

9 files changed

+14
-29
lines changed

9 files changed

+14
-29
lines changed

components/gitpod-protocol/go/gitpod-service.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,8 +1878,7 @@ type VSCodeConfig struct {
18781878

18791879
// Configuration is the Configuration message type
18801880
type Configuration struct {
1881-
DaysBeforeGarbageCollection float64 `json:"daysBeforeGarbageCollection,omitempty"`
1882-
GarbageCollectionStartDate float64 `json:"garbageCollectionStartDate,omitempty"`
1881+
IsDedicatedInstallation bool `json:"isDedicatedInstallation,omitempty"`
18831882
}
18841883

18851884
// EnvVar is the EnvVar message type

components/gitpod-protocol/src/protocol.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,9 +1456,7 @@ export namespace AuthProviderEntry {
14561456
}
14571457

14581458
export interface Configuration {
1459-
readonly daysBeforeGarbageCollection: number;
1460-
readonly garbageCollectionStartDate: number;
1461-
readonly isSingleOrgInstallation: boolean;
1459+
readonly isDedicatedInstallation: boolean;
14621460
}
14631461

14641462
export interface StripeConfig {

components/server/src/auth/verification-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class VerificationService {
110110
) {
111111
if (this.config.twilioConfig) {
112112
this.verifyService = new TwilioVerificationEndpoint(this.config);
113-
} else if (this.config.devBranch && !this.config.isSingleOrgInstallation) {
113+
} else if (this.config.devBranch && !this.config.isDedicatedInstallation) {
114114
// preview environments get the mock verification endpoint
115115
this.verifyService = new MockVerificationEndpoint();
116116
}

components/server/src/config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ export interface ConfigSerialized {
157157
passlist: string[];
158158
};
159159

160-
showSetupModal: boolean;
161-
162160
admin: {
163161
credentialsPath: string;
164162
};
@@ -274,7 +272,8 @@ export interface ConfigSerialized {
274272
address: string;
275273
};
276274

277-
isSingleOrgInstallation: boolean;
275+
/** true if this is a Dedicated */
276+
isDedicatedInstallation: boolean;
278277
}
279278

280279
export interface CookieConfig {

components/server/src/workspace/gitpod-server-impl.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
517517

518518
public async getConfiguration(ctx: TraceContext): Promise<Configuration> {
519519
return {
520-
garbageCollectionStartDate: this.config.workspaceGarbageCollection.startDate,
521-
daysBeforeGarbageCollection: this.config.workspaceGarbageCollection.minAgeDays,
522-
isSingleOrgInstallation: this.config.isSingleOrgInstallation,
520+
isDedicatedInstallation: this.config.isDedicatedInstallation,
523521
};
524522
}
525523

dev/preview/workflow/preview/deploy-gitpod.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ fi
273273
#
274274
if [[ "${GITPOD_WITH_DEDICATED_EMU}" == "true" ]]
275275
then
276-
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.server.isSingleOrgInstallation "true"
276+
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.server.isDedicatedInstallation "true"
277277
fi
278278

279279
#

install/installer/pkg/components/server/configmap.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,10 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
172172
return nil
173173
})
174174

175-
showSetupModal := true // old default to make self-hosted continue to work!
176-
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
177-
if cfg.WebApp != nil && cfg.WebApp.Server != nil && cfg.WebApp.Server.ShowSetupModal != nil {
178-
showSetupModal = *cfg.WebApp.Server.ShowSetupModal
179-
}
180-
return nil
181-
})
182-
183-
var isSingleOrgInstallation bool
175+
var isDedicatedInstallation bool
184176
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
185177
if cfg.WebApp != nil && cfg.WebApp.Server != nil {
186-
isSingleOrgInstallation = cfg.WebApp.Server.IsSingleOrgInstallation
178+
isDedicatedInstallation = cfg.WebApp.Server.IsDedicatedInstallation || cfg.WebApp.Server.IsSingleOrgInstallation
187179
}
188180
return nil
189181
})
@@ -296,10 +288,9 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
296288
Admin: AdminConfig{
297289
CredentialsPath: adminCredentialsPath,
298290
},
299-
ShowSetupModal: showSetupModal,
300291
Auth: authCfg,
301292
Redis: redisConfig,
302-
IsSingleOrgInstallation: isSingleOrgInstallation,
293+
IsDedicatedInstallation: isDedicatedInstallation,
303294
}
304295

305296
fc, err := common.ToJSONString(scfg)

install/installer/pkg/components/server/types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ type ConfigSerialized struct {
3939
EnablePayment bool `json:"enablePayment"`
4040
LinkedInSecretsFile string `json:"linkedInSecretsFile"`
4141
PATSigningKeyFile string `json:"patSigningKeyFile"`
42-
ShowSetupModal bool `json:"showSetupModal"`
4342
Auth auth.Config `json:"auth"`
44-
IsSingleOrgInstallation bool `json:"isSingleOrgInstallation"`
43+
IsDedicatedInstallation bool `json:"isDedicatedInstallation"`
4544

4645
WorkspaceHeartbeat WorkspaceHeartbeat `json:"workspaceHeartbeat"`
4746
WorkspaceDefaults WorkspaceDefaults `json:"workspaceDefaults"`

install/installer/pkg/config/v1/experimental/experimental.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,9 @@ type ServerConfig struct {
269269
DisableWorkspaceGarbageCollection bool `json:"disableWorkspaceGarbageCollection"`
270270
DisableCompleteSnapshotJob bool `json:"disableCompleteSnapshotJob"`
271271
InactivityPeriodForReposInDays *int `json:"inactivityPeriodForReposInDays"`
272-
ShowSetupModal *bool `json:"showSetupModal"`
273-
IsSingleOrgInstallation bool `json:"isSingleOrgInstallation"`
272+
// deprecated: use IsDedicatedInstallation instead
273+
IsSingleOrgInstallation bool `json:"isSingleOrgInstallation"`
274+
IsDedicatedInstallation bool `json:"isDedicatedInstallation"`
274275

275276
// @deprecated use containerRegistry.privateBaseImageAllowList instead
276277
DefaultBaseImageRegistryWhiteList []string `json:"defaultBaseImageRegistryWhitelist"`

0 commit comments

Comments
 (0)