Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
430 changes: 0 additions & 430 deletions assets/install-scripts/install.sh

This file was deleted.

1 change: 1 addition & 0 deletions assets/install-scripts/install.sh
2 changes: 1 addition & 1 deletion lib/srv/server/installer/defaultinstallers.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func oneoffScriptToDefaultInstaller() *types.InstallerV1 {
}

script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Teleport is installed and running.",
TeleportCommandPrefix: oneoff.PrefixSUDO,
})
Expand Down
7 changes: 6 additions & 1 deletion lib/web/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,11 @@ func (h *Handler) bindDefaultEndpoints() {
h.GET("/webapi/tokens", h.WithAuth(h.getTokens))
h.DELETE("/webapi/tokens", h.WithAuth(h.deleteToken))

// install script, the ':token' wildcard is a hack to make the router happy and support
// the token-less route "/scripts/install.sh".
// h.installScriptHandle Will reject any unknown sub-route.
h.GET("/scripts/:token", h.WithHighLimiter(h.installScriptHandle))

// join scripts
h.GET("/scripts/:token/install-node.sh", h.WithLimiter(h.getNodeJoinScriptHandle))
h.GET("/scripts/:token/install-app.sh", h.WithLimiter(h.getAppJoinScriptHandle))
Expand Down Expand Up @@ -2245,7 +2250,7 @@ func (h *Handler) installer(w http.ResponseWriter, r *http.Request, p httprouter
// https://updates.releases.teleport.dev/v1/stable/cloud/version
installUpdater := automaticUpgrades(*ping.ServerFeatures)
if installUpdater {
repoChannel = stableCloudChannelRepo
repoChannel = automaticupgrades.DefaultCloudChannelName
}
azureClientID := r.URL.Query().Get("azure-client-id")

Expand Down
3 changes: 2 additions & 1 deletion lib/web/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3643,6 +3643,7 @@ func TestKnownWebPathsWithAndWithoutV1Prefix(t *testing.T) {

func TestInstallDatabaseScriptGeneration(t *testing.T) {
const username = "test-user@example.com"
modules.SetTestModules(t, &modules.TestModules{TestBuildType: modules.BuildCommunity})

// Users should be able to create Tokens even if they can't update them
roleTokenCRD, err := types.NewRole(services.RoleNameForUser(username), types.RoleSpecV6{
Expand Down Expand Up @@ -8538,9 +8539,9 @@ func createProxy(ctx context.Context, t *testing.T, proxyID string, node *regula
},
)
handler.handler.cfg.ProxyKubeAddr = utils.FromAddr(kubeProxyAddr)
handler.handler.cfg.PublicProxyAddr = webServer.Listener.Addr().String()
url, err := url.Parse("https://" + webServer.Listener.Addr().String())
require.NoError(t, err)
handler.handler.cfg.PublicProxyAddr = url.String()

return &testProxy{
clock: clock,
Expand Down
4 changes: 2 additions & 2 deletions lib/web/autoupdate_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (h *Handler) autoUpdateAgentVersion(ctx context.Context, group, updaterUUID
rollout, err := h.cfg.AccessPoint.GetAutoUpdateAgentRollout(ctx)
if err != nil {
// Fallback to channels if there is no autoupdate_agent_rollout.
if trace.IsNotFound(err) {
if trace.IsNotFound(err) || trace.IsNotImplemented(err) {
return getVersionFromChannel(ctx, h.cfg.AutomaticUpgradesChannels, group)
}
// Something is broken, we don't want to fallback to channels, this would be harmful.
Expand Down Expand Up @@ -77,7 +77,7 @@ func (h *Handler) autoUpdateAgentShouldUpdate(ctx context.Context, group, update
rollout, err := h.cfg.AccessPoint.GetAutoUpdateAgentRollout(ctx)
if err != nil {
// Fallback to channels if there is no autoupdate_agent_rollout.
if trace.IsNotFound(err) {
if trace.IsNotFound(err) || trace.IsNotImplemented(err) {
// Updaters using the RFD184 API are not aware of maintenance windows
// like RFD109 updaters are. To have both updaters adopt the same behavior
// we must do the CMC window lookup for them.
Expand Down
14 changes: 7 additions & 7 deletions lib/web/integrations_awsoidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func (h *Handler) awsOIDCConfigureDeployServiceIAM(w http.ResponseWriter, r *htt
fmt.Sprintf("--aws-account-id=%s", shsprintf.EscapeDefaultContext(awsAccountID)),
}
script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to complete the database enrollment.",
})
if err != nil {
Expand Down Expand Up @@ -633,7 +633,7 @@ func (h *Handler) awsOIDCConfigureAWSAppAccessIAM(w http.ResponseWriter, r *http
fmt.Sprintf("--role=%s", shsprintf.EscapeDefaultContext(role)),
}
script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to use AWS App Access.",
})
if err != nil {
Expand Down Expand Up @@ -704,7 +704,7 @@ func (h *Handler) awsOIDCConfigureEC2SSMIAM(w http.ResponseWriter, r *http.Reque
fmt.Sprintf("--aws-account-id=%s", shsprintf.EscapeDefaultContext(awsAccountID)),
}
script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to finish the EC2 auto discover set up.",
})
if err != nil {
Expand Down Expand Up @@ -745,7 +745,7 @@ func (h *Handler) awsOIDCConfigureEKSIAM(w http.ResponseWriter, r *http.Request,
fmt.Sprintf("--aws-account-id=%s", shsprintf.EscapeDefaultContext(awsAccountID)),
}
script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to complete the EKS enrollment.",
})
if err != nil {
Expand Down Expand Up @@ -1252,7 +1252,7 @@ func (h *Handler) awsOIDCConfigureIdP(w http.ResponseWriter, r *http.Request, p
}

script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to use the integration with AWS.",
})
if err != nil {
Expand Down Expand Up @@ -1293,7 +1293,7 @@ func (h *Handler) awsOIDCConfigureListDatabasesIAM(w http.ResponseWriter, r *htt
fmt.Sprintf("--aws-account-id=%s", shsprintf.EscapeDefaultContext(awsAccountID)),
}
script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to complete the Database enrollment.",
})
if err != nil {
Expand Down Expand Up @@ -1339,7 +1339,7 @@ func (h *Handler) awsAccessGraphOIDCSync(w http.ResponseWriter, r *http.Request,
fmt.Sprintf("--aws-account-id=%s", shsprintf.EscapeDefaultContext(awsAccountID)),
}
script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to complete the Access Graph AWS Sync enrollment.",
})
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions lib/web/integrations_awsoidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func TestBuildDeployServiceConfigureIAMScript(t *testing.T) {
}

require.Contains(t, string(resp.Bytes()),
fmt.Sprintf("teleportArgs='%s'\n", tc.expectedTeleportArgs),
fmt.Sprintf("entrypointArgs='%s'\n", tc.expectedTeleportArgs),
)
})
}
Expand Down Expand Up @@ -304,7 +304,7 @@ func TestBuildEC2SSMIAMScript(t *testing.T) {
}

require.Contains(t, string(resp.Bytes()),
fmt.Sprintf("teleportArgs='%s'\n", tc.expectedTeleportArgs),
fmt.Sprintf("entrypointArgs='%s'\n", tc.expectedTeleportArgs),
)
})
}
Expand Down Expand Up @@ -379,7 +379,7 @@ func TestBuildAWSAppAccessConfigureIAMScript(t *testing.T) {
}

