mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-21 23:33:34 +00:00
feat(temporal): temporal needs server worker
This commit is contained in:
parent
7a65cf7186
commit
bf109f5be6
5 changed files with 24 additions and 10 deletions
|
@ -36,7 +36,7 @@ var SettingsPages = []*components.Page{
|
|||
{Path: "/settings/cronjobs", Title: "Cronjobs", Breadcrumb: "Cronjobs"},
|
||||
{Path: "/settings/workers", Title: "Workers", Breadcrumb: "Workers"},
|
||||
{Path: "/settings/workers/create", Title: "Workers Create", Breadcrumb: "Create"},
|
||||
{Path: "/temporal", Title: "Temporal", Breadcrumb: "Temporal"},
|
||||
{Path: "/settings/temporal", Title: "Temporal", Breadcrumb: "Temporal"},
|
||||
{Path: "/oauth2/logout", Title: "Logout", Breadcrumb: "Logout"},
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ func (s *Server) Start() error {
|
|||
|
||||
r.HandleFunc("/", h.Index).Methods("GET")
|
||||
|
||||
// Authenticated routes
|
||||
// Settings
|
||||
r.HandleFunc("/settings", h.Authenticated(h.SettingsOverviewGET)).Methods("GET")
|
||||
r.HandleFunc("/settings/healthchecks", h.Authenticated(h.SettingsHealthchecksGET)).Methods("GET")
|
||||
r.HandleFunc("/settings/healthchecks/create", h.Authenticated(h.SettingsHealthchecksCreateGET)).Methods("GET")
|
||||
|
@ -77,15 +77,13 @@ func (s *Server) Start() error {
|
|||
r.HandleFunc("/settings/workers/create", h.Authenticated(h.SettingsWorkersCreatePOST)).Methods("POST")
|
||||
r.HandleFunc("/settings/workers/{slug}", h.Authenticated(h.SettingsWorkersDescribeGET)).Methods("GET")
|
||||
r.HandleFunc("/settings/workers/{slug}/token", h.Authenticated(h.SettingsWorkersTokenGET)).Methods("GET")
|
||||
r.PathPrefix("/settings/temporal").HandlerFunc(h.Authenticated(h.Temporal))
|
||||
|
||||
// OAuth2
|
||||
r.HandleFunc("/oauth2/login", h.OAuth2LoginGET).Methods("GET")
|
||||
r.HandleFunc("/oauth2/callback", h.OAuth2CallbackGET).Methods("GET")
|
||||
r.HandleFunc("/oauth2/logout", h.Authenticated(h.OAuth2LogoutGET)).Methods("GET")
|
||||
|
||||
// Temporal UI
|
||||
r.PathPrefix("/temporal").HandlerFunc(h.Authenticated(h.Temporal))
|
||||
|
||||
// API
|
||||
r.HandleFunc("/api/v1/workers/connect", h.Authenticated(h.ApiV1WorkersConnectGET)).Methods("GET")
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ const FrontendPort = 7233
|
|||
const HistoryPort = 7234
|
||||
const MatchingPort = 7235
|
||||
const WorkerPort = 7236
|
||||
const InternalFrontendPort = 7237
|
||||
|
||||
type TokenKeyProvider struct {
|
||||
config *internal.TemporalConfig
|
||||
|
@ -96,6 +97,22 @@ func NewServerConfig(cfg *internal.TemporalConfig) *config.Config {
|
|||
BindOnIP: "",
|
||||
},
|
||||
},
|
||||
"worker": {
|
||||
RPC: config.RPC{
|
||||
GRPCPort: WorkerPort,
|
||||
MembershipPort: WorkerPort + 100,
|
||||
BindOnLocalHost: true,
|
||||
BindOnIP: "",
|
||||
},
|
||||
},
|
||||
"internal-frontend": {
|
||||
RPC: config.RPC{
|
||||
GRPCPort: InternalFrontendPort,
|
||||
MembershipPort: InternalFrontendPort + 100,
|
||||
BindOnLocalHost: true,
|
||||
BindOnIP: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
ClusterMetadata: &cluster.Config{
|
||||
EnableGlobalNamespace: false,
|
||||
|
@ -106,7 +123,7 @@ func NewServerConfig(cfg *internal.TemporalConfig) *config.Config {
|
|||
"active": {
|
||||
Enabled: true,
|
||||
InitialFailoverVersion: 1,
|
||||
RPCAddress: fmt.Sprintf("%s:%d", BroadcastAddress, FrontendPort),
|
||||
RPCAddress: fmt.Sprintf("%s:%d", BroadcastAddress, InternalFrontendPort),
|
||||
ClusterID: "todo",
|
||||
},
|
||||
},
|
||||
|
@ -126,9 +143,6 @@ func NewServerConfig(cfg *internal.TemporalConfig) *config.Config {
|
|||
Provider: nil,
|
||||
},
|
||||
},
|
||||
PublicClient: config.PublicClient{
|
||||
HostPort: fmt.Sprintf("%s:%d", BroadcastAddress, FrontendPort),
|
||||
},
|
||||
NamespaceDefaults: config.NamespaceDefaults{
|
||||
Archival: config.ArchivalNamespaceDefaults{
|
||||
History: config.HistoryArchivalNamespaceDefaults{
|
||||
|
|
|
@ -65,6 +65,8 @@ func NewServer(cfg *config.Config, tokenKeyProvider authorization.TokenKeyProvid
|
|||
string(primitives.FrontendService),
|
||||
string(primitives.HistoryService),
|
||||
string(primitives.MatchingService),
|
||||
string(primitives.WorkerService),
|
||||
string(primitives.InternalFrontendService),
|
||||
}),
|
||||
t.WithLogger(logger),
|
||||
t.InterruptOn(interruptChan),
|
||||
|
|
|
@ -13,7 +13,7 @@ func NewUiConfig(cfg *internal.TemporalConfig) *config.Config {
|
|||
Port: 8223,
|
||||
TemporalGRPCAddress: "localhost:7233",
|
||||
EnableUI: true,
|
||||
PublicPath: "/temporal",
|
||||
PublicPath: "/settings/temporal",
|
||||
ForwardHeaders: []string{"Authorization"},
|
||||
Codec: config.Codec{
|
||||
Endpoint: "",
|
||||
|
|
Loading…
Reference in a new issue