Skip to content

Commit 1c75ffb

Browse files
JanKoehnleinroboquat
authored andcommitted
[server] removed unused branding from config
1 parent 4bdcf8c commit 1c75ffb

File tree

13 files changed

+8
-284
lines changed

13 files changed

+8
-284
lines changed

chart/templates/server-configmap.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ data:
4040
"enableLocalApp": {{ $comp.enableLocalApp }},
4141
"authProviderConfigs": {{ .Values.authProviders | toJson }},
4242
"disableDynamicAuthProviderLogin": {{ $comp.disableDynamicAuthProviderLogin }},
43-
"brandingConfig": {{ .Values.branding | toJson }},
4443
"maxEnvvarPerUserCount": {{ $comp.maxEnvvarPerUserCount }},
4544
"maxConcurrentPrebuildsPerRef": {{ $comp.maxConcurrentPrebuildsPerRef }},
4645
"incrementalPrebuilds": {{ $comp.incrementalPrebuilds | toJson }},

chart/values.yaml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -97,40 +97,6 @@ authProviders: []
9797
# settingsUrl: "https://gitlab.com/-/profile/applications"
9898
# description: ""
9999
# icon: ""
100-
branding:
101-
logo: /images/gitpod-ddd.svg
102-
homepage: https://www.gitpod.io/
103-
links:
104-
header:
105-
- name: Workspaces
106-
url: /workspaces/
107-
- name: Docs
108-
url: https://www.gitpod.io/docs/
109-
- name: Blog
110-
url: https://www.gitpod.io/blog/
111-
- name: Community
112-
url: https://community.gitpod.io/
113-
footer:
114-
- name: Docs
115-
url: https://www.gitpod.io/docs/
116-
- name: Blog
117-
url: https://www.gitpod.io/blog/
118-
- name: Status
119-
url: https://status.gitpod.io/
120-
social:
121-
- type: GitHub
122-
url: https://github.com/gitpod-io/gitpod
123-
- type: Discourse
124-
url: https://community.gitpod.io/
125-
- type: Twitter
126-
url: https://twitter.com/gitpod
127-
legal:
128-
- name: Imprint
129-
url: https://www.gitpod.io/imprint/
130-
- name: Privacy Policy
131-
url: https://www.gitpod.io/privacy/
132-
- name: Terms of Service
133-
url: https://www.gitpod.io/terms/
134100
workspaceScheduler: workspace-scheduler
135101

