mirror of
https://github.com/go-sigma/sigma.git
synced 2026-10-28 20:34:45 +08:00
The source-code providers a deployment can use were implied by auth.oauth2.*, so disabling OAuth login also disabled code repository sync and every build that clones source code, and there was nowhere to configure a self-hosted GitLab or Gitea at all: the gitea client was created with an empty base URL. Make provider capability explicit and independent from login: - add scm.providers[] with provider and baseUrl; github and gitlab default to their hosted endpoints, gitea and other self-hosted instances require a base URL and are skipped with a warning when it is missing - derive the provider list from the enabled OAuth2 providers when scm.providers is empty, so existing configurations keep working - expose Configuration.ResolveScmProviders and Configuration.ScmProvider - add auth.credentialKey for the master key that encrypts SCM credentials at rest, plus the credential.master_key settings key used as fallback conf/config.yaml, both configuration docs and the Helm chart (values and configmap) document the two new sections. Verification: - go test -run "TestConfigurationScm|TestConfigurationResolveScm" -tags "netgo,timetzdata,exclude_graphdriver_btrfs,containers_image_openpgp" ./pkg/config/... - helm template test ./deploy/sigma
27 lines
1.1 KiB
Go
27 lines
1.1 KiB
Go
// Copyright 2023 sigma
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package consts
|
|
|
|
const (
|
|
// SettingSignPrivateKey is the private key for signing
|
|
SettingSignPrivateKey = "signing.private_key"
|
|
// SettingSignPublicKey is the public key for signing
|
|
SettingSignPublicKey = "signing.public_key"
|
|
// SettingCredentialMasterKey is the settings key holding the master key that encrypts
|
|
// SCM credentials at rest. The value is generated on first start when
|
|
// auth.credentialKey is not configured.
|
|
SettingCredentialMasterKey = "credential.master_key" // #nosec G101 -- settings key name, not a credential
|
|
)
|