Closed sfpurdy closed 1 month ago
I closed my previous PR in favor of this new one. This is based on the latest release and takes the updates and fixes from the previous PR.
Thanks, we'll review.
We're really sorry about the delay. At the moment we're unable to review and merge this PR as we're considering requiring contributor licence agreement for contributions to this project. Please bear with us as we decide on this and we'll get back to you soon.
Hello again.
Again we apologize for the time it took us to get back to you. We'll unfortunately reject this PR. However, some of the issues raised here has already been addressed albeit in a different way.
First of all adding a default username and password is a very bad practice which we've purposely avoided, even at the cost of adding an extra step to the installation. Nonetheless, in the latest version of Bayanat, the first admin user can be created from the browser upon first use.
The current docker-compose.yml
has been changed a lot since your changes, although most of your requested changes are not addressed. It's optimized for security, reliability and simplicity but it's also serves as a general template for most users who will use the default settings. You're welcome to create your own to fit your infrastructure, unfortunately we won't incorporate your changes here. If you feel there are some changes needed to the current compose file which would affect general users please file a bug or new feature request so discuss the issues you're addressing and agree on a solution.
Lastly, regarding the connection dropping issue, could you please file a bug report to so we can better understand this issue? We need to check how and when this issue occur before we're able to merge a fix. This is to ensure there isn't a better solution available from our side.
Again thank you so much for your interest and contributions.
.env-sample
env_file
directive in Docker Composedocker-compose.override.yml
docker-compose up
, but this makes it easier to use a named volume in a Docker Swarm environmentdocker-compose.swarm.yml
CI_COMMIT_SHA
is the Git Commit SHA and is automatically added in a Gitlab CI/CD environmentdocker-compose.yml
docker-compose.override.yml
filerw
as that's the defaultbayanat
service - Set the PostgreSQL-related environment variables as well as the credentials for the initial admin user - Useenv_file
to set the environment variablescelery
serviceenv_file
to set the environment variablespostgres
service - Removed theenv_file
in favor of setting the environment variable in theenvironment
section. Dokcer Compose will read the values from the.env
file if it is there, otherwise it will use the defaults which match the values in.env-sample
celery
andbayanat
services to make sure they match-d
), and username (-U
) arguments for the healthcheck command as it was failing when these weren't set, causing the service to show as unhealthyENV_FILE
build argument from thecelery
andbayanat
services in favor of the setting that at runtime usingenv_file
- Copying in the.env
file during the build is problematic as it means you have to rebuild the container to change a configuration or at least mount a new.env
file at runtime. Thepython-dotenv
package will use environment variables instead of the.env
files anyway, so it's easier to just set them in theenv_file
section.127.0.0.1
in the port settings as it isn't necessary and may cause issues on remote serverscontainer_name
settings on all services as this can cause problems if running multiple versions of the Bayanat system at the same time. The container names will default to<folder name>_<service name>
, i.e. the default name for theredis
service if the folder is namedbayanat
will bebayanat_redis
.enferno/commands.py
install
command to allow the username and password to be passed in for unattended installations using environment variablesenferno/settings.py
PostgreSQL Connection Dropping
item belowenferno/tasks/__init__.py
PostgreSQL Connection Dropping
item belowflask/bin/entrypoint.sh
flask
role startupflask/Dockerfile
python3.8-
versions for thepython3-dev
and thepython3.10-venv
packages aspython3.10-venv
doesn't seem to exist in the apt repo and it makes sense to specify a particular version to avoid issues later if the default version updatesENV_FILE
build arg andCOPY
command in favor of using environment variables set at runtime using docker-compose (see note indocker-compose.yml
)ADMIN_USERNAME
andADMIN_PASSWORD
environment variablesflask/bin/entrypoint.sh
flask install
commandPostgreSQL Connection Dropping
There was an error that caused the PostgreSQL connection to drop when the cached connection goes stale. The fix to the error required the
pool_pre_ping=True
configuration to be passed to SQL Alchemy per the SQLAlchemy Documentation. This fix uses theSQLALCHEMY_ENGINE_OPTIONS
option of theflask-sqlalchemy
module to set thepool_pre_ping
configuration as outlined in the Module Docsenferno/tasks/__init__.py
Added
celery.conf.update({'database_engine_options': cfg.SQLALCHEMY_ENGINE_OPTIONS})
to set the valueenferno/settings.py
Added a config for
SQLALCHEMY_ENGINE_OPTIONS
that defaults toTrue