Skip to content

feat: change experimental support for dotenv files#2981

Merged
ldez merged 5 commits intogo-acme:mainfrom
ldez:feat/v5/dotenv
Apr 20, 2026
Merged

feat: change experimental support for dotenv files#2981
ldez merged 5 commits intogo-acme:mainfrom
ldez:feat/v5/dotenv

Conversation

@ldez
Copy link
Copy Markdown
Member

@ldez ldez commented Apr 15, 2026

For lego run, I added a flag --env-file=.env.
The .env is not loaded by default.

For lego, I removed the support of implicit dotenv files. The environment variables are loaded from the dotenv file defined by envFile in the configuration file for the DNS provider.

For lego, I removed the support of .env file, and changed the pattern to .env.lego.XXX.
I added envFilesDirectory inside the configuration file to change the directory that contain the dotenv files.

Related to #2974

@ldez ldez added this to the unreleased-v5 milestone Apr 15, 2026
@ldez ldez changed the title feat: change experimental support for .env files feat: change experimental support for dotenv files Apr 15, 2026
@ldez ldez force-pushed the feat/v5/dotenv branch 2 times, most recently from 8c36261 to 8431f02 Compare April 15, 2026 11:04
@ldez ldez mentioned this pull request Apr 15, 2026
33 tasks
@ldez
Copy link
Copy Markdown
Member Author

ldez commented Apr 16, 2026

I'm not happy with envFilesDirectory option + dotenv patterns.

I need to think more about the topic.

@ldez ldez marked this pull request as draft April 16, 2026 18:50
@ldez
Copy link
Copy Markdown
Member Author

ldez commented Apr 16, 2026

My initial goal was to have something "transparent" by using a convention.
But the convention seems more complex than an explicit path.

Also the envFilesDirectory option has the problem of "path relativity" I explained here.

So, in this context, I think adding an envFile option on the DNS challenge configuration is a better solution: no conventional pattern, and the same problem of "path relativity" than envFilesDirectory.

Less magic and with some know limitations, but easier to use.

@ldez ldez force-pushed the feat/v5/dotenv branch 2 times, most recently from f559e59 to 9767aa9 Compare April 16, 2026 20:30
@ldez ldez marked this pull request as ready for review April 16, 2026 20:30
@ldez ldez force-pushed the feat/v5/dotenv branch 2 times, most recently from 6785c79 to e0ff7c1 Compare April 16, 2026 20:57
@ldez ldez merged commit 57ed0f5 into go-acme:main Apr 20, 2026
11 of 13 checks passed
@ldez ldez deleted the feat/v5/dotenv branch April 20, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant