mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-12-16 20:43:24 +00:00
Moved certrbot plugin list to backend
frontend doesn't include when building in react version adds swagger for existing dns-providers endpoint
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import batchflow from "batchflow";
|
||||
import dnsPlugins from "../global/certbot-dns-plugins.json" with { type: "json" };
|
||||
import dnsPlugins from "../certbot/dns-plugins.json" with { type: "json" };
|
||||
import { certbot as logger } from "../logger.js";
|
||||
import errs from "./error.js";
|
||||
import utils from "./utils.js";
|
||||
@@ -8,7 +8,7 @@ const CERTBOT_VERSION_REPLACEMENT = "$(certbot --version | grep -Eo '[0-9](\\.[0
|
||||
|
||||
/**
|
||||
* Installs a cerbot plugin given the key for the object from
|
||||
* ../global/certbot-dns-plugins.json
|
||||
* ../certbot/dns-plugins.json
|
||||
*
|
||||
* @param {string} pluginKey
|
||||
* @returns {Object}
|
||||
|
||||
@@ -24,16 +24,21 @@ const apiValidator = async (schema, payload /*, description*/) => {
|
||||
throw new errs.ValidationError("Payload is undefined");
|
||||
}
|
||||
|
||||
|
||||
const validate = ajv.compile(schema);
|
||||
|
||||
const valid = validate(payload);
|
||||
|
||||
|
||||
if (valid && !validate.errors) {
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const message = ajv.errorsText(validate.errors);
|
||||
const err = new errs.ValidationError(message);
|
||||
err.debug = [validate.errors, payload];
|
||||
err.debug = {validationErrors: validate.errors, payload};
|
||||
throw err;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user