aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMathieu Parent <[email protected]>2022-09-19 12:37:35 +0200
committerGitHub <[email protected]>2022-09-19 12:37:35 +0200
commit86653fa38eb43a5fabf7adc694c752ccb7721ffa (patch)
treeae9519dbcd99949b71f8f9d9cf3c2322f431c896
parentc46d104985b185b66a4a65d02d58043a4dc0dea0 (diff)
downloadhugo-86653fa38eb43a5fabf7adc694c752ccb7721ffa.tar.gz
hugo-86653fa38eb43a5fabf7adc694c752ccb7721ffa.zip
config/security: Allow proxy variables in subcommands
In particular for go get
-rw-r--r--config/security/securityConfig.go2
-rw-r--r--config/security/securityonfig_test.go2
-rw-r--r--docs/data/docs.json2
3 files changed, 3 insertions, 3 deletions
diff --git a/config/security/securityConfig.go b/config/security/securityConfig.go
index b27481230..b5a17ac2d 100644
--- a/config/security/securityConfig.go
+++ b/config/security/securityConfig.go
@@ -42,7 +42,7 @@ var DefaultConfig = Config{
),
// These have been tested to work with Hugo's external programs
// on Windows, Linux and MacOS.
- OsEnv: NewWhitelist("(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$"),
+ OsEnv: NewWhitelist("(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM)$"),
},
Funcs: Funcs{
Getenv: NewWhitelist("^HUGO_"),
diff --git a/config/security/securityonfig_test.go b/config/security/securityonfig_test.go
index 24190a57f..c8753f7fc 100644
--- a/config/security/securityonfig_test.go
+++ b/config/security/securityonfig_test.go
@@ -140,7 +140,7 @@ func TestToTOML(t *testing.T) {
got := DefaultConfig.ToTOML()
c.Assert(got, qt.Equals,
- "[security]\n enableInlineShortcodes = false\n\n [security.exec]\n allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']\n osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']\n\n [security.funcs]\n getenv = ['^HUGO_']\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']",
+ "[security]\n enableInlineShortcodes = false\n\n [security.exec]\n allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']\n osEnv = ['(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM)$']\n\n [security.funcs]\n getenv = ['^HUGO_']\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']",
)
}
diff --git a/docs/data/docs.json b/docs/data/docs.json
index fe4efeb22..b41cb351d 100644
--- a/docs/data/docs.json
+++ b/docs/data/docs.json
@@ -1650,7 +1650,7 @@
"^postcss$"
],
"osEnv": [
- "(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$"
+ "(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM)$"
]
},
"funcs": {