From e9857b574658dfdedbf7575cf3fede0dfa9585c8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 21 Sep 2026 16:17:15 +0000 Subject: [PATCH] Apply remaining changes Co-authored-by: techknowlogick <164197+techknowlogick@users.noreply.github.com> --- custom/conf/app.example.ini | 3 +++ modules/setting/server_test.go | 39 ---------------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 modules/setting/server_test.go diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index 213d1a0489f..f56019657ab 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -264,6 +264,9 @@ ;; Can be left blank to initialize at first run and use the cached value ;ACME_EMAIL = ;; +;; ACME profile to request from the CA (e.g. "shortlived" for raw-IP certificates) +;ACME_PROFILE = +;; ;; ACME live directory (not to be confused with ACME directory URL: ACME_URL) ;; (Refer to caddy's ACME manager https://github.com/caddyserver/certmagic) ;ACME_DIRECTORY = https diff --git a/modules/setting/server_test.go b/modules/setting/server_test.go deleted file mode 100644 index cb36f9dc806..00000000000 --- a/modules/setting/server_test.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2026 The Gitea Authors. All rights reserved. -// SPDX-License-Identifier: MIT - -package setting - -import ( - "testing" - - "gitea.dev/modules/test" - - "github.com/stretchr/testify/assert" -) - -func TestLoadServerFromACMEProfile(t *testing.T) { - defer test.MockVariableValue(&Protocol)() - defer test.MockVariableValue(&EnableAcme)() - defer test.MockVariableValue(&AcmeTOS)() - defer test.MockVariableValue(&AcmeURL)() - defer test.MockVariableValue(&AcmeProfile)() - defer test.MockVariableValue(&AcmeCARoot)() - defer test.MockVariableValue(&AcmeLiveDirectory)() - defer test.MockVariableValue(&AcmeEmail)() - - cfg, err := NewConfigProviderFromData(` -[server] -PROTOCOL = https -ENABLE_ACME = true -ACME_ACCEPTTOS = true -ACME_DIRECTORY = /tmp/acme -ACME_EMAIL = acme@example.com -ACME_PROFILE = shortlived -`) - assert.NoError(t, err) - - loadServerFrom(cfg) - - assert.Equal(t, HTTPS, Protocol) - assert.Equal(t, "shortlived", AcmeProfile) -}