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

The development config directory is read when running hugo #11013

Closed
jmooring opened this issue May 24, 2023 · 2 comments · Fixed by #11014
Closed

The development config directory is read when running hugo #11013

jmooring opened this issue May 24, 2023 · 2 comments · Fixed by #11014
Assignees
Milestone

Comments

@jmooring
Copy link
Member

Problem exists in v0.112.0, v0.112.1, v0.112.2.

config/
├── _default/
│   └── config.toml
└── development/
    └── module.toml  <-- BUG: this is read when running `hugo`

Minimal example:

git clone --single-branch -b hugo-forum-topic-44506 https://github.com/jmooring/hugo-testing hugo-forum-topic-44506
cd hugo-forum-topic-44506
hugo

Error: failed to load modules: module "foo" not found

Then run:

hugo -e production

No problems.

Reference: https://discourse.gohugo.io/t/44506/3


This could expose sensitive/internal content.

config/development/module.toml

[[mounts]]
source = 'content'
target = 'content'

[[mounts]]
source = 'hidden'
target = 'content'
@bep bep removed the NeedsTriage label May 24, 2023
@bep bep self-assigned this May 24, 2023
@bep bep added this to the v0.112.3 milestone May 24, 2023
@jloh
Copy link
Contributor

jloh commented May 24, 2023

I can replicate this on v0.112.2 as well but my development config is called testing:

❯ tree config/
config/
├── testing
│   └── config.yaml <-- this file is being loaded
└── development
    └── config.yaml

3 directories, 2 files

In config/testing/config.yaml I set the baseurl to be something different and its being updated:

❯ hugo config | egrep '(envi|baseurl)'
baseurl = 'https://testground.example.com'
environment = 'production'

vs

❯ hugo config -e production | egrep '(envi|baseurl)'
baseurl = 'https://example.com'
environment = 'production'

I'm running OSX locally but discovered the bug in Netlify's build env.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants