mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
The new Agent API needs an interface for ServiceBanners, so this PR creates it and refactors the AGPL and Enterprise code to achieve it. Before we depended on the fact that the HTTP endpoint was missing to serve an empty ServiceBanner on AGPL deployments, but that won't work with dRPC, so we need a real interface to call.
40 lines
864 B
Go
40 lines
864 B
Go
package appearance
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/coder/coder/v2/codersdk"
|
|
)
|
|
|
|
type Fetcher interface {
|
|
Fetch(ctx context.Context) (codersdk.AppearanceConfig, error)
|
|
}
|
|
|
|
var DefaultSupportLinks = []codersdk.LinkConfig{
|
|
{
|
|
Name: "Documentation",
|
|
Target: "https://coder.com/docs/coder-oss",
|
|
Icon: "docs",
|
|
},
|
|
{
|
|
Name: "Report a bug",
|
|
Target: "https://github.com/coder/coder/issues/new?labels=needs+grooming&body={CODER_BUILD_INFO}",
|
|
Icon: "bug",
|
|
},
|
|
{
|
|
Name: "Join the Coder Discord",
|
|
Target: "https://coder.com/chat?utm_source=coder&utm_medium=coder&utm_campaign=server-footer",
|
|
Icon: "chat",
|
|
},
|
|
}
|
|
|
|
type AGPLFetcher struct{}
|
|
|
|
func (AGPLFetcher) Fetch(context.Context) (codersdk.AppearanceConfig, error) {
|
|
return codersdk.AppearanceConfig{
|
|
SupportLinks: DefaultSupportLinks,
|
|
}, nil
|
|
}
|
|
|
|
var DefaultFetcher Fetcher = AGPLFetcher{}
|