chore(api/settings): remove depreciated IS_DOCKER_SETUP variable
This configuration was for a very old Docker version that still supported linking containers together, which allowed for service discovery via the environment. This is not present in Docker anymore for many years now, so removing.
This commit is contained in:
parent
0559d0e215
commit
576083ba1e
|
@ -1,6 +1,5 @@
|
|||
import logging.config
|
||||
import sys
|
||||
import warnings
|
||||
from collections import OrderedDict
|
||||
from urllib.parse import urlparse, urlsplit
|
||||
|
||||
|
@ -36,8 +35,6 @@ Available levels:
|
|||
|
||||
"""
|
||||
|
||||
IS_DOCKER_SETUP = env.bool("IS_DOCKER_SETUP", False)
|
||||
|
||||
# allows makemigrations and superuser creation
|
||||
FORCE = env.bool("FORCE", False)
|
||||
|
||||
|
@ -395,31 +392,6 @@ vars().update(EMAIL_CONFIG)
|
|||
# ------------------------------------------------------------------------------
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
|
||||
|
||||
# The `_database_url_docker` variable will only by used as default for DATABASE_URL
|
||||
# in the context of a docker deployment.
|
||||
_database_url_docker = None
|
||||
if IS_DOCKER_SETUP and env.str("DATABASE_URL", None) is None:
|
||||
warnings.warn(
|
||||
DeprecationWarning(
|
||||
"the automatically generated 'DATABASE_URL' configuration in the docker "
|
||||
"setup is deprecated, please configure either the 'DATABASE_URL' "
|
||||
"environment variable or the 'DATABASE_HOST', 'DATABASE_USER' and "
|
||||
"'DATABASE_PASSWORD' environment variables instead"
|
||||
)
|
||||
)
|
||||
_DOCKER_DATABASE_HOST = "postgres"
|
||||
_DOCKER_DATABASE_PORT = 5432
|
||||
_DOCKER_DATABASE_USER = env.str("POSTGRES_ENV_POSTGRES_USER", "postgres")
|
||||
_DOCKER_DATABASE_PASSWORD = env.str("POSTGRES_ENV_POSTGRES_PASSWORD", "")
|
||||
_DOCKER_DATABASE_NAME = _DOCKER_DATABASE_USER
|
||||
|
||||
_database_url_docker = (
|
||||
f"postgres:"
|
||||
f"//{_DOCKER_DATABASE_USER}:{_DOCKER_DATABASE_PASSWORD}"
|
||||
f"@{_DOCKER_DATABASE_HOST}:{_DOCKER_DATABASE_PORT}"
|
||||
f"/{_DOCKER_DATABASE_NAME}"
|
||||
)
|
||||
|
||||
DATABASE_HOST = env.str("DATABASE_HOST", "localhost")
|
||||
"""
|
||||
The hostname of the PostgreSQL server. Defaults to ``localhost``.
|
||||
|
@ -442,8 +414,7 @@ The name of the PostgreSQL database. Defaults to ``funkwhale``.
|
|||
"""
|
||||
DATABASE_URL = env.db(
|
||||
"DATABASE_URL",
|
||||
_database_url_docker # This is only set in the context of a docker deployment.
|
||||
or (
|
||||
(
|
||||
f"postgres:"
|
||||
f"//{DATABASE_USER}:{DATABASE_PASSWORD}"
|
||||
f"@{DATABASE_HOST}:{DATABASE_PORT}"
|
||||
|
@ -840,11 +811,7 @@ if AUTH_LDAP_ENABLED:
|
|||
# SLUGLIFIER
|
||||
AUTOSLUG_SLUGIFY_FUNCTION = "slugify.slugify"
|
||||
|
||||
CACHE_URL_DEFAULT = "redis://127.0.0.1:6379/0"
|
||||
if IS_DOCKER_SETUP:
|
||||
CACHE_URL_DEFAULT = "redis://redis:6379/0"
|
||||
|
||||
CACHE_URL = env.str("CACHE_URL", default=CACHE_URL_DEFAULT)
|
||||
CACHE_URL = env.str("CACHE_URL", default="redis://127.0.0.1:6379/0")
|
||||
"""
|
||||
The URL of your redis server. For example:
|
||||
|
||||
|
@ -1529,10 +1496,7 @@ TYPESENSE_PROTOCOL = env("TYPESENSE_PROTOCOL", default="http")
|
|||
"""Typesense listening protocol"""
|
||||
TYPESENSE_HOST = env(
|
||||
"TYPESENSE_HOST",
|
||||
default="typesense" if IS_DOCKER_SETUP else "localhost",
|
||||
default="localhost",
|
||||
)
|
||||
"""
|
||||
Typesense hostname. Defaults to `localhost` on non-Docker deployments and to `typesense` on
|
||||
Docker deployments.
|
||||
"""
|
||||
"""Typesense hostname. Defaults to `localhost`."""
|
||||
TYPESENSE_NUM_TYPO = env("TYPESENSE_NUM_TYPO", default=5)
|
||||
|
|
Loading…
Reference in New Issue