File tree 3 files changed +11
-4
lines changed
docs/content/doc/advanced 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -282,8 +282,9 @@ DISABLE_ROUTER_LOG = false
282
282
; not forget to export the private key):
283
283
; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
284
284
; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
285
- CERT_FILE = custom/https/cert.pem
286
- KEY_FILE = custom/https/key.pem
285
+ ; Relative paths will be made absolute against the CUSTOM_PATH
286
+ CERT_FILE = https/cert.pem
287
+ KEY_FILE = https/key.pem
287
288
; Root directory containing templates and static files.
288
289
; default is the path where Gitea is executed
289
290
STATIC_ROOT_PATH =
Original file line number Diff line number Diff line change @@ -181,8 +181,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
181
181
- ` SSH_LISTEN_PORT ` : ** %(SSH\_ PORT)s** : Port for the built-in SSH server.
182
182
- ` OFFLINE_MODE ` : ** false** : Disables use of CDN for static files and Gravatar for profile pictures.
183
183
- ` DISABLE_ROUTER_LOG ` : ** false** : Mute printing of the router log.
184
- - ` CERT_FILE ` : ** custom/ https/cert.pem** : Cert file path used for HTTPS.
185
- - ` KEY_FILE ` : ** custom/ https/key.pem** : Key file path used for HTTPS.
184
+ - ` CERT_FILE ` : ** https/cert.pem** : Cert file path used for HTTPS. From 1.12 relative paths will be made absolute against ` CUSTOM_PATH ` .
185
+ - ` KEY_FILE ` : ** https/key.pem** : Key file path used for HTTPS. From 1.12 relative paths will be made absolute against ` CUSTOM_PATH ` .
186
186
- ` STATIC_ROOT_PATH ` : ** ./** : Upper level of template and static files path.
187
187
- ` STATIC_CACHE_TIME ` : ** 6h** : Web browser cache time for static resources on ` custom/ ` , ` public/ ` and all uploaded avatars.
188
188
- ` ENABLE_GZIP ` : ** false** : Enables application-level GZIP support.
Original file line number Diff line number Diff line change @@ -554,6 +554,12 @@ func NewContext() {
554
554
Protocol = HTTPS
555
555
CertFile = sec .Key ("CERT_FILE" ).String ()
556
556
KeyFile = sec .Key ("KEY_FILE" ).String ()
557
+ if ! filepath .IsAbs (CertFile ) && len (CertFile ) > 0 {
558
+ CertFile = filepath .Join (CustomPath , CertFile )
559
+ }
560
+ if ! filepath .IsAbs (KeyFile ) && len (KeyFile ) > 0 {
561
+ KeyFile = filepath .Join (CustomPath , KeyFile )
562
+ }
557
563
case "fcgi" :
558
564
Protocol = FCGI
559
565
case "fcgi+unix" :
You can’t perform that action at this time.
0 commit comments