mirror of
https://github.com/ciur/papermerge.git
synced 2026-04-25 12:05:58 +03:00
[GH-ISSUE #65] Discussion: New configuration system #46
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#46
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 @langimike on GitHub (Aug 13, 2020).
Original GitHub issue: https://github.com/ciur/papermerge/issues/65
I have been trying to deploy papermerge on Podman containers and came to the point, where it would be necessary to customize a few settings and override config settings in the configuration files within the containers. I know this is possible via a volume mounts, but feels a bit cumbersome to me (maybe I have overlooked something, and this is possible in some more elegant way - in this case please simply close and forget this issue 😉 ).
Since I have used Django Environ in a few projects, I asked myself, if you would be interested in discussing an adoption of this configuration method in papermerge.
This way, you could use sensible defaults in a simple settings.py and in case of running on a docker/podman container have all necessary settings overridden using environment variables and in case of running under systemd with an environment file. I know, this would be quite a breaking change.
If you are interested, I am really interested in helping out and creating a pull request.
Nonetheless, it's just an idea.
@ciur commented on GitHub (Aug 13, 2020):
Hi @langimike
Thank you for opening this discussion.
The thing is, Papermerge used to have a configuration system very similar to django environ that you mentioned. To be honest, I really love that approach (.env file + read settings from environment variables)!
But in practice, those approaches (dotenv, django environ) have drawbacks.
One drawback (and least problematic) is that .env file limits variables syntax. I encountered this issue when I introduced metadata plugins. Metadata plugins are declared as list. IMHO python syntax is very user friendly in that regard - while .env syntax, well, it depends...
Another drawback, which I find as very is serious one - it is when it comes to deploying Papermerge/Django project in production under Apache (mod_wsgi + apache2). Passing environment variables from under apache is, to say the least - not as flexible as compared to deploying from nginx + gunicorn (or even docker containers). Apache Web server has little bit weird way of working with environment variables and it does not pass to django application variables as say gunicorn does.
So, my point is that I won't mess around with configuration system at this moment - as it is flexible enough to work in different environments (development, test, production: gunicorn, uwsgi, apache2 + mod_wsgi).
@langimike commented on GitHub (Aug 13, 2020):
I definitely understand your points.
I think, it's primarily a matter of taste, because for the first drawback django-environ supports all sorts of python datatypes and the second drawback comes from one's preferred way of deployment (apache2+mod_wsgi vs. nginx+uwsgi or nginx+daphne).
My ideas/suggestions source in me trying to configure database settings (host, user, password) within the containers. The only way I found to override them, is mounting modified app.production.py and worker.production.py to /opt/app/config/settings/production.py.
But don't mind, I got it running.
Thank you!
@ciur commented on GitHub (Aug 14, 2020):
Great that you have Papermerge up and running!
I will close this issue then.
Thank you!