require.Contains(t, string(resp.Bytes()),
fmt.Sprintf("teleportArgs='%s'\n", tc.expectedTeleportArgs),
fmt.Sprintf("entrypointArgs='%s'\n", tc.expectedTeleportArgs),
)
})
}
Expand Down Expand Up @@ -482,7 +482,7 @@ func TestBuildEKSConfigureIAMScript(t *testing.T) {
}

require.Contains(t, string(resp.Bytes()),
fmt.Sprintf("teleportArgs='%s'\n", tc.expectedTeleportArgs),
fmt.Sprintf("entrypointArgs='%s'\n", tc.expectedTeleportArgs),
)
})
}
Expand Down Expand Up @@ -614,7 +614,7 @@ func TestBuildAWSOIDCIdPConfigureScript(t *testing.T) {
}

require.Contains(t, string(resp.Bytes()),
fmt.Sprintf("teleportArgs='%s'\n", tc.expectedTeleportArgs),
fmt.Sprintf("entrypointArgs='%s'\n", tc.expectedTeleportArgs),
)
})
}
Expand Down Expand Up @@ -717,7 +717,7 @@ func TestBuildListDatabasesConfigureIAMScript(t *testing.T) {
}

require.Contains(t, string(resp.Bytes()),
fmt.Sprintf("teleportArgs='%s'\n", tc.expectedTeleportArgs),
fmt.Sprintf("entrypointArgs='%s'\n", tc.expectedTeleportArgs),
)
})
}
Expand Down
2 changes: 1 addition & 1 deletion lib/web/integrations_azureoidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (h *Handler) azureOIDCConfigure(w http.ResponseWriter, r *http.Request, p h
}

script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to use the integration with Azure.",
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion lib/web/integrations_azureoidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func TestAzureOIDCConfigureScript(t *testing.T) {
}

require.Contains(t, string(resp.Bytes()),
fmt.Sprintf("teleportArgs='%s'\n", tc.expectedTeleportArgs),
fmt.Sprintf("entrypointArgs='%s'\n", tc.expectedTeleportArgs),
)
})
}
Expand Down
2 changes: 1 addition & 1 deletion lib/web/integrations_samlidp.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (h *Handler) gcpWorkforceConfigScript(w http.ResponseWriter, r *http.Reques
fmt.Sprintf("--idp-metadata-url=%s", shsprintf.EscapeDefaultContext(samlIdPMetadataURL)),
}
script, err := oneoff.BuildScript(oneoff.OneOffScriptParams{
TeleportArgs: strings.Join(argsList, " "),
EntrypointArgs: strings.Join(argsList, " "),
SuccessMessage: "Success! You can now go back to the Teleport Web UI to complete enrolling this workforce pool to Teleport SAML Identity Provider.",
})
if err != nil {
Expand Down
Loading