[PR #256] [CLOSED] [WIP] added experimental multidb support #3209

Closed
opened 2026-02-26 07:38:28 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/256
Author: @tg44
Created: 12/15/2019
Status: Closed

Base: masterHead: multidb5


📝 Commits (1)

  • bac0de7 added experimental multidb support

📊 Changes

20 files changed (+213 additions, -114 deletions)

View changed files

.dockerignore (+7 -0)
📝 Dockerfile (+11 -9)
📝 doc/INSTALL.md (+35 -0)
📝 package.json (+4 -2)
📝 src/backend/db.js (+21 -13)
📝 src/backend/migrations/20180929054513_websockets.js (+1 -1)
📝 src/backend/migrations/20190227065017_settings.js (+0 -16)
📝 src/backend/models/access_list.js (+4 -3)
📝 src/backend/models/access_list_auth.js (+4 -3)
📝 src/backend/models/audit-log.js (+4 -3)
📝 src/backend/models/auth.js (+4 -3)
📝 src/backend/models/certificate.js (+5 -4)
📝 src/backend/models/dead_host.js (+4 -3)
src/backend/models/now_helper.js (+15 -0)
📝 src/backend/models/proxy_host.js (+4 -3)
📝 src/backend/models/redirection_host.js (+4 -3)
📝 src/backend/models/stream.js (+4 -3)
📝 src/backend/models/user.js (+4 -3)
📝 src/backend/models/user_permission.js (+4 -3)
📝 src/backend/setup.js (+74 -39)

📄 Description

It's probably not a single-commit change, but I will summarize what I done;

  • I made the Dockerfile to work as a docker file (the build is stateless)
    • this should be either reverted or copied over to the other archtypes
    • also added a dockerignore
    • it was a "must" bcs I can't make my mac to build this project correctly
    • probably a "how to contribute" readme would solve this also
  • updated the knex dep
    • also went to mysql2
    • also added the sqlite3
    • also added the pg
  • added a knex-native engine (db.js and install.md)
  • fixed the migration (20190227065017_settings.js)
    • as I understand we start a db and migrate it, and while we in a transaction to migrate we also try to write the db from an another (or maybe from the same?) db connection. This is simply not working with sqlite bcs you have only one thread/connection/whatever to write the db. Also it seems to be a bad thing according the knox github issues.
  • moved the insert statement from the migration to the setup (setup.js)
    • also refactored the file a bit so its probably more readable
  • added a now_helper
    • bcs sqlite is a dummy
  • used the now_helper instead of the Model.raw

If you want atomic commits I think the correct steps would be:

  • write a developer doc OR fix docker
  • factor out now_helper
  • factor out + fix the migration and refactor the setup
  • add the new engine + deps + extend the now_helper

It is working with sqlite3 right now. I didn't test mysql, and pg. (Also probably would be nice to make the compose stack to support examples to all three and add default configs to all three.)

(I love the idea and the functionality BTW, really nice app!)

Probably fixes #185 and fixes #200


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NginxProxyManager/nginx-proxy-manager/pull/256 **Author:** [@tg44](https://github.com/tg44) **Created:** 12/15/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `multidb5` --- ### 📝 Commits (1) - [`bac0de7`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/bac0de73006878d4505e2265aa07a30aefa9ccf0) added experimental multidb support ### 📊 Changes **20 files changed** (+213 additions, -114 deletions) <details> <summary>View changed files</summary> ➕ `.dockerignore` (+7 -0) 📝 `Dockerfile` (+11 -9) 📝 `doc/INSTALL.md` (+35 -0) 📝 `package.json` (+4 -2) 📝 `src/backend/db.js` (+21 -13) 📝 `src/backend/migrations/20180929054513_websockets.js` (+1 -1) 📝 `src/backend/migrations/20190227065017_settings.js` (+0 -16) 📝 `src/backend/models/access_list.js` (+4 -3) 📝 `src/backend/models/access_list_auth.js` (+4 -3) 📝 `src/backend/models/audit-log.js` (+4 -3) 📝 `src/backend/models/auth.js` (+4 -3) 📝 `src/backend/models/certificate.js` (+5 -4) 📝 `src/backend/models/dead_host.js` (+4 -3) ➕ `src/backend/models/now_helper.js` (+15 -0) 📝 `src/backend/models/proxy_host.js` (+4 -3) 📝 `src/backend/models/redirection_host.js` (+4 -3) 📝 `src/backend/models/stream.js` (+4 -3) 📝 `src/backend/models/user.js` (+4 -3) 📝 `src/backend/models/user_permission.js` (+4 -3) 📝 `src/backend/setup.js` (+74 -39) </details> ### 📄 Description It's probably not a single-commit change, but I will summarize what I done; - I made the Dockerfile to work as a docker file (the build is stateless) - this should be either reverted or copied over to the other archtypes - also added a dockerignore - it was a "must" bcs I can't make my mac to build this project correctly - probably a "how to contribute" readme would solve this also - updated the knex dep - also went to mysql2 - also added the sqlite3 - also added the pg - added a `knex-native` engine (`db.js` and `install.md`) - fixed the migration (`20190227065017_settings.js`) - as I understand we start a db and migrate it, and while we in a transaction to migrate we also try to write the db from an another (or maybe from the same?) db connection. This is simply not working with sqlite bcs you have only one thread/connection/whatever to write the db. Also it seems to be a bad thing according the knox github issues. - moved the insert statement from the migration to the setup (`setup.js`) - also refactored the file a bit so its probably more readable - added a `now_helper` - bcs sqlite is a dummy - used the `now_helper` instead of the `Model.raw` If you want atomic commits I think the correct steps would be: - write a developer doc OR fix docker - factor out now_helper - factor out + fix the migration and refactor the setup - add the new engine + deps + extend the now_helper It is working with sqlite3 right now. I didn't test mysql, and pg. (Also probably would be nice to make the compose stack to support examples to all three and add default configs to all three.) (I love the idea and the functionality BTW, really nice app!) Probably fixes #185 and fixes #200 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 07:38:28 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#3209
No description provided.