Skip to content

Commit

Permalink
Apply new logos based on license (#41294)
Browse files Browse the repository at this point in the history
  • Loading branch information
avatus authored May 15, 2024
1 parent b466c8d commit 265b58c
Show file tree
Hide file tree
Showing 25 changed files with 356 additions and 30 deletions.
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ CGOFLAG ?= CGO_ENABLED=1
# should be an absolute directory as it is used by e/Makefile too, from the e/ directory.
RELEASE_DIR := $(CURDIR)/$(BUILDDIR)/artifacts

GO_LDFLAGS ?= -w -s $(KUBECTL_SETVERSION)

# Appending new conditional settings for community build type
# When TELEPORT_DEBUG is true, set flags to produce
# debugger-friendly builds.
ifeq ("$(TELEPORT_DEBUG)","true")
BUILDFLAGS ?= $(ADDFLAGS) -gcflags=all="-N -l"
else
BUILDFLAGS ?= $(ADDFLAGS) -ldflags '-w -s $(KUBECTL_SETVERSION)' -trimpath -buildmode=pie
BUILDFLAGS ?= $(ADDFLAGS) -ldflags '$(GO_LDFLAGS)' -trimpath -buildmode=pie
endif

GO_ENV_OS := $(shell go env GOOS)
Expand Down Expand Up @@ -292,8 +295,14 @@ $(BUILDDIR)/tctl:
GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -tags "$(PAM_TAG) $(FIPS_TAG) $(LIBFIDO2_BUILD_TAG) $(PIV_BUILD_TAG)" -o $(BUILDDIR)/tctl $(BUILDFLAGS) ./tool/tctl

.PHONY: $(BUILDDIR)/teleport
# Appending new conditional settings for community build type
ifeq ("$(GITHUB_REPOSITORY_OWNER)","gravitational")
# TELEPORT_LDFLAGS if appended will overwrite the previous LDFLAGS set in the BUILDFLAGS.
# This is done here to prevent any changes to the (BUI)LDFLAGS passed to the other binaries
TELEPORT_LDFLAGS ?= -ldflags '$(GO_LDFLAGS) -X github.com/gravitational/teleport/lib/modules.teleportBuildType=community'
endif
$(BUILDDIR)/teleport: ensure-webassets bpf-bytecode rdpclient
GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -tags "webassets_embed $(PAM_TAG) $(FIPS_TAG) $(BPF_TAG) $(WEBASSETS_TAG) $(RDPCLIENT_TAG) $(PIV_BUILD_TAG)" -o $(BUILDDIR)/teleport $(BUILDFLAGS) ./tool/teleport
GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -tags "webassets_embed $(PAM_TAG) $(FIPS_TAG) $(BPF_TAG) $(WEBASSETS_TAG) $(RDPCLIENT_TAG) $(PIV_BUILD_TAG)" -o $(BUILDDIR)/teleport $(BUILDFLAGS) $(TELEPORT_LDFLAGS) ./tool/teleport

# NOTE: Any changes to the `tsh` build here must be copied to `build.assets/windows/build.ps1`
# until we can use this Makefile for native Windows builds.
Expand Down
2 changes: 2 additions & 0 deletions api/client/webclient/webconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ type WebConfig struct {
SAML bool `json:"saml"`
// MobileDeviceManagement indicates whether adding Jamf plugin is enabled
MobileDeviceManagement bool `json:"mobileDeviceManagement"`
// Edition is the edition of Teleport
Edition string `json:"edition"`
}

// featureLimits define limits for features.
Expand Down
2 changes: 1 addition & 1 deletion build.assets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HOSTNAME=buildbox
SRCDIR=/go/src/github.com/gravitational/teleport
GOMODCACHE ?= /tmp/gomodcache
# TODO(hugoShaka) remove HELM_PLUGINS with teleport13 buildbox
DOCKERFLAGS := --rm=true -v "$$(pwd)/../":$(SRCDIR) -v /tmp:/tmp -w $(SRCDIR) -h $(HOSTNAME) -e GOMODCACHE=$(GOMODCACHE) -e HELM_PLUGINS=/home/ci/.local/share/helm/plugins-new
DOCKERFLAGS := --rm=true -v "$$(pwd)/../":$(SRCDIR) -v /tmp:/tmp -w $(SRCDIR) -h $(HOSTNAME) -e GOMODCACHE=$(GOMODCACHE) -e HELM_PLUGINS=/home/ci/.local/share/helm/plugins-new -e GITHUB_REPOSITORY_OWNER=$(GITHUB_REPOSITORY_OWNER)
# Teleport version - some targets require this to be set
VERSION ?= $(shell egrep ^VERSION ../Makefile | cut -d= -f2)

Expand Down
12 changes: 9 additions & 3 deletions lib/modules/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ type Modules interface {
Features() Features
// SetFeatures set features queried from Cloud
SetFeatures(Features)
// BuildType returns build type (OSS or Enterprise)
// BuildType returns build type (OSS, Community or Enterprise)
BuildType() string
// AttestHardwareKey attests a hardware key and returns its associated private key policy.
AttestHardwareKey(context.Context, interface{}, *keys.AttestationStatement, crypto.PublicKey, time.Duration) (*keys.AttestationData, error)
Expand All @@ -314,6 +314,10 @@ const (
BuildOSS = "oss"
// BuildEnterprise specifies enterprise build type
BuildEnterprise = "ent"
// BuildCommunity identifies builds of Teleport Community Edition,
// which are distributed on goteleport.com/download under our
// Teleport Community license agreement.
BuildCommunity = "community"
)

// SetModules sets the modules interface
Expand Down Expand Up @@ -368,9 +372,11 @@ type defaultModules struct {
loadDynamicValues sync.Once
}

// BuildType returns build type (OSS or Enterprise)
var teleportBuildType = BuildOSS

// BuildType returns build type (OSS, Community or Enterprise)
func (p *defaultModules) BuildType() string {
return BuildOSS
return teleportBuildType
}

// PrintVersion prints the Teleport version.
Expand Down
1 change: 1 addition & 0 deletions lib/web/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,7 @@ func (h *Handler) getWebConfig(w http.ResponseWriter, r *http.Request, p httprou
isTeam := clusterFeatures.GetProductType() == proto.ProductType_PRODUCT_TYPE_TEAM

webCfg := webclient.WebConfig{
Edition: modules.GetModules().BuildType(),
Auth: authSettings,
CanJoinSessions: canJoinSessions,
IsCloud: clusterFeatures.GetCloud(),
Expand Down
2 changes: 2 additions & 0 deletions lib/web/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4518,6 +4518,7 @@ func TestGetWebConfig(t *testing.T) {
AssistEnabled: false,
AutomaticUpgrades: false,
JoinActiveSessions: true,
Edition: modules.BuildOSS, // testBuildType is empty
}

// Make a request.
Expand Down Expand Up @@ -4568,6 +4569,7 @@ func TestGetWebConfig(t *testing.T) {
expectedCfg.AutomaticUpgradesTargetVersion = "v" + teleport.Version
expectedCfg.AssistEnabled = false
expectedCfg.JoinActiveSessions = false
expectedCfg.Edition = "" // testBuildType is empty

// request and verify enabled features are enabled.
re, err = clt.Get(ctx, endpoint, nil)
Expand Down
4 changes: 4 additions & 0 deletions web/packages/design/src/assets/images/agpl-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 265b58c

Please sign in to comment.