Skip to content

Conversation

bavshin-f5
Copy link
Member

Set default state_path to "acme_{issuer.name}" and introduce a special value "off" to revert to a stateless behavior.

As usual, relative paths in configuration are resolved against NGX_PREFIX. The NGX_ACME_STATE_PREFIX environment variable can be set during build to override this behavior. The way we take the option may look a bit unusual, but unfortunately there's no infra for adding module-specific options in auto/configure.

Fixes #32.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces default state path functionality for ACME issuers and adds support for disabling state persistence with the "off" value. The change addresses issue #32 by automatically generating state paths based on the issuer name when not explicitly configured.

  • Adds automatic generation of default state paths using "acme_{issuer.name}" pattern
  • Introduces "off" special value to disable state persistence (stateless behavior)
  • Adds build-time configuration option NGX_ACME_STATE_PREFIX for custom state path prefixes

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/conf/issuer.rs Implements default state path generation logic and NGX_CONF_UNSET_PTR usage
src/conf.rs Adds custom command handler for state_path to support "off" value
README.md Documents new build option and updated state_path syntax
t/acme_conf_issuer.t Updates test configurations to include explicit state_path settings
t/acme_conf_certificate.t Updates test configuration to include explicit state_path setting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@xeioex xeioex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks good.

Set default state_path to "acme_{issuer.name}" and introduce a special
value "off" to revert to a stateless behavior.

As usual, relative paths in configuration are resolved against
NGX_PREFIX. The NGX_ACME_STATE_PREFIX environment variable can be set
during build to override this behavior. The way we take the option may
look a bit unusual, but unfortunately there's no infra for adding
module-specific options in auto/configure.

Fixes nginx#32.
Copy link
Contributor

@ensh63 ensh63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me.

@bavshin-f5 bavshin-f5 merged commit 131a681 into nginx:main Aug 29, 2025
14 checks passed
@bavshin-f5 bavshin-f5 deleted the state-path branch August 29, 2025 00:33
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 this pull request may close these issues.

Proposal: make state_path required
3 participants