mirror of
https://github.com/ciur/papermerge.git
synced 2026-04-25 03:55:58 +03:00
[GH-ISSUE #76] Does it support Mariadb/MySQL #56
Labels
No labels
2.1
3.0
3.0.1
3.0.2
3.0.3
3.0.3
3.1
3.2
3.2
3.3
3.5
3.x
Fixed. Waiting for feedback.
Fixed. Waiting for feedback.
UX
Version 2.1 - alpha
XSS
announcement
beta
blocker
bug
cannot reproduce
confirmed
confirmed
critical
demo
dependencies
deployment
detchnical debt
discussion
docker
documentation
donations
duplicate
enhancement
feature request
frontend
fundraising
good first issue
good issue
help wanted
high
implemented
important
improvement
incomplete
invalid
investigation
kubernetes
low
low impact
medium
medium
medium impact
migration from 2.0
migration from 2.1
missing-language
missing-ocr-language
no-activity
note
ocr
outofscope
packaging
performance
popular request
pull-request
pypi
question
raspberry pi
roadmap
search
security
setup
status
task
technical debt
updates
user xp
version 1.4.0 - demo
will be implemented
will not be implemented
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/papermerge#56
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BobWs on GitHub (Aug 19, 2020).
Original GitHub issue: https://github.com/ciur/papermerge/issues/76
Originally assigned to: @ciur on GitHub.
Hi,
I would love to try your program, but at the moment I’m only using Docker Mariadb for all my DB related containers. So I was wondering if your app supports Mariadb, I couldn’t find anything about that.
@ciur commented on GitHub (Aug 19, 2020):
Good point !
I never tried it, but in theory it should. Application code uses a layer of abstraction over DB - django's ORM system. So in theory you can configure it with Mariadb/MySql as well. However there is no documentation about this yet. I will handle this.
I will keep this ticket for reference to update documentation and try it myself with mariadb.
Thank you for opening this issue!
@BobWs commented on GitHub (Aug 19, 2020):
Good to know thanks for the opportunity. If you need someone for testing let me know, I’m glad to help. All the Docker container I’m running at the moment are running on Synology NAS.
@ciur commented on GitHub (Aug 21, 2020):
great!
Now there are around 10 new tickets. So it will take maybe a week until I will handle this one.
@Diablofan commented on GitHub (Aug 22, 2020):
I'd like to see MariaDB support as well as I would like to only have one database server installed for all my web applications. It would make it easier to integrate with backup scripts I already have setup as well.
But from what it looks like according to the documentation it appears to be hard coded that the DB type is either SQLite or PostgreSQL based off of the config options you provide without a way to specify a DB driver, which seems to be confirmed up by this section of code here.
I think the first thing that would need done is to the DB engine explicitly configurable so it would allow the use of other DB engines. Obviously you wouldn't want to break existing configurations, so one way to accomplish that could be that not specifying a DB engine type in the config would keep the existing behavior of SQLite or PostgreSQL.
@mtonnie commented on GitHub (Aug 22, 2020):
@Diablofan guess you are almost right, but the file you mentioned is just the basic (default) settings.
You can provide your own settings file, as it's done for the docker images as well.
I'm using this method as well for the Synology package you just have to create your file an export the variable.
For sure you have to take care that all needed requirements are fulfilled, e.g. required python packages are installed.
Don't know what's the best for solution for docker, make your own image or modify the existing one?
@ciur commented on GitHub (Aug 22, 2020):
Hi @Diablofan
@mtonnie is right.
Let me expand on what he said.
Papermerge is a Django based project - this means all django configurations apply, this includes django DATABASES settings..
The django settings files used in Papermerge is this file - as you can see, is pretty long - 400 lines of configurations is not a joke :) Look for word DATABASES in that files and you will understand immediately what's happening there.
@mtonnie point is (please correct me if I am wrong) that you can use django support for mariadb as described here - means just replace DATABASES current settings in base.py file with configs for mariadb.
Django supports Mariadb. Papermerge does not use any DB dependent features. Thus in theory it should work without any issue.
If you don't want to mess yourself with base.py, just wait couple of weeks and I will fix that. I will prioritize you request for mariadb support for minor release 1.4.1 (given the fact that there won't be any major issue...).
papermerge.conf.py is for convenience - so that people won't need to get lost in 400 lines (mixed with python logic) configuration file.
@mtonnie commented on GitHub (Aug 22, 2020):
@ciur
I would suggest just to make a second version of app and worker.production.py file e.g. app.production-mysql.py.
This file contains the mysql specific DATABASE definition an will be copied as production-mysql.py to config/settings folder.
We have to include the additional requirements as well (guess it's just mysqlclient) we will change the environment variable names for DB to be able to reuse them (POSTGRES_USER -> DB_USER for example).
By default docker will use postgres config, because it is set in the docker file, but the user can override the value for DJANGO_SETTINGS_MODULE (-e "DJANGO_SETTINGS_MODULE=config.settings.production-mysql").
What do you think about this solution?
Let me add one thing, for bare metal installations I don't think we will need any adaption. because the user can or have to create his own config.settings.xxxxx file.
@Diablofan commented on GitHub (Aug 22, 2020):
Ah, I see. I'll admit I'm not too familiar with how Django works so I didn't know that was possible, but thank you for the explanations @mtonnie and @ciur.
@ciur commented on GitHub (Aug 22, 2020):
Hi @mtonnie,
thank you for your suggestion. Give me some time to think about your solution and eventually alternative approaches.
@francescocarzaniga commented on GitHub (Oct 10, 2020):
I opened #158 to address this. Please take a look if this approach is decent enough.
@ciur commented on GitHub (Oct 11, 2020):
@francescocarzaniga, thank you for your PR! I merged it into master !