feat: improve UX for external configuration (#6861)

* docs: simplify traefik external tls

* remove pass host header

* docs: simplify and fix nginx external tls

* fix: readiness with enabled tls

* improve proxy docs

* improve proxy docs

* fix(ready): don't verify server cert

* complete nginx docs

* cleanup

* complete traefik docs

* add caddy docs

* simplify traefik

* standardize

* fix caddy

* add httpd docs

* improve external config docs

* guiding error message

* docs(defaults.yaml): remove misleading comments

* guiding error message cs and ru

* improve proxy testability

* fix compose up command

* improve commands

* fix nginx tls disabled

* fix nginx tls enabled

* fix: serve gateway when tls is enabled

* fmt caddy files

* fix caddy enabled tls

* remove not-working commands

* review

* fix checks

* fix link

---------

Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
Elio Bischof
2023-11-09 11:30:15 +01:00
committed by GitHub
co-authored by Livio Spring
parent 22e2d55999
commit e0a5f8661d
57 changed files with 938 additions and 537 deletions
+3 -2
View File
@@ -63,7 +63,7 @@ func New(
}
api.grpcServer = server.CreateServer(api.verifier, authZ, queries, http2HostName, tlsConfig, accessInterceptor.AccessService())
api.grpcGateway, err = server.CreateGateway(ctx, port, http1HostName, accessInterceptor)
api.grpcGateway, err = server.CreateGateway(ctx, port, http1HostName, accessInterceptor, tlsConfig)
if err != nil {
return nil, err
}
@@ -80,7 +80,7 @@ func New(
// creates a new grpc gateway and registers it as a separate http handler
//
// used for v1 api (system, admin, mgmt, auth)
func (a *API) RegisterServer(ctx context.Context, grpcServer server.WithGatewayPrefix) error {
func (a *API) RegisterServer(ctx context.Context, grpcServer server.WithGatewayPrefix, tlsConfig *tls.Config) error {
grpcServer.RegisterServer(a.grpcServer)
handler, prefix, err := server.CreateGatewayWithPrefix(
ctx,
@@ -89,6 +89,7 @@ func (a *API) RegisterServer(ctx context.Context, grpcServer server.WithGatewayP
a.http1HostName,
a.accessInterceptor,
a.queries,
tlsConfig,
)
if err != nil {
return err
+24 -3
View File
@@ -2,6 +2,7 @@ package server
import (
"context"
"crypto/tls"
"fmt"
"net/http"
"strings"
@@ -9,6 +10,7 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/zitadel/logging"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
healthpb "google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/protobuf/encoding/protojson"
@@ -89,10 +91,11 @@ func CreateGatewayWithPrefix(
http1HostName string,
accessInterceptor *http_mw.AccessInterceptor,
queries *query.Queries,
tlsConfig *tls.Config,
) (http.Handler, string, error) {
runtimeMux := runtime.NewServeMux(serveMuxOptions...)
opts := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithTransportCredentials(grpcCredentials(tlsConfig)),
grpc.WithUnaryInterceptor(client_middleware.DefaultTracingClient()),
}
connection, err := dial(ctx, port, opts)
@@ -106,11 +109,17 @@ func CreateGatewayWithPrefix(
return addInterceptors(runtimeMux, http1HostName, accessInterceptor, queries), g.GatewayPathPrefix(), nil
}
func CreateGateway(ctx context.Context, port uint16, http1HostName string, accessInterceptor *http_mw.AccessInterceptor) (*Gateway, error) {
func CreateGateway(
ctx context.Context,
port uint16,
http1HostName string,
accessInterceptor *http_mw.AccessInterceptor,
tlsConfig *tls.Config,
) (*Gateway, error) {
connection, err := dial(ctx,
port,
[]grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithTransportCredentials(grpcCredentials(tlsConfig)),
grpc.WithUnaryInterceptor(client_middleware.DefaultTracingClient()),
})
if err != nil {
@@ -217,3 +226,15 @@ func (r *cookieResponseWriter) WriteHeader(status int) {
}
r.ResponseWriter.WriteHeader(status)
}
func grpcCredentials(tlsConfig *tls.Config) credentials.TransportCredentials {
creds := insecure.NewCredentials()
if tlsConfig != nil {
tlsConfigClone := tlsConfig.Clone()
// We don't want to verify the certificate of the internal grpc server
// That's up to the client who called the gRPC gateway
tlsConfigClone.InsecureSkipVerify = true
creds = credentials.NewTLS(tlsConfigClone)
}
return creds
}
+1 -1
View File
@@ -319,7 +319,7 @@ Errors:
NotActive: Грантът по проекта не е активен
NotInactive: Грантът по проекта не е неактивен
IAM:
NotFound: Екземплярът не е намерен
NotFound: Екземплярът не е намерен. Вижте https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: Ролите не са сменени
MemberInvalid: Членът е невалиден
+1 -1
View File
@@ -317,7 +317,7 @@ Errors:
NotActive: Grant projektu není aktivní
NotInactive: Grant projektu není neaktivní
IAM:
NotFound: Instance nenalezena
NotFound: Instance nenalezena. Podívejte se na https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: Role nebyly změněny
MemberInvalid: Člen je neplatný
+1 -1
View File
@@ -317,7 +317,7 @@ Errors:
NotActive: Projekt Grant ist nicht aktiv
NotInactive: Projekt Grant ist nicht inaktiv
IAM:
NotFound: Instanz nicht gefunden
NotFound: Instanz nicht gefunden. Schau dir https://zitadel.com/docs/self-hosting/manage/custom-domain an
Member:
RolesNotChanged: Rollen wurden nicht verändert
MemberInvalid: Member ist ungültig
+1 -1
View File
@@ -317,7 +317,7 @@ Errors:
NotActive: Project grant is not active
NotInactive: Project grant is not inactive
IAM:
NotFound: Instance not found
NotFound: Instance not found. Check out https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: Roles have not been changed
MemberInvalid: Member is invalid
+1 -1
View File
@@ -317,7 +317,7 @@ Errors:
NotActive: La concesión del proyecto no está activa
NotInactive: La concesión del proyecto no está inactiva
IAM:
NotFound: Instancia no encontrada
NotFound: Instancia no encontrada. Consulta https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: Los roles no han cambiado
MemberInvalid: El miembro no es válido
+1 -1
View File
@@ -317,7 +317,7 @@ Errors:
NotActive: La subvention de projet n'est pas active
NotInactive: La subvention du projet n'est pas inactive
IAM:
NotFound: Instance non trouvée
NotFound: Instance non trouvée. Consultez https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: Les rôles n'ont pas été modifiés
MemberInvalid: Le membre n'est pas valide
+1 -1
View File
@@ -318,7 +318,7 @@ Errors:
NotActive: Grant del progetto non è attivo
NotInactive: Grant del progetto non è inattivo
IAM:
NotFound: Istanza non trovata
NotFound: Istanza non trovata. Controlla https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: I ruoli non sono stati cambiati
MemberInvalid: Il membro non è valido
+1 -1
View File
@@ -306,7 +306,7 @@ Errors:
NotActive: プロジェクトグラントはアクティブではありません
NotInactive: プロジェクトグラントは非アクティブではありません
IAM:
NotFound: インスタンスが見つかりません
NotFound: インスタンスが見つかりません https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: ロールは変更されていません
MemberInvalid: 無効なメンバーです
+1 -1
View File
@@ -317,7 +317,7 @@ Errors:
NotActive: Овластувањето за проектот не е активно
NotInactive: Овластувањето за проектот не е неактивно
IAM:
NotFound: Инстанцата не е пронајдена
NotFound: Инстанцата не е пронајдена. Проверете https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: Улогите не се променети
MemberInvalid: Членот е невалиден
+1 -1
View File
@@ -317,7 +317,7 @@ Errors:
NotActive: Grant projektu jest nieaktywny
NotInactive: Grant projektu nie jest nieaktywny
IAM:
NotFound: Instancja nie znaleziona
NotFound: Instancja nie znaleziona. Sprawdź https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: Role nie zmienione
MemberInvalid: Członek jest nieprawidłowy
+1 -1
View File
@@ -315,7 +315,7 @@ Errors:
NotActive: A concessão do projeto não está ativa
NotInactive: A concessão do projeto não está inativa
IAM:
NotFound: Instância não encontrada
NotFound: Instância não encontrada. Confira https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: As funções não foram alteradas
MemberInvalid: O membro é inválido
+1 -1
View File
@@ -308,7 +308,7 @@ Errors:
NotActive: Грант проекта не активен
NotInactive: Грант проекта не неактивен
IAM:
NotFound: Экземпляр не найден
NotFound: Экземпляр не найден. Проверьте https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: Роли не изменились
MemberInvalid: Участник недействителен
+1 -1
View File
@@ -317,7 +317,7 @@ Errors:
NotActive: 项目授权不是启用状态
NotInactive: 项目授权不是停用状态
IAM:
NotFound: 实例未找到
NotFound: 实例未找到。查看 https://zitadel.com/docs/self-hosting/manage/custom-domain
Member:
RolesNotChanged: 角色没有改变
MemberInvalid: 成员无效