Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest hugo fails due to missing env var whitelists #1869

Closed
zenyui opened this issue Jan 29, 2022 · 0 comments · Fixed by #1870
Closed

Latest hugo fails due to missing env var whitelists #1869

zenyui opened this issue Jan 29, 2022 · 0 comments · Fixed by #1870

Comments

@zenyui
Copy link
Contributor

zenyui commented Jan 29, 2022

What happened?

Attempted to run the master hugo docs site by running

cd ./docs
hugo serve

And hugo failed b/c env vars VERSION and CURRENT_VERSION were referenced but not properly whitelisted in the config file. I am able to run the site when I whitelist those env vars in the config file.

Here is a sample of the error hugo prints:

Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:30:4: executing "_default/single.html" at <partial "version-switcher" .>: error calling partial: "/Users/zen/Documents/99designs/gqlgen/docs/layouts/partials/version-switcher.html:3:22": execute of template failed: template: partials/version-switcher.html:3:22: executing "partials/version-switcher.html" at <getenv "CURRENT_VERSION">: error calling getenv: access denied: "CURRENT_VERSION" is not whitelisted in policy "security.funcs.getenv"; the current security configuration is:

[security]
  enableInlineShortcodes = false
  [security.exec]
    allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']
    osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']

  [security.funcs]
    getenv = ['^HUGO_', 'VERSIONS']

  [security.http]
    methods = ['(?i)GET|POST']
    urls = ['.*']

What did you expect?

Expected the site to boot

Minimal graphql.schema and models to reproduce

n/a

versions

hugo v0.92.1+extended darwin/arm64 BuildDate=unknown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant