standardnotes / self-hosted

[Legacy] Self-host your own Standard Notes server for end-to-end encrypted notes and files
https://github.com/standardnotes/server
GNU Affero General Public License v3.0
342 stars 38 forks source link

Supported database servers #63

Open mechanarchy opened 2 years ago

mechanarchy commented 2 years ago

The official docs only mention MySQL as a database storage engine. Mo has also hinted that AWS RDS is a suitable target:

The account will be created on a MySQL database initialized by the Docker instance. You can specify an external database (such as AWS RDB) by editing your .env file. Originally posted by @moughxyz in https://github.com/standardnotes/standalone/issues/47#issuecomment-922925855

In my case, I am already running a PostgreSQL server in my stack and would prefer to consolidate Standard Notes onto that, if it is supported or even just "unsupported but shouldn't break". It would also be nice to have a couple of extra sentences on the official docs link above mentioning other common database technologies (even if they're unsupported) for clarity.

What is the status of other DB backends with Standard Notes?

moughxyz commented 2 years ago

We haven't tested any other DBs so we can't really say anything in our docs about them. But if you do test it out let us know how it works out and we can build on that.

mechanarchy commented 2 years ago

I did a brief look through the code and unfortunately in its current state I'm not able to try it out, as the database connection type is hard-coded to mysql. Can you please expose an environment variable for these?

https://github.com/standardnotes/syncing-server-js/blob/288bec995672123a68799943fcfada27864284bd/src/Bootstrap/Container.ts#L75-L76

https://github.com/standardnotes/auth/blob/60db98c90910a33e0dfe0ed30303a4fe5dfb708e/src/Bootstrap/Container.ts#L143-L144


Ah, don't bother. There are hard-coded migrations which use non-portable MySQL specific syntax: https://github.com/standardnotes/auth/blob/60db98c90910a33e0dfe0ed30303a4fe5dfb708e/migrations/1606470249553-init_database.ts#L6-L8

Evidently the project will be locked to MySQL for some time yet.