Move the example config to configs/, delete scripts/ and CONVENTIONS.md (closes #97)
check / check (push) Failing after 2s
check / check (push) Failing after 2s
config.example.yml moves unchanged to configs/config.example.yml, the directory REPO_POLICIES.md names for configuration examples. README.md, the comments in internal/config/config.go and the startup error for the placeholder signing key name the new path. scripts/manual-test.sh and its directory are deleted. The handler tests in internal/handlers cover every check it made except two: fetching a real image from the internet, and a URL made on the generator page with a ttl answering 410 once the ttl has passed (#199). CONVENTIONS.md, a reformatted copy of the Go HTTP server conventions, is deleted, as REPO_POLICIES.md links the canonical document. Model: opus-5-5
This commit was merged in pull request #194.
This commit is contained in:
@@ -62,7 +62,7 @@ const (
|
||||
)
|
||||
|
||||
// placeholderSigningKey is the dummy signing_key shipped in
|
||||
// config.example.yml. It is 45 characters, so it passes the length
|
||||
// configs/config.example.yml. It is 45 characters, so it passes the length
|
||||
// check, but it is public in this repository and must be rejected at
|
||||
// startup so no deployment ever signs URLs with it.
|
||||
const placeholderSigningKey = "CHANGE_ME_generate_with_openssl_rand_base64_32"
|
||||
@@ -88,7 +88,7 @@ var (
|
||||
errMustBeAtLeastOne = errors.New("must be at least 1")
|
||||
errValueTooShort = errors.New("value too short")
|
||||
errPlaceholderKey = errors.New(
|
||||
"is the placeholder from config.example.yml; " +
|
||||
"is the placeholder from configs/config.example.yml; " +
|
||||
"generate a real key with: openssl rand -base64 32")
|
||||
errMustBeSetTogether = errors.New("must be set together")
|
||||
errMustNotBeNegative = errors.New("must not be negative")
|
||||
@@ -554,8 +554,8 @@ func (c *Config) ensureStateDirWritable() error {
|
||||
}
|
||||
|
||||
// validateSigningKey checks that the signing key is present, long
|
||||
// enough, and not the public placeholder from config.example.yml. The
|
||||
// key value itself is never echoed in error messages.
|
||||
// enough, and not the public placeholder from configs/config.example.yml.
|
||||
// The key value itself is never echoed in error messages.
|
||||
func (c *Config) validateSigningKey() error {
|
||||
if c.SigningKey == "" {
|
||||
return fmt.Errorf("%s: %w", settingName(keySigningKey), errValueRequired)
|
||||
|
||||
Reference in New Issue
Block a user