From 1d7b7504d07e6d58dd7c4a37055a2d754374dee2 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 19 Jan 2020 19:07:44 +0000 Subject: Make CertFile and KeyFile relative to CustomPath (#9868) * Make CertFile and KeyFile relative to CustomPath The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath. Fix #4196 * Improve error reporting when reading certificates * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- custom/conf/app.ini.sample | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'custom/conf') diff --git a/custom/conf/app.ini.sample b/custom/conf/app.ini.sample index 7e7dbbf5f3..971a99e264 100644 --- a/custom/conf/app.ini.sample +++ b/custom/conf/app.ini.sample @@ -282,8 +282,9 @@ DISABLE_ROUTER_LOG = false ; not forget to export the private key): ; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys ; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes -CERT_FILE = custom/https/cert.pem -KEY_FILE = custom/https/key.pem +; Paths are relative to CUSTOM_PATH +CERT_FILE = https/cert.pem +KEY_FILE = https/key.pem ; Root directory containing templates and static files. ; default is the path where Gitea is executed STATIC_ROOT_PATH = -- cgit v1.2.3