136102
components:

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

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ type APIInterface interface {
3131
GetOwnAuthProviders(ctx context.Context) (res []*AuthProviderEntry, err error)
3232
UpdateOwnAuthProvider(ctx context.Context, params *UpdateOwnAuthProviderParams) (err error)
3333
DeleteOwnAuthProvider(ctx context.Context, params *DeleteOwnAuthProviderParams) (err error)
34-
GetBranding(ctx context.Context) (res *Branding, err error)
3534
GetConfiguration(ctx context.Context) (res *Configuration, err error)
3635
GetGitpodTokenScopes(ctx context.Context, tokenHash string) (res []string, err error)
3736
GetToken(ctx context.Context, query *GetTokenSearchOptions) (res *Token, err error)
@@ -105,8 +104,6 @@ const (
105104
FunctionUpdateOwnAuthProvider FunctionName = "updateOwnAuthProvider"
106105
// FunctionDeleteOwnAuthProvider is the name of the deleteOwnAuthProvider function
107106
FunctionDeleteOwnAuthProvider FunctionName = "deleteOwnAuthProvider"
108-
// FunctionGetBranding is the name of the getBranding function
109-
FunctionGetBranding FunctionName = "getBranding"
110107
// FunctionGetConfiguration is the name of the getConfiguration function
111108
FunctionGetConfiguration FunctionName = "getConfiguration"
112109
// FunctionGetGitpodTokenScopes is the name of the GetGitpodTokenScopes function
@@ -480,24 +477,6 @@ func (gp *APIoverJSONRPC) DeleteOwnAuthProvider(ctx context.Context, params *Del
480477
return
481478
}
482479

483-
// GetBranding calls getBranding on the server
484-
func (gp *APIoverJSONRPC) GetBranding(ctx context.Context) (res *Branding, err error) {
485-
if gp == nil {
486-
err = errNotConnected
487-
return
488-
}
489-
var _params []interface{}
490-
491-
var result Branding
492-
err = gp.C.Call(ctx, "getBranding", _params, &result)
493-
if err != nil {
494-
return
495-
}
496-
res = &result
497-
498-
return
499-
}
500-
501480
// GetConfiguration calls getConfiguration on the server
502481
func (gp *APIoverJSONRPC) GetConfiguration(ctx context.Context) (res *Configuration, err error) {
503482
if gp == nil {
@@ -1961,7 +1940,7 @@ type GenerateNewGitpodTokenOptions struct {
19611940
type TakeSnapshotOptions struct {
19621941
LayoutData string `json:"layoutData,omitempty"`
19631942
WorkspaceID string `json:"workspaceId,omitempty"`
1964-
DontWait bool `json:"dontWait",omitempty`
1943+
DontWait bool `json:"dontWait,omitempty"`
19651944
}
19661945

19671946
// PreparePluginUploadParams is the PreparePluginUploadParams message type
@@ -2051,49 +2030,6 @@ type RemoteTrackMessage struct {
20512030
Properties interface{} `json:"properties,omitempty"`
20522031
}
20532032

2054-
// BrandingLink is the BrandingLink message type
2055-
type BrandingLink struct {
2056-
Name string `json:"name,omitempty"`
2057-
URL string `json:"url,omitempty"`
2058-
}
2059-
2060-
// BrandingSocialLink is the BrandingSocialLink message type
2061-
type BrandingSocialLink struct {
2062-
Type string `json:"type,omitempty"`
2063-
URL string `json:"url,omitempty"`
2064-
}
2065-
2066-
// Ide is the Ide message type
2067-
type Ide struct {
2068-
HelpMenu []*BrandingLink `json:"helpMenu,omitempty"`
2069-
Logo string `json:"logo,omitempty"`
2070-
ShowReleaseNotes bool `json:"showReleaseNotes,omitempty"`
2071-
}
2072-
2073-
// Links is the Links message type
2074-
type Links struct {
2075-
Footer []*BrandingLink `json:"footer,omitempty"`
2076-
Header []*BrandingLink `json:"header,omitempty"`
2077-
Legal []*BrandingLink `json:"legal,omitempty"`
2078-
Social []*BrandingSocialLink `json:"social,omitempty"`
2079-
}
2080-
2081-
// Branding is the Branding message type
2082-
type Branding struct {
2083-
Favicon string `json:"favicon,omitempty"`
2084-
Homepage string `json:"homepage,omitempty"`
2085-
Ide *Ide `json:"ide,omitempty"`
2086-
Links *Links `json:"links,omitempty"`
2087-
2088-
// Either including domain OR absolute path (interpreted relative to host URL)
2089-
Logo string `json:"logo,omitempty"`
2090-
Name string `json:"name,omitempty"`
2091-
RedirectURLAfterLogout string `json:"redirectUrlAfterLogout,omitempty"`
2092-
RedirectURLIfNotAuthenticated string `json:"redirectUrlIfNotAuthenticated,omitempty"`
2093-
ShowProductivityTips bool `json:"showProductivityTips,omitempty"`
2094-
StartupLogo string `json:"startupLogo,omitempty"`
2095-
}
2096-
20972033
// WorkspaceInstanceUser is the WorkspaceInstanceUser message type
20982034
type WorkspaceInstanceUser struct {
20992035
AvatarURL string `json:"avatarUrl,omitempty"`

components/gitpod-protocol/go/mock.go

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/gitpod-protocol/src/gitpod-service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import {
88
User, WorkspaceInfo, WorkspaceCreationResult, WorkspaceInstanceUser,
9-
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, Branding, CreateWorkspaceMode,
9+
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, CreateWorkspaceMode,
1010
Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, Terms,
1111
ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType,
1212
GitpodToken, AuthProviderEntry, GuessGitTokenScopesParams, GuessedGitTokenScopes
@@ -55,7 +55,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
5555
getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
5656
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
5757
deleteOwnAuthProvider(params: GitpodServer.DeleteOwnAuthProviderParams): Promise<void>;
58-
getBranding(): Promise<Branding>;
5958
getConfiguration(): Promise<Configuration>;
6059
getToken(query: GitpodServer.GetTokenSearchOptions): Promise<Token | undefined>;
6160
getGitpodTokenScopes(tokenHash: string): Promise<string[]>;

components/gitpod-protocol/src/protocol.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,39 +1175,6 @@ export namespace AuthProviderEntry {
11751175
}
11761176
}
11771177

1178-
export interface Branding {
1179-
readonly name: string;
1180-
readonly favicon?: string;
1181-
/** Either including domain OR absolute path (interpreted relative to host URL) */
1182-
readonly logo: string;
1183-
readonly startupLogo: string;
1184-
readonly showProductivityTips: boolean;
1185-
readonly redirectUrlIfNotAuthenticated?: string;
1186-
readonly redirectUrlAfterLogout?: string;
1187-
readonly homepage: string;
1188-
readonly ide?: {
1189-
readonly logo: string;
1190-
readonly showReleaseNotes: boolean;
1191-
readonly helpMenu: Branding.Link[];
1192-
}
1193-
readonly links: {
1194-
readonly header: Branding.Link[];
1195-
readonly footer: Branding.Link[];
1196-
readonly social: Branding.SocialLink[];
1197-
readonly legal: Branding.Link[];
1198-
}
1199-
}
1200-
export namespace Branding {
1201-
export interface Link {
1202-
readonly name: string;
1203-
readonly url: string;
1204-
}
1205-
export interface SocialLink {
1206-
readonly type: string;
1207-
readonly url: string;
1208-
}
1209-
}
1210-
12111178
export interface Configuration {
12121179
readonly daysBeforeGarbageCollection: number;
12131180
readonly garbageCollectionStartDate: number;

components/server/src/auth/rate-limiter.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function getConfig(config: RateLimiterConfig): RateLimiterConfig {
4444
"getOwnAuthProviders": { group: "default", points: 1 },
4545
"updateOwnAuthProvider": { group: "default", points: 1 },
4646
"deleteOwnAuthProvider": { group: "default", points: 1 },
47-
"getBranding": { group: "default", points: 1 },
4847
"getConfiguration": { group: "default", points: 1 },
4948
"getGitpodTokenScopes": { group: "default", points: 1 },
5049
"getToken": { group: "default", points: 1 },

components/server/src/branding-parser.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

components/server/src/config.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { GitpodHostUrl } from '@gitpod/gitpod-protocol/lib/util/gitpod-host-url';
88
import { AuthProviderParams, normalizeAuthProviderParams } from './auth/auth-provider';
99

10-
import { Branding, NamedWorkspaceFeatureFlag } from '@gitpod/gitpod-protocol';
10+
import { NamedWorkspaceFeatureFlag } from '@gitpod/gitpod-protocol';
1111

1212
import { RateLimiterConfig } from './auth/rate-limiter';
1313
import { CodeSyncConfig } from './code-sync/code-sync-service';
@@ -16,7 +16,6 @@ import * as fs from 'fs';
1616
import * as yaml from 'js-yaml';
1717
import { log, LogrusLogLevel } from '@gitpod/gitpod-protocol/lib/util/logging';
1818
import { filePathTelepresenceAware, KubeStage, translateLegacyStagename } from '@gitpod/gitpod-protocol/lib/env';
19-
import { BrandingParser } from './branding-parser';
2019

2120
export const Config = Symbol("Config");
2221
export type Config = Omit<ConfigSerialized, "hostUrl" | "chargebeeProviderOptionsFile"> & {
@@ -91,8 +90,6 @@ export interface ConfigSerialized {
9190
builtinAuthProvidersConfigured: boolean;
9291
disableDynamicAuthProviderLogin: boolean;
9392

94-
brandingConfig: Branding;
95-
9693
/**
9794
* The maximum number of environment variables a user can have configured in their list at any given point in time.
9895
* Note: This limit should be so high that no regular user ever reaches it.
@@ -193,10 +190,6 @@ export namespace ConfigFile {
193190

194191
const builtinAuthProvidersConfigured = authProviderConfigs.length > 0;
195192
const chargebeeProviderOptions = readOptionsFromFile(filePathTelepresenceAware(config.chargebeeProviderOptionsFile || ""));
196-
let brandingConfig = config.brandingConfig;
197-
if (brandingConfig) {
198-
brandingConfig = BrandingParser.normalize(brandingConfig);
199-
}
200193
let license = config.license
201194
const licenseFile = config.licenseFile
202195
if (licenseFile) {
@@ -208,7 +201,6 @@ export namespace ConfigFile {
208201
hostUrl,
209202
authProviderConfigs,
210203
builtinAuthProvidersConfigured,
211-
brandingConfig,
212204
chargebeeProviderOptions,
213205
license,
214206
workspaceGarbageCollection: {

components/server/src/user/user-controller.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,12 @@ export class UserController {
141141
this.ensureSafeReturnToParam(req);
142142
this.authenticator.deauthorize(req, res, next);
143143
});
144-
const branding = this.config.brandingConfig;
145144
router.get("/logout", async (req: express.Request, res: express.Response, next: express.NextFunction) => {
146145
const logContext = LogContext.from({ user: req.user, request: req });
147146
const clientInfo = getRequestingClientInfo(req);
148147
const logPayload = { session: req.session, clientInfo };
149148

150-
let redirectToUrl = this.getSafeReturnToParam(req) || branding.redirectUrlAfterLogout || this.config.hostUrl.toString();
149+
let redirectToUrl = this.getSafeReturnToParam(req) || this.config.hostUrl.toString();
151150

152151
if (req.isAuthenticated()) {
153152
req.logout();
@@ -621,7 +620,7 @@ export class UserController {
621620
return;
622621
}
623622

624-
if (this.urlStartsWith(returnToURL, this.config.hostUrl.toString()) || this.urlStartsWith(returnToURL, this.config.brandingConfig.homepage)) {
623+
if (this.urlStartsWith(returnToURL, this.config.hostUrl.toString()) || this.urlStartsWith(returnToURL, "https://www.gitpod.io")) {
625624
return returnToURL
626625
}
627626

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { DownloadUrlRequest, DownloadUrlResponse, UploadUrlRequest, UploadUrlResponse } from '@gitpod/content-service/lib/blobs_pb';
88
import { AppInstallationDB, UserDB, UserMessageViewsDB, WorkspaceDB, DBWithTracing, TracedWorkspaceDB, DBGitpodToken, DBUser, UserStorageResourcesDB, TeamDB } from '@gitpod/gitpod-db/lib';
9-
import { AuthProviderEntry, AuthProviderInfo, Branding, CommitContext, Configuration, CreateWorkspaceMode, DisposableCollection, GetWorkspaceTimeoutResult, GitpodClient as GitpodApiClient, GitpodServer, GitpodToken, GitpodTokenType, InstallPluginsParams, PermissionName, PortVisibility, PrebuiltWorkspace, PrebuiltWorkspaceContext, PreparePluginUploadParams, ResolvedPlugins, ResolvePluginsParams, SetWorkspaceTimeoutResult, StartPrebuildContext, StartWorkspaceResult, Terms, Token, UninstallPluginParams, User, UserEnvVar, UserEnvVarValue, UserInfo, WhitelistedRepository, Workspace, WorkspaceContext, WorkspaceCreationResult, WorkspaceImageBuild, WorkspaceInfo, WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstanceUser, WorkspaceTimeoutDuration, GuessGitTokenScopesParams, GuessedGitTokenScopes, Team, TeamMemberInfo, TeamMembershipInvite, CreateProjectParams, Project, ProviderRepository, TeamMemberRole, WithDefaultConfig, FindPrebuildsParams, PrebuildWithStatus, StartPrebuildResult, ClientHeaderFields } from '@gitpod/gitpod-protocol';
9+
import { AuthProviderEntry, AuthProviderInfo, CommitContext, Configuration, CreateWorkspaceMode, DisposableCollection, GetWorkspaceTimeoutResult, GitpodClient as GitpodApiClient, GitpodServer, GitpodToken, GitpodTokenType, InstallPluginsParams, PermissionName, PortVisibility, PrebuiltWorkspace, PrebuiltWorkspaceContext, PreparePluginUploadParams, ResolvedPlugins, ResolvePluginsParams, SetWorkspaceTimeoutResult, StartPrebuildContext, StartWorkspaceResult, Terms, Token, UninstallPluginParams, User, UserEnvVar, UserEnvVarValue, UserInfo, WhitelistedRepository, Workspace, WorkspaceContext, WorkspaceCreationResult, WorkspaceImageBuild, WorkspaceInfo, WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstanceUser, WorkspaceTimeoutDuration, GuessGitTokenScopesParams, GuessedGitTokenScopes, Team, TeamMemberInfo, TeamMembershipInvite, CreateProjectParams, Project, ProviderRepository, TeamMemberRole, WithDefaultConfig, FindPrebuildsParams, PrebuildWithStatus, StartPrebuildResult, ClientHeaderFields } from '@gitpod/gitpod-protocol';
1010
import { AccountStatement } from "@gitpod/gitpod-protocol/lib/accounting-protocol";
1111
import { AdminBlockUserRequest, AdminGetListRequest, AdminGetListResult, AdminGetWorkspacesRequest, AdminModifyPermanentWorkspaceFeatureFlagRequest, AdminModifyRoleOrPermissionRequest, WorkspaceAndInstance } from '@gitpod/gitpod-protocol/lib/admin-protocol';
1212
import { GetLicenseInfoResult, LicenseFeature, LicenseValidationResult } from '@gitpod/gitpod-protocol/lib/license-protocol';
@@ -374,10 +374,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
374374
return result;
375375
}
376376

377-
public async getBranding(ctx: TraceContext): Promise<Branding> {
378-
return this.config.brandingConfig;
379-
}
380-
381377
public async getConfiguration(ctx: TraceContext): Promise<Configuration> {
382378
return {
383379
garbageCollectionStartDate: this.config.workspaceGarbageCollection.startDate,

0 commit comments

Comments
 (0)