<directivesynopsis>
<name>MDNotifyCmd</name>
<description>Run a program when Managed Domain are ready.</description>
- <syntax>MDNotifyCmd <var>path</var></syntax>
+ <syntax>MDNotifyCmd <var>path</var> [ <var>args</var> ]</syntax>
<contextlist>
<context>server config</context>
</contextlist>
<usage>
<p>The configured executable is run when Managed Domains have signed up or
renewed their certificates. It is given the names of the processed MDs as
- arguments. It should return status code 0 to indicate that it has
- run successfully.
+ additional arguments (after the parameters specified here). It should
+ return status code 0 to indicate that it has run successfully.
</p>
</usage>
</directivesynopsis>
* @macro
* Version number of the md module as c string
*/
-#define MOD_MD_VERSION "1.1.10"
+#define MOD_MD_VERSION "1.1.12"
/**
* @macro
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
-#define MOD_MD_VERSION_NUM 0x01010a
+#define MOD_MD_VERSION_NUM 0x01010c
#define MD_ACME_DEF_URL "https://acme-v01.api.letsencrypt.org/directory"
wd->mc->notify_cmd, exit_code);
}
else {
+ if (APR_EINCOMPLETE == rv && exit_code) {
+ rv = 0;
+ }
ap_log_error(APLOG_MARK, APLOG_ERR, rv, wd->s, APLOGNO(10109)
- "executing configured MDNotifyCmd %s", wd->mc->notify_cmd);
+ "executing MDNotifyCmd %s returned %d",
+ wd->mc->notify_cmd, exit_code);
notified = 0;
}
}
int configured;
apr_status_t rv;
- if (!strncmp(ACME_CHALLENGE_PREFIX, r->parsed_uri.path, sizeof(ACME_CHALLENGE_PREFIX)-1)) {
+ if (r->parsed_uri.path
+ && !strncmp(ACME_CHALLENGE_PREFIX, r->parsed_uri.path, sizeof(ACME_CHALLENGE_PREFIX)-1)) {
sc = ap_get_module_config(r->server->module_config, &md_module);
if (sc && sc->mc) {
configured = (NULL != md_get_by_domain(sc->mc->mds, r->hostname));
const char *s;
int status;
- if (opt_ssl_is_https
+ if (opt_ssl_is_https && r->parsed_uri.path
&& strncmp(WELL_KNOWN_PREFIX, r->parsed_uri.path, sizeof(WELL_KNOWN_PREFIX)-1)) {
sc = ap_get_module_config(r->server->module_config, &md_module);
return apr_pstrcat(cmd->pool, "unsupported private key type \"", ptype, "\"", NULL);
}
-static const char *md_config_set_notify_cmd(cmd_parms *cmd, void *arg, const char *value)
+static const char *md_config_set_notify_cmd(cmd_parms *cmd, void *mconfig, const char *arg)
{
md_srv_conf_t *sc = md_config_get(cmd->server);
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
if (err) {
return err;
}
- sc->mc->notify_cmd = value;
- (void)arg;
+ sc->mc->notify_cmd = arg;
+ (void)mconfig;
return NULL;
}
"Time length for renewal before certificate expires (defaults to days)"),
AP_INIT_TAKE1( MD_CMD_REQUIREHTTPS, md_config_set_require_https, NULL, RSRC_CONF,
"Redirect non-secure requests to the https: equivalent."),
- AP_INIT_TAKE1( MD_CMD_NOTIFYCMD, md_config_set_notify_cmd, NULL, RSRC_CONF,
- "set the command to run when signup/renew of domain is complete."),
+ AP_INIT_RAW_ARGS(MD_CMD_NOTIFYCMD, md_config_set_notify_cmd, NULL, RSRC_CONF,
+ "set the command and optional arguments to run when signup/renew of domain is complete."),
AP_INIT_TAKE1( MD_CMD_BASE_SERVER, md_config_set_base_server, NULL, RSRC_CONF,
"allow managing of base server outside virtual hosts."),