mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-03-13 02:50:09 +00:00
Regenerate configs improvements
All checks were successful
Close stale issues and PRs / stale (push) Successful in 33s
All checks were successful
Close stale issues and PRs / stale (push) Successful in 33s
- Fix certificates - Adds dry run - code cleanup
This commit is contained in:
@@ -194,7 +194,7 @@ const internalDeadHost = {
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.andWhere("id", data.id)
|
||||
.allowGraph("[owner,certificate]")
|
||||
.allowGraph(deadHostModel.defaultAllowGraph)
|
||||
.first();
|
||||
|
||||
if (accessData.permission_visibility !== "all") {
|
||||
@@ -347,7 +347,7 @@ const internalDeadHost = {
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.groupBy("id")
|
||||
.allowGraph("[owner,certificate]")
|
||||
.allowGraph(deadHostModel.defaultAllowGraph)
|
||||
.orderBy(castJsonIfNeed("domain_names"), "ASC");
|
||||
|
||||
if (accessData.permission_visibility !== "all") {
|
||||
|
||||
@@ -115,9 +115,9 @@ const internalProxyHost = {
|
||||
*/
|
||||
update: (access, data) => {
|
||||
let thisData = data;
|
||||
const create_certificate = thisData.certificate_id === "new";
|
||||
const createCertificate = thisData.certificate_id === "new";
|
||||
|
||||
if (create_certificate) {
|
||||
if (createCertificate) {
|
||||
delete thisData.certificate_id;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ const internalProxyHost = {
|
||||
);
|
||||
}
|
||||
|
||||
if (create_certificate) {
|
||||
if (createCertificate) {
|
||||
return internalCertificate
|
||||
.createQuickCertificate(access, {
|
||||
domain_names: thisData.domain_names || row.domain_names,
|
||||
@@ -232,7 +232,6 @@ const internalProxyHost = {
|
||||
*/
|
||||
get: (access, data) => {
|
||||
const thisData = data || {};
|
||||
|
||||
return access
|
||||
.can("proxy_hosts:get", thisData.id)
|
||||
.then((access_data) => {
|
||||
@@ -240,7 +239,7 @@ const internalProxyHost = {
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.andWhere("id", thisData.id)
|
||||
.allowGraph("[owner,access_list.[clients,items],certificate]")
|
||||
.allowGraph(proxyHostModel.defaultAllowGraph)
|
||||
.first();
|
||||
|
||||
if (access_data.permission_visibility !== "all") {
|
||||
@@ -422,11 +421,12 @@ const internalProxyHost = {
|
||||
*/
|
||||
getAll: async (access, expand, searchQuery) => {
|
||||
const accessData = await access.can("proxy_hosts:list");
|
||||
|
||||
const query = proxyHostModel
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.groupBy("id")
|
||||
.allowGraph("[owner,access_list,certificate]")
|
||||
.allowGraph(proxyHostModel.defaultAllowGraph)
|
||||
.orderBy(castJsonIfNeed("domain_names"), "ASC");
|
||||
|
||||
if (accessData.permission_visibility !== "all") {
|
||||
|
||||
@@ -229,7 +229,6 @@ const internalRedirectionHost = {
|
||||
*/
|
||||
get: (access, data) => {
|
||||
const thisData = data || {};
|
||||
|
||||
return access
|
||||
.can("redirection_hosts:get", thisData.id)
|
||||
.then((access_data) => {
|
||||
@@ -237,7 +236,7 @@ const internalRedirectionHost = {
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.andWhere("id", thisData.id)
|
||||
.allowGraph("[owner,certificate]")
|
||||
.allowGraph(redirectionHostModel.defaultAllowGraph)
|
||||
.first();
|
||||
|
||||
if (access_data.permission_visibility !== "all") {
|
||||
@@ -426,7 +425,7 @@ const internalRedirectionHost = {
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.groupBy("id")
|
||||
.allowGraph("[owner,certificate]")
|
||||
.allowGraph(redirectionHostModel.defaultAllowGraph)
|
||||
.orderBy(castJsonIfNeed("domain_names"), "ASC");
|
||||
|
||||
if (access_data.permission_visibility !== "all") {
|
||||
|
||||
@@ -178,7 +178,6 @@ const internalStream = {
|
||||
*/
|
||||
get: (access, data) => {
|
||||
const thisData = data || {};
|
||||
|
||||
return access
|
||||
.can("streams:get", thisData.id)
|
||||
.then((access_data) => {
|
||||
@@ -186,7 +185,7 @@ const internalStream = {
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.andWhere("id", thisData.id)
|
||||
.allowGraph("[owner,certificate]")
|
||||
.allowGraph(streamModel.defaultAllowGraph)
|
||||
.first();
|
||||
|
||||
if (access_data.permission_visibility !== "all") {
|
||||
@@ -375,7 +374,7 @@ const internalStream = {
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.groupBy("id")
|
||||
.allowGraph("[owner,certificate]")
|
||||
.allowGraph(streamModel.defaultAllowGraph)
|
||||
.orderBy("incoming_port", "ASC");
|
||||
|
||||
if (access_data.permission_visibility !== "all") {
|
||||
|
||||
Reference in New Issue
Block a user