Merge pull request #4800 from owncloud/nats-tls
add nats tls insecure flags to ocis init
This commit is contained in:
@@ -3,3 +3,4 @@ Enhancement: Secure the nats connectin with TLS
|
|||||||
Encyrpted the connection to the event broker using TLS.
|
Encyrpted the connection to the event broker using TLS.
|
||||||
|
|
||||||
https://github.com/owncloud/ocis/pull/4781
|
https://github.com/owncloud/ocis/pull/4781
|
||||||
|
https://github.com/owncloud/ocis/pull/4800
|
||||||
|
|||||||
+55
-16
@@ -19,6 +19,11 @@ const (
|
|||||||
passwordLength = 32
|
passwordLength = 32
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_insecureService = InsecureService{Insecure: true}
|
||||||
|
_insecureEvents = Events{TLSInsecure: true}
|
||||||
|
)
|
||||||
|
|
||||||
type TokenManager struct {
|
type TokenManager struct {
|
||||||
JWTSecret string `yaml:"jwt_secret"`
|
JWTSecret string `yaml:"jwt_secret"`
|
||||||
}
|
}
|
||||||
@@ -43,7 +48,12 @@ type LdapBasedService struct {
|
|||||||
Ldap LdapSettings
|
Ldap LdapSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Events struct {
|
||||||
|
TLSInsecure bool `yaml:"tls_insecure"`
|
||||||
|
}
|
||||||
|
|
||||||
type GraphService struct {
|
type GraphService struct {
|
||||||
|
Events Events
|
||||||
Spaces InsecureService
|
Spaces InsecureService
|
||||||
Identity LdapBasedService
|
Identity LdapBasedService
|
||||||
}
|
}
|
||||||
@@ -87,6 +97,33 @@ type ThumbnailService struct {
|
|||||||
Thumbnail ThumbnailSettings
|
Thumbnail ThumbnailSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Search struct {
|
||||||
|
Events Events
|
||||||
|
}
|
||||||
|
|
||||||
|
type Audit struct {
|
||||||
|
Events Events
|
||||||
|
}
|
||||||
|
|
||||||
|
type Sharing struct {
|
||||||
|
Events Events
|
||||||
|
}
|
||||||
|
|
||||||
|
type StorageUsers struct {
|
||||||
|
Events Events
|
||||||
|
}
|
||||||
|
|
||||||
|
type Notifications struct {
|
||||||
|
Notifications struct{ Events Events } // The notifications config has a field called notifications
|
||||||
|
}
|
||||||
|
|
||||||
|
type Nats struct {
|
||||||
|
// The nats config has a field called nats
|
||||||
|
Nats struct {
|
||||||
|
TLSSkipVerifyClientCert bool `yaml:"tls_skip_verify_client_cert"`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: use the oCIS config struct instead of this custom struct
|
// TODO: use the oCIS config struct instead of this custom struct
|
||||||
// We can't use it right now, because it would need "omitempty" on
|
// We can't use it right now, because it would need "omitempty" on
|
||||||
// all elements, in order to produce a slim config file with `ocis init`.
|
// all elements, in order to produce a slim config file with `ocis init`.
|
||||||
@@ -117,6 +154,12 @@ type OcisConfig struct {
|
|||||||
Groups UsersAndGroupsService
|
Groups UsersAndGroupsService
|
||||||
Ocdav InsecureService
|
Ocdav InsecureService
|
||||||
Thumbnails ThumbnailService
|
Thumbnails ThumbnailService
|
||||||
|
Search Search
|
||||||
|
Audit Audit
|
||||||
|
Sharing Sharing
|
||||||
|
StorageUsers StorageUsers `yaml:"storage_users"`
|
||||||
|
Notifications Notifications
|
||||||
|
Nats Nats
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkConfigPath(configPath string) error {
|
func checkConfigPath(configPath string) error {
|
||||||
@@ -267,24 +310,20 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
if insecure {
|
if insecure {
|
||||||
|
|
||||||
cfg.AuthBearer = AuthbearerService{
|
cfg.AuthBearer = AuthbearerService{
|
||||||
AuthProviders: AuthProviderSettings{
|
AuthProviders: AuthProviderSettings{Oidc: _insecureService},
|
||||||
Oidc: InsecureService{
|
|
||||||
Insecure: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
cfg.Frontend = FrontendService{
|
|
||||||
Archiver: InsecureService{
|
|
||||||
Insecure: true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
cfg.Graph.Spaces = InsecureService{
|
|
||||||
Insecure: true,
|
|
||||||
}
|
|
||||||
cfg.Ocdav = InsecureService{
|
|
||||||
Insecure: true,
|
|
||||||
}
|
}
|
||||||
|
cfg.Frontend = FrontendService{Archiver: _insecureService}
|
||||||
|
cfg.Graph.Spaces = _insecureService
|
||||||
|
cfg.Graph.Events = _insecureEvents
|
||||||
|
cfg.Notifications.Notifications.Events = _insecureEvents
|
||||||
|
cfg.Search.Events = _insecureEvents
|
||||||
|
cfg.Audit.Events = _insecureEvents
|
||||||
|
cfg.Sharing.Events = _insecureEvents
|
||||||
|
cfg.StorageUsers.Events = _insecureEvents
|
||||||
|
cfg.Nats.Nats.TLSSkipVerifyClientCert = true
|
||||||
|
cfg.Ocdav = _insecureService
|
||||||
cfg.Proxy = InsecureProxyService{
|
cfg.Proxy = InsecureProxyService{
|
||||||
InsecureBackends: true,
|
InsecureBackends: true,
|
||||||
OIDC: InsecureProxyOIDC{
|
OIDC: InsecureProxyOIDC{
|
||||||
|
|||||||
Reference in New Issue
Block a user