rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.74k stars 331 forks source link

error calling getenv: access denied #673

Closed gergiu closed 2 years ago

gergiu commented 2 years ago

Hi, I hope someone can help me with this issue:

Launching the server via the command:
  C:/Users/w0rk5/AppData/Roaming/Hugo/0.91.0/hugo.exe server --bind XXX.X.X.X -p YYYY --themesDir themes -t hugo-lithium -D -F --navigateToChanged
Error: Error building site: "C:\_DATI\MEGAdrive\Class\myWebSite\gergiu.github.io\content\post\2020-12-01-r-rmarkdown\index.html:9:14": failed to render shortcode "blogdown/postref": failed to process shortcode: "C:\_DATI\MEGAdrive\Class\myWebSite\gergiu.github.io\layouts\shortcodes\blogdown\postref.html:1:10": execute of template failed: template: shortcodes/blogdown/postref.html:1:10: executing "shortcodes/blogdown/postref.html" at <getenv "BLOGDOWN_POST_RELREF">: error calling getenv: access denied: "BLOGDOWN_POST_RELREF" 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_']

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

It seems i can't use getenv.

Thank you.

yihui commented 2 years ago

Duplicate of #672.

yihui commented 2 years ago

Should be fixed now. Thanks for the report! You can install the development version via

remotes::install_github('rstudio/blogdown')
gergiu commented 2 years ago

Thanks for your help!