mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-11-06 10:25:14 +00:00
Compare commits
5 Commits
master
...
sqlite-tes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7214bcdacb | ||
|
|
9dc7dc28d4 | ||
|
|
36e040157f | ||
|
|
be2599872e | ||
|
|
d7ff736abf |
@@ -1,6 +1,8 @@
|
||||
import knex from "knex";
|
||||
import {configGet, configHas} from "./lib/config.js";
|
||||
|
||||
let instance = null;
|
||||
|
||||
const generateDbConfig = () => {
|
||||
if (!configHas("database")) {
|
||||
throw new Error(
|
||||
@@ -30,4 +32,11 @@ const generateDbConfig = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export default knex(generateDbConfig());
|
||||
const getInstance = () => {
|
||||
if (!instance) {
|
||||
instance = knex(generateDbConfig());
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
export default getInstance;
|
||||
|
||||
@@ -2,9 +2,9 @@ import db from "./db.js";
|
||||
import { migrate as logger } from "./logger.js";
|
||||
|
||||
const migrateUp = async () => {
|
||||
const version = await db.migrate.currentVersion();
|
||||
const version = await db().migrate.currentVersion();
|
||||
logger.info("Current database version:", version);
|
||||
return await db.migrate.latest({
|
||||
return await db().migrate.latest({
|
||||
tableName: "migrations",
|
||||
directory: "migrations",
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import now from "./now_helper.js";
|
||||
import ProxyHostModel from "./proxy_host.js";
|
||||
import User from "./user.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
const boolFields = ["is_deleted", "satisfy_any", "pass_auth"];
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import db from "../db.js";
|
||||
import accessListModel from "./access_list.js";
|
||||
import now from "./now_helper.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
class AccessListAuth extends Model {
|
||||
$beforeInsert() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import db from "../db.js";
|
||||
import accessListModel from "./access_list.js";
|
||||
import now from "./now_helper.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
class AccessListClient extends Model {
|
||||
$beforeInsert() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import db from "../db.js";
|
||||
import now from "./now_helper.js";
|
||||
import User from "./user.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
class AuditLog extends Model {
|
||||
$beforeInsert() {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { convertBoolFieldsToInt, convertIntFieldsToBool } from "../lib/helpers.j
|
||||
import now from "./now_helper.js";
|
||||
import User from "./user.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
const boolFields = ["is_deleted"];
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import redirectionHostModel from "./redirection_host.js";
|
||||
import streamModel from "./stream.js";
|
||||
import userModel from "./user.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
const boolFields = ["is_deleted"];
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import Certificate from "./certificate.js";
|
||||
import now from "./now_helper.js";
|
||||
import User from "./user.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
const boolFields = ["is_deleted", "ssl_forced", "http2_support", "enabled", "hsts_enabled", "hsts_subdomains"];
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Model } from "objection";
|
||||
import db from "../db.js";
|
||||
import { isSqlite } from "../lib/config.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
export default () => {
|
||||
if (isSqlite()) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import Certificate from "./certificate.js";
|
||||
import now from "./now_helper.js";
|
||||
import User from "./user.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
const boolFields = [
|
||||
"is_deleted",
|
||||
|
||||
@@ -8,7 +8,7 @@ import Certificate from "./certificate.js";
|
||||
import now from "./now_helper.js";
|
||||
import User from "./user.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
const boolFields = [
|
||||
"is_deleted",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Model } from "objection";
|
||||
import db from "../db.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
class Setting extends Model {
|
||||
$beforeInsert () {
|
||||
|
||||
@@ -5,7 +5,7 @@ import Certificate from "./certificate.js";
|
||||
import now from "./now_helper.js";
|
||||
import User from "./user.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
const boolFields = ["is_deleted", "enabled", "tcp_forwarding", "udp_forwarding"];
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { convertBoolFieldsToInt, convertIntFieldsToBool } from "../lib/helpers.j
|
||||
import now from "./now_helper.js";
|
||||
import UserPermission from "./user_permission.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
const boolFields = ["is_deleted", "is_disabled"];
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Model } from "objection";
|
||||
import db from "../db.js";
|
||||
import now from "./now_helper.js";
|
||||
|
||||
Model.knex(db);
|
||||
Model.knex(db());
|
||||
|
||||
class UserPermission extends Model {
|
||||
$beforeInsert () {
|
||||
|
||||
@@ -1847,9 +1847,9 @@ netmask@^2.0.2:
|
||||
integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==
|
||||
|
||||
node-abi@^3.3.0:
|
||||
version "3.78.0"
|
||||
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.78.0.tgz#fd0ecbd0aa89857b98da06bd3909194abb0821ba"
|
||||
integrity sha512-E2wEyrgX/CqvicaQYU3Ze1PFGjc4QYPGsjUrlYkqAE0WjHEZwgOsGMPMzkMse4LjJbDmaEuDX3CM036j5K2DSQ==
|
||||
version "3.80.0"
|
||||
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.80.0.tgz#d7390951f27caa129cceeec01e1c20fc9f07581c"
|
||||
integrity sha512-LyPuZJcI9HVwzXK1GPxWNzrr+vr8Hp/3UqlmWxxh8p54U1ZbclOqbSog9lWHaCX+dBaiGi6n/hIX+mKu74GmPA==
|
||||
dependencies:
|
||||
semver "^7.3.5"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
# This file assumes that the frontend has been built using ./scripts/frontend-build
|
||||
|
||||
FROM nginxproxymanager/testca AS testca
|
||||
FROM letsencrypt/pebble AS pebbleca
|
||||
FROM nginxproxymanager/nginx-full:certbot-node
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
@@ -46,7 +45,6 @@ RUN yarn install \
|
||||
|
||||
# add late to limit cache-busting by modifications
|
||||
COPY docker/rootfs /
|
||||
COPY --from=pebbleca /test/certs/pebble.minica.pem /etc/ssl/certs/pebble.minica.pem
|
||||
COPY --from=testca /home/step/certs/root_ca.crt /etc/ssl/certs/NginxProxyManager.crt
|
||||
|
||||
# Remove frontend service not required for prod, dev nginx config as well
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
FROM nginxproxymanager/testca AS testca
|
||||
FROM letsencrypt/pebble AS pebbleca
|
||||
FROM nginxproxymanager/nginx-full:certbot-node
|
||||
LABEL maintainer="Jamie Curnow <jc@jc21.com>"
|
||||
|
||||
@@ -33,7 +32,6 @@ RUN rm -f /etc/nginx/conf.d/production.conf \
|
||||
&& chmod 644 -R /root/.cache
|
||||
|
||||
# Certs for testing purposes
|
||||
COPY --from=pebbleca /test/certs/pebble.minica.pem /etc/ssl/certs/pebble.minica.pem
|
||||
COPY --from=testca /home/step/certs/root_ca.crt /etc/ssl/certs/NginxProxyManager.crt
|
||||
|
||||
EXPOSE 80 81 443
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"pebble": {
|
||||
"listenAddress": "0.0.0.0:443",
|
||||
"managementListenAddress": "0.0.0.0:15000",
|
||||
"certificate": "test/certs/localhost/cert.pem",
|
||||
"privateKey": "test/certs/localhost/key.pem",
|
||||
"httpPort": 80,
|
||||
"tlsPort": 443,
|
||||
"ocspResponderURL": "",
|
||||
"externalAccountBindingRequired": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user